3 | import Control.Eff.Except
4 | import Control.Eff.Choose
8 | tagAt : Show label =>
10 | -> {auto _ : Has (ExceptL lbl String) ((ExceptL lbl String) :: fs)}
11 | -> {auto _ : Has (Except String) fs}
12 | -> {auto _ : Subset ((ExceptL lbl String :: fs) - ExceptL lbl String) fs}
13 | -> Eff ((ExceptL lbl String) :: fs) a
16 | let f : (String -> Eff fs a) =
17 | \e => throw "\{show lbl}: \{e}"
19 | out <- lift . runExceptAt lbl $
x
25 | oneOf : Has (Choose) fs => Foldable f =>
27 | oneOf x = foldl oneOf' empty x
29 | oneOf' : Eff fs a -> a -> Eff fs a
30 | oneOf' acc val = pure val `alt` acc