无法为关联的数据系列派生 Typeable
Cannot derive Typeable for associated data family
我正在尝试为关联的数据系列推导 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’
有人可以详细说明这里出了什么问题吗?
好的,这似乎与ghc
7.8.4有关。我尝试了相同的代码片段
ghc
7.10.1 并编译。
我正在尝试为关联的数据系列推导 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’
有人可以详细说明这里出了什么问题吗?
好的,这似乎与ghc
7.8.4有关。我尝试了相同的代码片段
ghc
7.10.1 并编译。