module Meta.Traversable where
Meta: Traversableπ
The Traverse
class captures the
idea that some containers βcommute with effectsβ, where an effect is
anything implementing Idiom
:
record Traversable (F : Effect) : TypeΟ where private module F = Effect F field traverse : β {ββ ββ} {M : Effect} β¦ i : Idiom M β¦ (let module M = Effect M) {a : Type ββ} {b : Type ββ} β (a β M.β b) β F.β a β M.β (F.β b) for : β {ββ ββ} {M : Effect} β¦ i : Idiom M β¦ (let module M = Effect M) {a : Type ββ} {b : Type ββ} β F.β a β (a β M.β b) β M.β (F.β b) for x f = traverse f x open Traversable β¦ ... β¦ public sequence : β {M F : Effect} β¦ _ : Idiom M β¦ β¦ _ : Traversable F β¦ (let module M = Effect M ; module F = Effect F) {β} {a : Type β} β F.β (M.β a) β M.β (F.β a) sequence = traverse id