Free Monads #
This file defines the free monad on an arbitrary mapping f : Type u → Type v. This has the
undesirable property of raising the universe level by 1, which means we can't pass a FreeMonad f
object as a continuation into an interactive protocol.
See PFunctor.FreeM for the free monad of a polynomial functor, which does not raise the universe
level.
The free monad on a functor f is the type freely generated by values of type f α
and the operations pure and bind. Implemented directly rather than as a quotient.
Slightly different than constructions of free monads in Haskell because of universe issues.
- pure {f : Type u → Type v} {α : Type w} (x : α) : FreeMonad f α
- roll {f : Type u → Type v} {α : Type w} {β : Type u} (x : f β) (r : β → FreeMonad f α) : FreeMonad f α
Instances For
Bind operator on OracleComp spec operation used in the monad definition.
Instances For
Proving something about FreeMonad f α only requires two cases:
pure xfor somex : αNote that we can't useSort vinstead ofPropdue to universe levels.
Instances For
Shoulde be possible to unify with the above.