[Haskell-cafe] Can not use ST monad with polymorphic function
Dmitry Kulagin
dmitry.kulagin at gmail.com
Mon Dec 3 10:04:46 CET 2012
>
> Basically, quantified types can't be given as arguments to type
>> constructors (other than ->, which is its own thing). I'm not entirely
>> sure
>> why, but it apparently makes the type system very complicated from a
>> theoretical standpoint. By wrapping the quantified type in a newtype, the
>> argument to IO becomes simple enough not to cause problems.
>
>
Thank you, I have read about predicative types and it seems I understand
the origin of the problem now.
> GHC has an extension -XImpredicativeTypes that lifts this restriction,
> but in my experience, it doesn't work very well.
>
Yes, it didn't help in my case.
Thank you,
Dmitry
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20121203/910416fc/attachment.htm>
More information about the Haskell-Cafe
mailing list