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 G} `{depE F +? G -< E} (i : I) : itree E (F i) :=
trigger (E := depE F) (Dep i).
Definition undep {I F} (f : forall i : I, F i) :
depE F ~> identity :=
fun _ d =>
match d with
| Dep i => f i
end.