[Haskell-beginners] lambda notation vs function-argument notation in GHCi
Morel Pisum
morel.pisum at googlemail.com
Sun Jun 17 09:13:28 CEST 2012
Let's define a function in GHCi:
> Prelude> let f s n = and (map (==s) n)
> Prelude> :t f
> f :: Eq a => a -> [a] -> Bool
This is fine. But when I define this function using lambda notation, I
get this
> Prelude> let f = \s n -> and (map (==s) n)
> Prelude> :t f
> f :: () -> [()] -> Bool
which is really weird.
Why does this happen?
More information about the Beginners
mailing list