aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source
diff options
context:
space:
mode:
authorEduardo Julian2017-01-17 19:44:40 -0400
committerEduardo Julian2017-01-17 19:44:40 -0400
commit5b7b661ff721327d33b7078f4d07f6fe93307ee0 (patch)
treeb5058cfd94e90870c2a08ec6a74ec702c1c38489 /stdlib/source
parent0776142d3d789ac371792bfe67f905d9cb7d6294 (diff)
- Can reverse vectors now.
Diffstat (limited to 'stdlib/source')
-rw-r--r--stdlib/source/lux/data/struct/vector.lux7
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)))