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: 
http://haskell.1045720.n5.nabble.com/How-to-fix-DatatypeContexts-tp5733103p5733117.html
Sent from the Haskell - Glasgow-haskell-users mailing list archive at 
Nabble.com.

_______________________________________________
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

Reply via email to