on master help sign in
Merge pull request #892 from SimonJF/eff-vect-map
7831244Edwin Brady
libs/neweffects/Effects.idr+9
@@ -287,6 +287,15 @@ mapE : Applicative m => (a -> {xs} Eff m b) -> List a -> {xs} Eff m (List b)
287mapE f [] = pure []
287mapE f [] = pure []
288mapE f (x :: xs) = [| f x :: mapE f xs |]
288mapE f (x :: xs) = [| f x :: mapE f xs |]
289
289
290+
291+mapVE : Applicative m =>
292+ (a -> {xs} Eff m b) ->
293+ Vect n a ->
294+ {xs} Eff m (Vect n b)
295+mapVE f [] = pure []
296+mapVE f (x :: xs) = [| f x :: mapVE f xs |]
297+
298+
290when : Applicative m => Bool -> ({xs} Eff m ()) -> {xs} Eff m ()
299when : Applicative m => Bool -> ({xs} Eff m ()) -> {xs} Eff m ()
291when True e = e
300when True e = e
292when False e = pure ()
301when False e = pure ()