[Haskell-cafe] Re: FlexibleContexts and FlexibleInstances
Isaac Dupree
ml at isaac.cedarswampstudios.org
Thu Jun 11 09:53:00 EDT 2009
Claus Reinke wrote:
> if module 'A' exports multiparameter type classes, importers of those
> classes have to have MultiParamTypeClasses on - there are no legal
> uses of those imports otherwise (while FlexibleInstances/Contexts can
> just affect a subset of use sites).
say we have
module A where { class Coerce a b where coerce :: a -> b }
module B where { import A ; co a = coerce a }
Syntactically, module B doesn't require MultiParamTypeClasses because
the signature that's involved is only discovered during type inference.
Something to beware of if those restrictions need to be implemented
somehow in GHC.
Niklas Broberg wrote:
> If there is any interest, I can also propose these cases as bug reports to GHC.
please do!
-Isaac
More information about the Glasgow-haskell-users
mailing list