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
We've developed monotone predicate monads for e.g. monotone typed state.
I was wondering if there is interest in getting such definitions into the standard library.
If so, I can prepare a PR.
One implements a monotone predicate monad by instantiating:
record RawMPMonad (M : Pt I ℓ) : Set (suc ℓ) where
infixl 1 _≥=_
field
return : ∀ {P} → P ⊆ M P
_≥=_ : ∀ {P Q} → M P ⊆ ((P ↗ M Q) ⇒ M Q)
where (P ↗ M Q) is the kripke function space.
You get an RawPMonad instance for free, as well as monadic strength.
Using monadic strength and appropriate instances of the Monotone typeclass, you can
program with it.
Yes indeed. I'll prepare a PR next week. Would be good to have an idea of what parts are widely applicable enough to include. The referenced code has a bunch of instances that do not have RawMonad counterparts in the stdlib, so it might not make sense to include their monotone counterparts.
Related to this I wanted to raise the question whether it would be worth considering to extend do-notation in Agda to support convenient programming with monads that require application of monadic strength.
For these kinds of monads that maintain strong invariants, strength is essential, but bothersome to apply manually. I imagine that automated application would not require much more than closure conversion. Haskell's support for arrow notation seems to require similar transformations.
I can move this discussion upstream to the compiler implementation, but I thought it made sense to attach it to a potential use-case to test the waters for interest.
We've developed monotone predicate monads for e.g. monotone typed state.
I was wondering if there is interest in getting such definitions into the standard library.
If so, I can prepare a PR.
One implements a monotone predicate monad by instantiating:
where
(P ↗ M Q)
is the kripke function space.You get an
RawPMonad
instance for free, as well as monadic strength.Using monadic strength and appropriate instances of the
Monotone
typeclass, you canprogram with it.
Monotone Predicate Monads
Monotone Typed State
Monotone Type class
An instance
Kripke stuff
Tasks
Monotone
is calledClosed
in the stdlibThe text was updated successfully, but these errors were encountered: