aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/lux/abstract/enum.lux
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--stdlib/source/lux/abstract/enum.lux14
1 files changed, 9 insertions, 5 deletions
diff --git a/stdlib/source/lux/abstract/enum.lux b/stdlib/source/lux/abstract/enum.lux
index 9f074f7c5..9470cd142 100644
--- a/stdlib/source/lux/abstract/enum.lux
+++ b/stdlib/source/lux/abstract/enum.lux
@@ -12,10 +12,14 @@
(def: #export (range enum from to)
{#.doc "An inclusive [from, to] range of values."}
(All [a] (-> (Enum a) a a (List a)))
- (let [(^open "/@.") enum
- <= (order.<= /@&order)]
+ (let [(^open "/@.") enum]
(loop [end to
output #.Nil]
- (if (<= end from)
- (recur (/@pred end) (#.Cons end output))
- output))))
+ (cond (/@< end from)
+ (recur (/@pred end) (#.Cons end output))
+
+ (/@= end from)
+ (#.Cons end output)
+
+ ## else
+ output))))