On Thu, Mar 24, 2011 at 11:36 AM, Simon Peyton-Jones
simo...@microsoft.com wrote:
| class Monoid (GeneratorOf a) = Generable a where
| type GeneratorOf a :: * - *
| construct :: GeneratorOf a - a
|
| Now, it seems I need FlexibleInstances to do this when I'm using an
| associated type
| class Monoid (GeneratorOf a) = Generable a where
| type GeneratorOf a :: * - *
| construct :: GeneratorOf a - a
|
| Now, it seems I need FlexibleInstances to do this when I'm using an
| associated type synonym, but I don't need the flexibility when using a
| multiparameter type class.
Hi all -
I've been trying to construct a class declaration with an associated
type synonym, but I'd like to constrain that type to belong to a
particular class.
Consider the following class:
class Monoid m = Constructs c m | c - m where
construct :: m - c
This captures the idea that the