diff options
author | Marvin Borner | 2023-03-05 23:53:54 +0100 |
---|---|---|
committer | Marvin Borner | 2023-03-05 23:53:54 +0100 |
commit | 7a35dd8650535d1d31c8b152e1074d6f1ebcf8ad (patch) | |
tree | ebd3ea54f23f53b08e9e44d8a7e627b86cf98575 /std/Math.bruijn | |
parent | 626e9d9f062230e97d764660a8d0d1c8c05b9fcb (diff) |
Switched to prefixed listification
Diffstat (limited to 'std/Math.bruijn')
-rw-r--r-- | std/Math.bruijn | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/std/Math.bruijn b/std/Math.bruijn index b2e3698..772373f 100644 --- a/std/Math.bruijn +++ b/std/Math.bruijn @@ -9,17 +9,17 @@ sum foldl add (+0) ⧗ (List Number) → Number ∑‣ sum -:test (∑((+1) : ((+2) : ((+3) : empty)))) ((+6)) +:test (∑((+1) : ((+2) : {}(+3)))) ((+6)) # returns max value of list lmax foldl1 max ⧗ (List Number) → Number -:test (lmax ((+1) : ((+3) : ((+2) : empty)))) ((+3)) +:test (lmax ((+1) : ((+3) : {}(+2)))) ((+3)) # returns min value of list lmin foldl1 min ⧗ (List Number) → Number -:test (lmin ((+2) : ((+1) : ((+0) : empty)))) ((+0)) +:test (lmin ((+2) : ((+1) : {}(+0)))) ((+0)) # list from num to num {…→…} z [[[rec]]] ⧗ Number → Number → (List Number) @@ -27,7 +27,7 @@ lmin foldl1 min ⧗ (List Number) → Number case-list 1 : (2 ++1 0) case-end empty -:test ({ (+0) → (+2) }) ((+0) : ((+1) : ((+2) : empty))) +:test ({ (+0) → (+2) }) ((+0) : ((+1) : {}(+2))) # equivalent of mathematical sum function ∑…→…|… z [[[[[rec]]]]] (+0) ⧗ Number → Number → (Number → Number) → Number @@ -42,7 +42,7 @@ product foldl mul (+1) ⧗ (List Number) → Number Π product -:test (Π ((+1) : ((+2) : ((+3) : empty)))) ((+6)) +:test (Π ((+1) : ((+2) : {}(+3)))) ((+6)) # equivalent of mathematical product function ∏…→…|… z [[[[[rec]]]]] (+1) ⧗ Number → Number → (Number → Number) → Number |