なぜこのコードが正しいこのパラメータを設定しない型でインスタンスを作成できないのはなぜですか?
instance Functor IO where -- note that IO isn't parametrized, and it's correct
fmap f action = do
result <- action
return (f result)
が、次のコードはコンパイルエラーを持っていますか?
class Print a where
print :: a -> String
data A t = A t
instance Print A where -- error: expecting one more argument to `A'
print a = "abc"