module Meta.Alt where
record Alt (M : Effect) : TypeΟ where private module M = Effect M field fail : β {β} {A : Type β} β M.β A _<|>_ : β {β} {A : Type β} β M.β A β M.β A β M.β A infixl 3 _<|>_ open Alt β¦ ... β¦ public guard : β {M : Effect} (let module M = Effect M) β¦ appl : Idiom M β¦ β¦ alt : Alt M β¦ β Bool β M.β β€ guard true = pure tt guard false = fail guardM : β {M : Effect} (let module M = Effect M) β¦ mon : Bind M β¦ β¦ alt : Alt M β¦ β M.β Bool β M.β β€ guardM M = M >>= guard