[email protected]
[Top] [All Lists]

Re: [Haskell-cafe] Restrictions on associated types for classes

Subject: Re: [Haskell-cafe] Restrictions on associated types for classes
From: Roman Leshchinskiy
Date: Fri, 18 Dec 2009 01:36:07 +1100
On 18/12/2009, at 00:37, Stephen Lavelle wrote:

> Given
> 
> class MyClass k where
>  type AssociatedType k :: *
> 
> Is there a way of requiring AssociatedType be of class Eq, say?

This works with -XFlexibleContexts:

class Eq (AssociatedType k) => MyClass k where
type AssociatedType k :: *


Roman


_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

<Prev in Thread] Current Thread [Next in Thread>