【发布时间】:2015-05-01 20:39:31
【问题描述】:
我正在尝试为关联的数据系列派生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’
有人可以详细说明这里出了什么问题吗?
【问题讨论】:
标签: haskell type-families derived-instances