[Haskell-cafe] Refactoring status
Peter Verswyvelen
bf3 at telenet.be
Thu Jan 3 15:03:58 EST 2008
> I believe type signatures are the very essence of Haskell documentation!
> I'd much rather see a program with type signatures for functions and
> little (or no) comments over programs with no type signatures and
> ambigious comments (if any comments at all!).
Okay, but when using a syntax directed editor, type signatures can be
automatically provided because the types are known.
Furthermore, IMHO, type signatures alone are not enough, a good parameter
name says at least as much as the type.
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
> Type signatures really does make dealing with someone elses code that
> much easier.
Yes, as is good documentation, which unfortunately is still limited to
ASCII. I would prefer to have rich documentation right inside my source
code, with math symbols, drawings, pictures, animations, whatever...
Cheers,
Peter
More information about the Haskell-Cafe
mailing list