|  | > type State = Term a => [a]
|  | > data M a = M (State -> IO(State,a))
|  |
|  | GHC yields a error message "Illegal polymorphic type".
|  | How to resolve this?

I can tell you what it happening.  If you have -fglasgow-exts on, the
type
for State is short for

        type State = forall a. Term a => [a]

And then you can't use that polymorphic type in the argument of a tuple,
as you are doing in the next line.  

Without -fglasgow-exts (i.e. in Haskell 98) the first line is plain
illegal: 'a' is not in scope.  But GHC may not produce as perspicuous a
message as it should for that.

Simon

_______________________________________________
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell

Reply via email to