diff options
author | Marvin Borner | 2024-10-27 18:45:21 +0100 |
---|---|---|
committer | Marvin Borner | 2024-10-27 18:45:21 +0100 |
commit | fe1fe57f358472561041cde12a48d28b8bd247a9 (patch) | |
tree | 53162ad90b27ff93ba8abe17c08c1a92d7b6faf1 /std/Set/StringSet.bruijn | |
parent | c6e39268be197a4eaccc0187271764a646017715 (diff) |
Improvements in maps, sets, and parsing
Diffstat (limited to 'std/Set/StringSet.bruijn')
-rw-r--r-- | std/Set/StringSet.bruijn | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/std/Set/StringSet.bruijn b/std/Set/StringSet.bruijn deleted file mode 100644 index 4bee345..0000000 --- a/std/Set/StringSet.bruijn +++ /dev/null @@ -1,23 +0,0 @@ -# MIT License, Copyright (c) 2024 Marvin Borner -# TODO: hash instead of comparing - -:input std/Set - -:import std/String S - -# adds a number of a set -add S.<?>add ⧗ String → StringSet → StringSet - -# returns true if a number is in a set -has? S.<?>has? ⧗ String → StringSet → Boolean - -:test (has? "abc" (add "abc" empty)) ([[1]]) -:test (has? "abc" empty) ([[0]]) - -# converts a list to a set -list→set S.<?>list→set ⧗ (List String) → StringSet - -:test (has? "0" (list→set ("a" : ("b" : ("d" : ("c" : {}"0")))))) ([[1]]) -:test (has? "a" (list→set ("a" : ("b" : ("d" : ("c" : {}"0")))))) ([[1]]) -:test (has? "e" (list→set ("a" : ("b" : ("d" : ("c" : {}"0")))))) ([[0]]) -:test (has? "c" (list→set ("a" : ("c" : {}"b")))) ([[1]]) |