[Haskell-cafe] GeneralizedNewtypeDeriving and TypeFamilies

Max Cantor mxcantor at gmail.com
Mon Jun 14 03:08:20 EDT 2010

So I understand from http://hackage.haskell.org/trac/ghc/ticket/4083 that GeneralizedNewtypeDeriving doesn't play well with TypeFamilies.

But, if a typeclass is only using type synonyms, is there any reason why newtype deriving would not work?  For a toy example:

class Cls a where
	type MyType a
	foo :: MyType a ->

in this case, if you have something like:

instance Cls () where
	type MyType () = ()
	foo = id


newtype Bar = Bar () deriving (Cls)

be well defined?

Thanks, Max

More information about the Haskell-Cafe mailing list