I read about combinators and saw how useful they are (e.g. in Haskell Parsec). My problem is that I'm not quite sure how to use them in practice.
This is the outline of the problem: distributions can be generated, filtered, and modified. Distributions can be combined to create new distributions.
The main interfaces (in pseudo-Haskell type terminology):
generator:: parameters -> distribution selector:: parameters -> (distribution -> distribution) modifier:: parameters -> (distribution -> distribution)
Now I think I see three combinators:
combine:: generator -> generator -> generator filter:: generator -> selector -> generator modify:: generator -> modifier -> generator
Are they actually combinators? Combinators make sense / are there any other obvious combinators that I miss?
Thanks for any advice.
functional-programming haskell combinators higher-order-functions
Matt fenwick
source share