on master help sign in
Merge pull request #892 from SimonJF/eff-vect-map

Add mapVE for mapping over Vects in Eff

commit78312445034213c4f7da97bc64ad420e1d908033 authorEdwin Brady <edwin.brady@gmail.com> dateTue 18 Feb 2014, 11:10 (13 years ago) parent4e3535957aaa5e
1 file changed+9
libs/neweffects/Effects.idr+9
libs/neweffects/Effects.idr+9
@@ -287,6 +287,15 @@ mapE : Applicative m => (a -> {xs} Eff m b) -> List a -> {xs} Eff m (List b)
287287mapE f [] = pure []
288288mapE f (x :: xs) = [| f x :: mapE f xs |]
289289
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+
290299when : Applicative m => Bool -> ({xs} Eff m ()) -> {xs} Eff m ()
291300when True e = e
292301when False e = pure ()