
18 Jul
2013
18 Jul
'13
9:58 a.m.
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-tp5733103p5... Sent from the Haskell - Glasgow-haskell-users mailing list archive at Nabble.com.