Commit 94acccf2 authored by locallycompact's avatar locallycompact
Browse files

Add rtraverse

parent c6810158
No related merge requests found
Pipeline #1248 passed with stages
in 2 seconds
......@@ -31,3 +31,8 @@ export
rmap : (forall x. f x -> g x) -> Rec f xs -> Rec g xs
rmap h Nil = Nil
rmap h (x :: xs) = h x :: rmap h xs
export
rtraverse : Applicative h => (forall x. f x -> (h . g) x) -> Rec f xs -> h (Rec g xs)
rtraverse _ Nil = pure Nil
rtraverse f (x :: xs) = (::) <$> f x <*> rtraverse f xs
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment