
On Mon, Mar 23, 2009 at 7:08 PM, Tom Poliquin
Zachary Turner wrote:
Everything I've read has said that it's generally considered good practice to specify the full type of a function before the definition. Why is this?
I'm still a newbie but using (and leaving) the type definitions helps me quickly recall what a routine is doing and also provides handy documentation when I have to hack (uhh ... I mean modify) the code weeks later.
I agree with this. It's quite useful to be able to just look at a function and see what its type is without having to go into GHCi and query it. This becomes less useful for local-er variables because their type can often be inferred from context and they are not generally used elsewhere in the function. Alex