Is LINQ to objects a collection of combinators?
Posted
by
Jimmy Hoffa
on Programmers
See other posts from Programmers
or by Jimmy Hoffa
Published on 2012-10-23T15:28:53Z
Indexed on
2012/10/23
17:19 UTC
Read the original article
Hit count: 363
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?
© Programmers or respective owner