From 5b7b661ff721327d33b7078f4d07f6fe93307ee0 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Tue, 17 Jan 2017 19:44:40 -0400 Subject: - Can reverse vectors now. --- stdlib/source/lux/data/struct/vector.lux | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'stdlib/source') 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] (fold (lambda [post pre] (append pre post)) unit))) ) + +(def: #export (reverse xs) + (All [a] + (-> (Vector a) (Vector a))) + (let [(^open) Fold + (^open) Monoid] + (fold add unit xs))) -- cgit v1.2.3