爲什麼這個代碼正確爲什麼我不能用這個非參數化類型創建實例?
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"