On Sun, 2008-05-18 at 16:57 +0000, Luke Palmer wrote:
> 2008/5/18 Peter Verswyvelen <[EMAIL PROTECTED]>:
> > In Haskell, I sometimes have to annotate code with type info because the
> > type-inferer otherwise fails (even with -XNoMonomorphismRestriction).
> > Surely, most of the time this is because I was writing buggy code, but
> > sometimes, type annotation just seems needed to get a successful compilation
> > (luckily not as often as in C# 3.0)
> 
> Then you must either be programming using extensions or you have found
> a bug.  Haskell 98 should never require annotations (modulo
> monomorphism).  


This is incorrect.  There are two (other) situations where you need type
annotations in Haskell 98.  One situation is when you use polymorphic
recursion, but that is pretty rare unless you are writing nested data
types.  The other situation is when not enough information is provided
to resolve a typeclass constraint, e.g. good ole show . read.

_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to