[Haskell-cafe] Signatures in defining functions
bugfact at gmail.com
Thu Feb 5 18:21:12 EST 2009
Maybe you mean that
f :: Int -> Int -> Int
does not say much about what the function does since the Int arguments have
no "name" in Haskell?
E.g. the following might "mean" more, but is not valid Haskell:
f :: numerator:Int -> denominator:Int -> quotient:Int
In Haskell you regularly see documentation that says: "the 4th argument of
dpSwitch is ..., the 7th argument of dpSwitch is ..."
That's okay, since it trains you at counting :-) Of course, I'm being
But most of the time, this is not an issue, since functions usually only
have a few arguments, or have argument types that tell more.
2009/2/5 TKM <temp.public at gmail.com>
> I'm kind of new with Haskell and I would like to know about the following:
> [some function]:: Int -> Int -> Int
> Now is my question, how should I interpret "Int -> Int -> Int"? Meaning
> what does "Int -> Int -> Int" mean?
> Thank you for answering my question.
> Kind Regards, JTKM
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe