
Am Freitag, den 13.07.2012, 06:57 -0700 schrieb Donn Cave:
Quoth Cale Gibbard:
Personally I don't see why everyone appears to prefer the syntax with \ in it over just the obvious case section syntax which was originally proposed.
case of { ... } ... Does anyone else agree?
Yes. I don't see this as an `anonymous function' in any special sense, only inasmuch as the workaround in its absence involves one. I.e., if I for some reason had been compelled to write \ a -> hPutStrLn stdout a
... that wouldn't make "hPutStrLn stdout" an anonymous function in my book. Neither is `case of ...' an anonymous function, or functions.
Donn
What is an anonymous function? A function that has no name, that is, a function that is not assigned to an identifier. So (+ 1), \x -> x + 1, and any lambda case are all anonymous functions. Best wishes, Wolfgang