diff options
author | Eduardo Julian | 2017-01-17 19:44:40 -0400 |
---|---|---|
committer | Eduardo Julian | 2017-01-17 19:44:40 -0400 |
commit | 5b7b661ff721327d33b7078f4d07f6fe93307ee0 (patch) | |
tree | b5058cfd94e90870c2a08ec6a74ec702c1c38489 | |
parent | 0776142d3d789ac371792bfe67f905d9cb7d6294 (diff) |
- Can reverse vectors now.
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/lux/data/struct/vector.lux | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/stdlib/source/lux/data/struct/vector.lux b/stdlib/source/lux/data/struct/vector.lux index e1640a0f0..9a22efb93 100644 --- a/stdlib/source/lux/data/struct/vector.lux +++ b/stdlib/source/lux/data/struct/vector.lux @@ -442,3 +442,10 @@ (^open) Monoid<Vector>] (fold (lambda [post pre] (append pre post)) unit))) ) + +(def: #export (reverse xs) + (All [a] + (-> (Vector a) (Vector a))) + (let [(^open) Fold<Vector> + (^open) Monoid<Vector>] + (fold add unit xs))) |