このエラーを解決してコードを機能させるにはどうすればよいですか?
私のデータ型:
data ID x = ID ( ( x, Mark ), [ ID x ] )
data Mark = Marked | Unmarked
インスタンスを表示:
instance Show a => Show ( ID a ) where
show t = go " " t where
go aP ( ID ( (x, Marked ), z ) ) =
aP ++ x ++ "\n"
エラー:
Couldn't match expected type `[Char]' against inferred type `a'
`a' is a rigid type variable bound by
the instance declaration at Dictionary.hs:117:23
Expected type: ID [Char]
Inferred type: ID a
In the second argument of `go', namely `t'
In the expression: go "" t
Failed, modules loaded: none.