diff options
Diffstat (limited to 'rosetta/lev.neb')
| -rw-r--r-- | rosetta/lev.neb | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/rosetta/lev.neb b/rosetta/lev.neb index 6797c41..03db260 100644 --- a/rosetta/lev.neb +++ b/rosetta/lev.neb @@ -1,9 +1,12 @@ -(func min (lst :{:int}) - (def val (first lst)) - (for-each (rest lst) - (if (< _item_ val) - (redef val _item_))) - val) +; this should be in the stdlib +(func min (lst) + (reduce + (lambda (acc x) + (if (< x acc) + x + acc)) + (rest lst) + (first lst))) (func lev (s t) (branch |
