【发布时间】:2020-08-01 15:11:29
【问题描述】:
我正在尝试这样声明 MonadPlus 接口:
module NanoParsec.Plus
%access public export
interface Monad m => MonadPlus m where
zero : m a
plus : m a -> m a -> m a
但是有一个错误:
|
5 | interface Monad m => MonadPlus m where
| ~~~~~~~
When checking type of constructor of NanoParsec.Plus.MonadPlus#Monad m:
When checking argument m to type constructor Prelude.Monad.Monad:
Type mismatch between
Type (Type of m)
and
Type -> Type (Expected type)
我做错了什么?如何解决这个问题? Idris 没有自己的 MonadPlus 界面,我说得对吗?如果有,为什么?
【问题讨论】: