You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the following example we get an error at the last return because we are unable to find a monad instance for M. We should detect Monad M because we have {{MonadS S M}} in scope and MonadS has an instance field {{monad}} : Monad M, thus we have the coercion coercion instance monad : {S : Type} → {M : Type → Type} → {{MonadS S M}} → Monad M.
The problem seems to be that MonadS has the extra (S : Type) argument and the coercion detection algorithm is not able to detect that.
module example;
trait
type Monad (f : Type -> Type) := mkMonad {return : {A : Type} -> A -> f A};
open Monad public;
trait
type MonadS (S : Type) (M : Type -> Type) :=
mkMonadReader {
{{monad}} : Monad M;
getS : S
};
projMonad {B S} {M : Type -> Type} {{MonadS S M}} : {A : Type} -> A -> M A := return;
The text was updated successfully, but these errors were encountered:
In the following example we get an error at the last
return
because we are unable to find a monad instance forM
. We should detectMonad M
because we have{{MonadS S M}}
in scope andMonadS
has an instance field{{monad}} : Monad M
, thus we have the coercioncoercion instance monad : {S : Type} → {M : Type → Type} → {{MonadS S M}} → Monad M
.The problem seems to be that
MonadS
has the extra(S : Type)
argument and the coercion detection algorithm is not able to detect that.The text was updated successfully, but these errors were encountered: