How to fix DatatypeContexts?

harry voldermort at
Thu Jul 18 15:58:23 CEST 2013

Sjoerd Visscher-2 wrote
>> class Foo f where
>>    foo :: a -> f a
>> data Bar f a = Foo f => Bar {bar :: f a}
>> instance Foo (Bar f) where
>>    foo a = Bar (foo a)
> No, you can only omit it where you provide Foo f in another way.

Which brings me back to my original question - is there any way that the
type system could be enhanced, so that the compiler "understands" that Bar f
=> Foo f without being told so explicitly every time?

View this message in context:
Sent from the Haskell - Glasgow-haskell-users mailing list archive at

More information about the Glasgow-haskell-users mailing list