Is LINQ to objects a collection of combinators?
- by Jimmy Hoffa
I was just trying to explain the usefulness of combinators to a colleague and I told him LINQ to objects are like combinators as they exhibit the same value, the ability to combine small pieces to create a single large piece. Though I don't know that I can call LINQ to objects combinators.
I've seen 2 levels of definition for combinator that I generalize as such:
A combinator is a function which only uses things passed to it
A combinator is a function which only uses things passed to it and other standard atomic functions but not state
The first is very rigid and can be seen in the combinatory calculus systems and in haskell things like $ and . and various similar functions meet this rule.
The second is less rigid and would allow something like sum as it uses the + function which was not passed in but is standard and not stateful.
Though the LINQ extensions in C# use state in their iteration models, so I feel I can't say they're combinators.
Can someone who understands the definition of a combinator more thoroughly and with more experience in these realms give a distinct ruling on this? Are my definitions of 'combinator' wrong to begin with?