
23 Jun
2009
23 Jun
'09
12:25 a.m.
On Tue, Jun 23, 2009 at 02:02:25AM +0200, Eric wrote:
It seems that an extension is required:
Non type-variable argument in the constraint: MonadState [a] m (Use -XFlexibleContexts to permit this) In the type signature for `play3': play3 :: (MonadState [a] m, Eq a) => a -> m Bool
So how is it possible that GHCi can infer (and use) a type that you cannot use as signature?
Simple: the definition of MonadState uses those extensions. If the library was part of your code you would have had to turn on some extensions, but you could have used them only on some files (e.g. using LANGUAGE pragma). Here the same thing is happening, but the library is not part of your code. Errr, not a great explanation, but I HTH anyway. :) -- Felipe.