[Haskell-cafe] Point-free style
Ketil Malde
ketil+haskell at ii.uib.no
Fri Feb 11 03:00:48 EST 2005
Matthew Roberts <mattr at ics.mq.edu.au> writes:
>> [Point-free] compositions of functions with arity greater than 1,
>> [...] compositions of sections of composition or application,
>> arrow notation without the sugar, and so forth---will always be more
>> difficult to read and understand than the direct version.
> I have to agree (although I suspect few others will :))
I tend to agree, also. Type signatures help, of course. E.g. with
the previously mentioned and rather cryptic function
(.) . (.) .(.)
I entered it into GHCi, and got
:: forall a a b c a.
(b -> c) -> (a -> a -> a -> b) -> a -> a -> a -> c
and it suddenly is much clearer what it does.
-kzm
--
If I haven't seen further, it is by standing in the footprints of giants
More information about the Haskell-Cafe
mailing list