[Haskell-beginners] Explicit specification of function types

Tommy M. McGuire mcguire at crsr.net
Tue Mar 24 13:28:39 EDT 2009


Zachary Turner wrote:
> I'm mostly just trying to understand why it's good in one language, and
> bad in another.  I'm sure there must be a number of tangible advantages
> in each language, that either don't apply or are mapped to disadvantages
> in the other. 

I do not know about F#, but ML requires type signatures at module boundaries.
 That does limit how far you can get relying on inference alone.  Also, the
O'Caml community recommends type annotations for documentation purposes
although leaving out the annotations is not uncommon for local values.
Finally, with "type" synonyms, type inference sometimes results in equivalent
typings that are less useful than an annotation (Parsec is the case I remember).


-- 
Tommy M. McGuire
mcguire at crsr.net


More information about the Beginners mailing list