[Haskell-beginners] Explicit specification of function types
Colin Adams
colinpauladams at googlemail.com
Tue Mar 24 03:29:29 EDT 2009
2009/3/24 Zachary Turner <divisortheory at gmail.com>:
>> 2. Type inference is nice right up until you have to debug a type error;
>> then the error gets reported at the point where the compiler realizes it
>> can't match up the types, which could be somewhere not obviously related
>> (depends on what the call chain looks like). The more concrete types you
>> give the compiler, the better (both more complete and more correctly
>> located) the type errors will be.
>
> Regarding the second issue, this occurs in most other type inferring
> languages as well, but usually you just specify types up until such time
> that your function is fully tested and you deem that it's good, then
> removing the type specification.
This seems perverse to me.
The type signature is very good documentation for other people wanting
to use the function.
Removing it is a very hostile activity.
More information about the Beginners
mailing list