Cannot get Typeable for related data families

I am trying to get Typeable

for a related dataset like this:

{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE TypeFamilies #-}
module Test where

import Data.Typeable

class Test a where
  data DTest a :: *

instance Test () where
  data DTest () = Foo
    deriving Typeable

      

But I am getting the following error, and it leaves me a bit puzzled:

[1 of 1] Compiling Test             ( test.hs, test.o )

test.hs:12:14:
    Cannot eta-reduce to an instance of form
      instance (...) => Typeable DTest
    In the data instance declaration for ‘DTest’

      

Who can tell what is going wrong here?

+3


source to share


1 answer


Ok, it looks like it's related to ghc

7.8.4. I tried the same piece of code using ghc

7.10.1 and it compiled.



+2


source







All Articles