GADT record syntax and contexts
Roberto Zunino
zunino at di.unipi.it
Tue Jun 16 08:28:34 EDT 2009
Simon Peyton-Jones wrote:
> (A) data RecContTest a where
> Show a => C { showable :: Show a => a } :: RecContTest a
>
> (B) data RecContTest a where
> C :: Show a => { showable :: Show a => a } -> RecContTest a
What about
(A') data RecContTest a where
Show a => C { showable :: a } :: RecContTest a
(B') data RecContTest a where
C :: Show a => { showable :: a } -> RecContTest a
? Would this be allowed?
I would expect A' and B' to generate
showable :: RecContTest a -> a
and not the less useful (Show-requiring)
showable :: Show a => RecContTest a -> a
Zun.
More information about the Glasgow-haskell-users
mailing list