on master help sign in
Add mapVE for mapping over Vects in Eff
57aaa5eSimon Fowler
libs/neweffects/Effects.idr+9
@@ -285,6 +285,15 @@ mapE : Applicative m => (a -> {xs} Eff m b) -> List a -> {xs} Eff m (List b)
285mapE f [] = pure []
285mapE f [] = pure []
286mapE f (x :: xs) = [| f x :: mapE f xs |]
286mapE f (x :: xs) = [| f x :: mapE f xs |]
287
287
288+
289+mapVE : Applicative m =>
290+ (a -> {xs} Eff m b) ->
291+ Vect n a ->
292+ {xs} Eff m (Vect n b)
293+mapVE f [] = pure []
294+mapVE f (x :: xs) = [| f x :: mapVE f xs |]
295+
296+
288when : Applicative m => Bool -> ({xs} Eff m ()) -> {xs} Eff m ()
297when : Applicative m => Bool -> ({xs} Eff m ()) -> {xs} Eff m ()
289when True e = e
298when True e = e
290when False e = pure ()
299when False e = pure ()