ITree.Events.Dependent
Dependently-typed events
Variant depE {I : Type} (F : I → Type) : Type → Type :=
| Dep (i : I) : depE F (F i).
Arguments Dep {I F} &.
Definition dep {I F E} `{depE F -< E} (i : I) : itree E (F i) :=
trigger (Dep (F := F) i).
Definition undep {I F} (f : ∀ i : I, F i) :
depE F ~> identity :=
fun _ d ⇒
match d with
| Dep i ⇒ f i
end.