aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--stdlib/source/lux/math/random.lux4
1 files changed, 3 insertions, 1 deletions
diff --git a/stdlib/source/lux/math/random.lux b/stdlib/source/lux/math/random.lux
index 554dc8a5d..3225f1d6e 100644
--- a/stdlib/source/lux/math/random.lux
+++ b/stdlib/source/lux/math/random.lux
@@ -274,7 +274,9 @@
(def: (swap from to vec)
(All [a] (-> Nat Nat (V;Vector a) (V;Vector a)))
- (V;put to (maybe;assume (V;nth from vec)) vec))
+ (|> vec
+ (V;put to (maybe;assume (V;nth from vec)))
+ (V;put from (maybe;assume (V;nth to vec)))))
(def: #export (shuffle seed vector)
{#;doc "Shuffle a vector randomly based on a seed value."}