[Haskell-cafe] Having trouble with instance context

Kurt Stutsman kstutsman at gmail.com
Wed Feb 23 15:42:46 CET 2011

Antoine Latter wrote:
> As the error says, compiling with the flag '-XFlexibleInstances' will
> make the message go away.
> You can also add a language pragma to the top of your source file:
> {-# LANGUAGE FlexibleInstances #-}
> Antoine
When I enable that flag, I then also have to enable 
-XUndecidableInstances. It does work with those extensions enabled.

When I was reviewing the Haskell language specification on haskell.org, 
it certainly looked like what I was doing was supported by the language. 
I found some comments on GHC's site about the reasoning behind these 
flags, but I couldn't tell if they were restrictions GHC had added to 
their implementation or if they derive from the language spec. Is this 
kind of instance allowed by the spec?

Thanks again,

More information about the Haskell-Cafe mailing list