
15 Aug
2009
15 Aug
'09
1:04 p.m.
In article <1B14D870-7355-4EFD-B0C6-026109AB4F87@ece.cmu.edu>, Brandon S. Allbery KF8NH wrote:
In C you have to declare it.
The word would be `define'?
In Haskell you can just do it on the fly:
map (add 3) [1..10]
I see. Just like we can create an integer on the fly in C, in Haskell we can create functions on the fly. I guess that's quite a difference.
or indeed
map (+3) [1..10]
(The above is actually a "section", a closure created from an infix function. The difference is that I can specify either side of the operator, whereas to specify arguments other than the first for a regular function I must either coerce it into infix with `` or use the "flip" function to rearrange arguments.)
And is this mere syntax sugar?