
From: Brandon Moore
Getting them both is tricky, but you can do it if you use a GADT to write a type that means "exists a such that a = m and a is a Monad":
Is GADT a way to assemble types at compile-time? It looks really cool.
{-# OPTIONS -fglasgow-exts #-} data TyEq (a :: * -> *) (b :: * -> *) where ^ ^
Compiling this fails here (the first '*') for me with "parse error on input '*'" (ghc 6.4.1), but I'll keep playing with it. Thanks, Brock

you need at least one constructor if you say 'where'. S | -----Original Message----- | From: haskell-cafe-bounces@haskell.org [mailto:haskell-cafe-bounces@haskell.org] On Behalf Of Brock | Peabody | Sent: 09 June 2006 20:34 | To: haskell-cafe@haskell.org | Subject: RE: [Haskell-cafe] newbie type signature question | | > From: Brandon Moore | | > Getting them both is tricky, but you can do it if you use a GADT to | > write a type that means "exists a such that a = m and a is a Monad": | | Is GADT a way to assemble types at compile-time? It looks really cool. | | > {-# OPTIONS -fglasgow-exts #-} | > data TyEq (a :: * -> *) (b :: * -> *) where | ^ | ^ | | Compiling this fails here (the first '*') for me with "parse error on | input '*'" (ghc 6.4.1), but I'll keep playing with it. | | Thanks, | | Brock | | | _______________________________________________ | Haskell-Cafe mailing list | Haskell-Cafe@haskell.org | http://www.haskell.org/mailman/listinfo/haskell-cafe
participants (2)
-
Brock Peabody
-
Simon Peyton-Jones