REPL namespaces; lib function for pattern matching
All checks were successful
Test, Build, and Release / test (push) Successful in 1m52s
Test, Build, and Release / build (push) Successful in 1m20s

Adds support for REPL namespacing, primarily to avoid `main` collisions.
Also adds a library function for an ergonomic pattern matching function
that I've been noodling on. I might explore ways to make list syntax
less annoying specifically for pattern matching like this.
This commit is contained in:
2025-02-02 10:50:28 -06:00
parent 1a9a4494e0
commit f9864b8361
11 changed files with 165 additions and 81 deletions

View File

@@ -53,7 +53,7 @@ data EvaluatedForm = TreeCalculus | FSL | AST | Ternary | Ascii | Decode
deriving (Show, Data, Typeable)
-- Environment containing previously evaluated TC terms
type Env = Map.Map String T
type Env = Map.Map String T
-- Tree Calculus Reduction
apply :: T -> T -> T
@@ -122,7 +122,7 @@ formatResult Ascii = toAscii
formatResult Decode = decodeResult
toSimpleT :: String -> String
toSimpleT s = T.unpack
toSimpleT s = T.unpack
$ replace "Fork" "t"
$ replace "Stem" "t"
$ replace "Leaf" "t"