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’
誰かがここで何がうまくいかないのか詳しく説明してもらえますか?