
18 Feb
2012
18 Feb
'12
2:44 p.m.
On Sat, Feb 18, 2012 at 1:33 PM, bahadýr altan
Hello. I saw the dot "." operator in some Haskell codes, but I couldn't figure out what it does. I didn't see it in some books and tutorials and couldn't find an explanation on the Internet. Could you tell me what it does?
Thanks:)
Since it is an ordinary haskell function, it is something you can look up with Hoogle: http://www.haskell.org/hoogle/?hoogle=%28.%29 It is used for function composition - for example if you wrote a function:
myFunc x = func1 (func2 x)
you can re-write this to:
myFunc = func1 . func2
It's useful to cut down on parenthesis when you have a chain of functions taking one argument. Antoine