877*_*877 2 monads warnings haskell
我试着写一个这个monad
data W x = W x [String]
instance Monad W where
return x = W x []
W a h1 >>= f = case f a of
W b h2 -> W b (h1++h2)
Run Code Online (Sandbox Code Playgroud)
但是,现在当我将使用这个monad并尝试在代码中编写return或>> =时,我会通过编译获得警告:
实例声明中没有显式方法或Prelude.return的默认方法.实例声明中没有显式方法或Prelude.>> =的默认方法.
有谁知道如何修复此警告?
非常感谢你