13 Aug
2008
13 Aug
'08
4:29 a.m.
We already have named instances:
data ShowDict alpha = ShowDict alpha { namedShows :: alpha -> String -> String }
This is not valid Haskell. Either all components of the data structure are named fields, or none. It is not possible to have a mixture of the two, as here. In addition, there are many classes it is not currently possible to simulate using this technique, because the types go significantly beyond Haskell'98. I believe you need both Rank-2 Types and Polymorphic Components to achieve comparable expressivity. Fuller details on the Haskell-Prime site: http://hackage.haskell.org/trac/haskell-prime/wiki/PolymorphicComponents Regards, Malcolm