[Redirecting to GHC users] Andres,
Nice example. It's another instance of a problem that keeps coming up with type families. Details here: http://hackage.haskell.org/trac/ghc/ticket/1897#comment:10 The rest of the ticket gives other examples. It's not clear what the Right Thing to do is. Simon | -----Original Message----- | From: haskell-boun...@haskell.org [mailto:haskell-boun...@haskell.org] On Behalf Of Andres | Loeh | Sent: 12 January 2009 21:44 | To: hask...@haskell.org | Subject: [Haskell] type family vs. polymorphism | | Hi. | | Here's a strange interaction of type families and higher-rank | polymorphism (tested with both ghc-6.8.3 and ghc-6.10.1): | | {-# LANGUAGE TypeFamilies, EmptyDataDecls, RankNTypes #-} | | data X (a :: *) | type family Y (a :: *) | | -- This works (datatype). | i1 :: (forall a. X a) -> X Bool | i1 x = x | | -- This works too (type family and extra arg). | i2 :: (forall a. a -> Y a) -> Y Bool | i2 x = x True | | -- This doesn't work (type family). | -- i3 :: (forall a. Y a) -> Y Bool | -- i3 x = x | | I would expect i3 to be ok as well. Note that this is a | simplified example and not really useful in its simplified | form. | | Cheers, | Andres | | -- | | Andres Loeh, Universiteit Utrecht | | mailto:and...@cs.uu.nl mailto:m...@andres-loeh.de | http://www.andres-loeh.de | _______________________________________________ | Haskell mailing list | hask...@haskell.org | http://www.haskell.org/mailman/listinfo/haskell _______________________________________________ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users