无法为关联数据族派生Typeable

时间:2015-05-01 20:39:31

标签: haskell type-families derived-instances

我正在尝试为关联数据系列派生Typeable,如下所示:

{-# 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

但是我收到以下错误消息,这让我有点疑惑:

[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’

有人可以详细说明这里出了什么问题吗?

0 个答案:

没有答案