
3 Jan
2008
3 Jan
'08
3:16 p.m.
Furthermore, IMHO, type signatures alone are not enough, a good parameter name says at least as much as the type.
Yes! A very good point! :)
E.g. what does a function Int -> Int -> Bool do? I have no idea. A good function name helps, e.g. isDivisible:: Int -> Int -> Bool. But then I still don't know which parameter is the numerator and denominator. So good names for the parameters are at least as important, e.g. isDivisible :: numerator:Int -> denonimator:Int -> Bool
I agree. But I was generally thinking of more complex functions than this, especially if they use some kind of user-defined monad and have implicit parameters, say. Cheers, Chris.