[Haskell-cafe] MPTC and type classes issue (polymorphic '+')

Pepe Iborra mnislaih at gmail.com
Sat Apr 7 08:31:44 EDT 2007


>
> input2 =
>     [ InputDecs [ inp "emaLength" TyNumber (20 + 40) ] ]
>

(untested). Imho the simple, dumb, best fix for this is to give a  
explicit type to those values.

 > input2 = [ InputDecs [ inp "emaLength" TyNumber ((20::Integer) +  
(40::Integer)) ] ]


This is just one way to fix it. You could also try to improve your  
instances or enable -foverlapping-instances. But in my experience  
MPTC and overlapping instances, though powerful, can become very  
confusing, very quickly.

Cheers
pepe


More information about the Haskell-Cafe mailing list