Bug or feature with -XFlexibleContects?
Hi, I noticed something odd yesterday. I had a function of this type: divByGeneric :: (Integral a, MonadError (DivByError a) m) => a -> [a] -> m [a] If I left off the type signature, ghci (with no command-line parameters) would load the file just fine, and :t would give this same type back. But if I put the type signature in there -- even an exact cut and paste from ghci's :t -- it would complain that it needs -XFlexibleContexts. It seems odd to me that ghci can infer a type that is illegal for the way it was run. Thoughts? This is GHC 6.8.2, BTW. -- John
On Wed April 30 2008 10:58:37 am Marc Weber wrote:
It seems odd to me that ghci can infer a type that is illegal for the way it was run. Thoughts?
Is it the same when compiling using ghc? Don't know the answer anyway. But maybe this can shed some light.
Yes, it is. -- John
participants (2)
-
John Goerzen -
Marc Weber