module Meta.Foldable where
Meta: Foldable effectsπ
record Foldable (F : Effect) : TypeΟ where private module F = Effect F field foldr : β {β β'} {a : Type β} {b : Type β'} β (a β b β b) β b β F.β a β b open Foldable β¦ ... β¦ public asum : β {F M : Effect} β¦ f : Foldable F β¦ β¦ a : Alt M β¦ {β} {A : Type β} (let module F = Effect F) (let module M = Effect M) β F.β (M.β A) β M.β A asum = foldr _<|>_ fail nondet : β (F : Effect) {M} β¦ f : Foldable F β¦ β¦ t : Map F β¦ β¦ a : Alt M β¦ β¦ i : Idiom M β¦ {β β'} {A : Type β} {B : Type β'} β (let module F = Effect F) β (let module M = Effect M) β F.β A β (A β M.β B) β M.β B nondet F β¦ f = f β¦ xs k = asum β¦ f = f β¦ (k <$> xs)