[Haskell-beginners] deducing type of multi-parameter type class

Felipe Lessa felipe.lessa at gmail.com
Thu Jul 15 03:09:16 EDT 2010


On Thu, Jul 15, 2010 at 3:13 AM, Michael Snoyman <michael at snoyman.com> wrote:
> You could also use type families for this, but I believe you cannot express
> the "Show" superclass:
> class MyClass a where
>     type MyResult a
>     fn :: a -> MyResult a

I guess this works:

class Show (MyResult a) => MyClass a where
  type MyResult a
  fn :: a -> MyResult a

HTH,

-- 
Felipe.


More information about the Beginners mailing list