How to fix DatatypeContexts?

harry voldermort at hotmail.com
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: 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.




More information about the Glasgow-haskell-users mailing list