Equations
Instances For
- mk' :: (
- inner : ComputableSmall.Target α
- )
Instances For
Equations
Instances For
Equations
Instances For
If m
is a monad, then HetT m
is a monad that has two features:
- It generalizes
m
to arbitrary universes. - It tracks a postcondition property that holds for the monadic return value, similarly to
PostconditionT
.
This monad is noncomputable and is merely a vehicle for more convenient proofs, especially proofs about the equivalence of iterators, because it avoids universe issues and spares users the work to handle the postconditions manually.
Caution: Just like PostconditionT
, this is not a lawful monad transformer.
To lift from m
to HetT m
, use HetT.lift
.
Because this monad is fundamentally universe-polymorphic, it is recommended for consistency to
always use the methods HetT.pure
, HetT.map
and HetT.bind
instead of the homogeneous versions
Pure.pure
, Functor.map
and Bind.bind
.
- Property : α → Prop
A predicate that holds for the return value(s) of the
m
-monadic operation. - small : Internal.Small (Subtype self.Property)
A proof that the possible return values are equivalent to a
w
-small type. - operation : m (Internal.USquash (Subtype self.Property))
The actual monadic operation. Its return value is bundled together with a proof that it satisfies
Property
and squashed so that it fits into the monadm
.
Instances For
Converts PostconditionT m α
to HetT m α
, preserving the postcondition property.
Equations
Instances For
A universe-heterogeneous version of Functor.map
.
Equations
Instances For
Applies the given function to the result of the contained m
-monadic operation with a
proof that the postcondition property holds, returning another operation in m
.