deriving existential types

Marc Weber marco-oweber at gmx.de
Thu May 4 15:00:04 EDT 2006


I sometimes do this

-<
  class (Show c) =>  C c where
  foo = show c

  data CObj= forall c. (C c, Show c) => CObj c

  instance C Cobj where -- my existantial type should also implement class C
    foo (CObj c) = foo c
->


Would it be a nice idea to just write
-<
  data CObj= forall c. (C c, Show c) => CObj c
  deriving (C) ?
->
?

Or is this already possible?

Marc Weber


More information about the Glasgow-haskell-users mailing list