Wed, 05 Apr 2000 19:37:06 +0200, Ralf Muschall <[EMAIL PROTECTED]> pisze:

> and the type declaration you gave seems to be the most general
> possible anyway, i.e. it does not carry any information.

It does: documentation.

It happens that in this case "flip (.)" is more clear documentation
for me than the type signature. But often the type signature alone
is sufficient to suggest the most natural meaning, e.g.
    [(a,b)] -> ([a],[b])
    (a -> c) -> (b -> c) -> Either a b -> c
    [[a]] -> [a]
    (a -> b -> c) -> (b -> a -> c)

ghc -Wall gives warnings for toplevel definitions without type
signatures.

> Where does the habit to use "flip (.)" in many FP people come from?

I don't know, I use non-flipped (.). But if we wrote function
application in the "argument + function" order, composition would
certainly be written backwards as well.

Although in "f . g" it seems that g will be computed first, actually
in a lazy language it is f who decides what to do earlier :-)

-- 
 __("<    Marcin Kowalczyk * [EMAIL PROTECTED] http://qrczak.ids.net.pl/
 \__/              GCS/M d- s+:-- a23 C+++$ UL++>++++$ P+++ L++>++++$ E-
  ^^                  W++ N+++ o? K? w(---) O? M- V? PS-- PE++ Y? PGP+ t
QRCZAK                  5? X- R tv-- b+>++ DI D- G+ e>++++ h! r--%>++ y-


Reply via email to