diff options
author | Marvin Borner | 2023-03-03 14:27:05 +0100 |
---|---|---|
committer | Marvin Borner | 2023-03-03 14:27:05 +0100 |
commit | 6948d5cf89508e9d91978c93c3d2b0d552f60720 (patch) | |
tree | ff7793c0dd270dceddf86e5e0febcfad7e22783b /std/List.bruijn | |
parent | 8c380e85c816ecba9b3b101b8d61d3787c0c421d (diff) |
Faster string breaking
Diffstat (limited to 'std/List.bruijn')
-rw-r--r-- | std/List.bruijn | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/std/List.bruijn b/std/List.bruijn index b748f41..1241576 100644 --- a/std/List.bruijn +++ b/std/List.bruijn @@ -262,7 +262,12 @@ span z [[[rec]]] ⧗ (a → Boolean) → (List a) → (Pair (List a) (List a)) :test (span (\les? (+3)) ((+1) : ((+2) : ((+4) : ((+1) : empty))))) (((+1) : ((+2) : empty)) : ((+4) : ((+1) : empty))) # same as span but with inverted predicate -break span ∘ (…∘… ¬‣) ⧗ (a → Boolean) → (List a) → (Pair (List a) (List a)) +# slower but equivalent: span ∘ (…∘… ¬‣) +break z [[[rec]]] ⧗ (a → Boolean) → (List a) → (Pair (List a) (List a)) + rec ∅?0 case-end case-drop + case-drop ¬(1 ^0) ((^0 : ^recced) : ~recced) (empty : 0) + recced 2 1 ~0 + case-end empty : empty :test (break (\gre? (+3)) ((+1) : ((+2) : ((+4) : ((+1) : empty))))) (((+1) : ((+2) : empty)) : ((+4) : ((+1) : empty))) |