Add mapVE for mapping over Vects in Eff
mapE existed for lists, but vectors were feeling left out.
commit57aaa5e45d08e452c079666df63b299ff01fd9a2
authorSimon Fowler <sf37@st-andrews.ac.uk>
dateFri 14 Feb 2014, 13:01 (13 years ago)
parent96d5cb0
libs/neweffects/Effects.idr+9
@@ -285,6 +285,15 @@ mapE : Applicative m => (a -> {xs} Eff m b) -> List a -> {xs} Eff m (List b)
285285mapE f [] = pure []
286286mapE f (x :: xs) = [| f x :: mapE f xs |]
287287
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+
288297when : Applicative m => Bool -> ({xs} Eff m ()) -> {xs} Eff m ()
289298when True e = e
290299when False e = pure ()