Could not deduce (Functor m) arising from a use of â_1â
from the context (MonadRandom m)
我已尝试添加以下代码:
instance Functor MonadRandom where
fmap = liftM
instance Applicative MonadRandom where
pure = return
(<*>) = ap
但我得到了错误:
The first argument of âFunctorâ should have kind â* -> *â,
but âMonadRandomâ has kind â(* -> *) -> Constraintâ
In the instance declaration for âFunctor MonadRandomâ
The first argument of âApplicativeâ should have kind â* -> *â,
but âMonadRandomâ has kind â(* -> *) -> Constraintâ
In the instance declaration for âApplicative MonadRandomâ