Further README clarification
This commit is contained in:
parent
ff2952010f
commit
064bed26c5
42
README.md
42
README.md
@ -2,38 +2,42 @@
|
|||||||
|
|
||||||
## Introduction
|
## Introduction
|
||||||
|
|
||||||
sapling is a "micro-language" that I'm working on to investigate [Tree Calculus](https://github.com/barry-jay-personal/typed_tree_calculus/blob/main/typed_program_analysis.pdf) .
|
sapling is a "micro-language" that [I'm](https://eversole.co) working on to investigate [Tree Calculus](https://github.com/barry-jay-personal/typed_tree_calculus/blob/main/typed_program_analysis.pdf) .
|
||||||
|
|
||||||
It offers a minimal amount of syntax sugar:
|
It offers a minimal amount of syntax sugar yet provides a complete and intuitive programming environment. Sapling offers:
|
||||||
|
|
||||||
- `t` operator behaving by the rules of Tree Calculus
|
- `t` operator behaving by the rules of Tree Calculus
|
||||||
- Function ("variable") definitions
|
- Function ("variable") definitions
|
||||||
- Lambda abstractions
|
- Lambda abstractions
|
||||||
- List, Number, and String literals (WIP)
|
- List, Number, and String literals
|
||||||
|
|
||||||
This is an active experimentation project by [someone who has no idea what they're doing](https://eversole.co).
|
|
||||||
|
|
||||||
## What does it look like?
|
## What does it look like?
|
||||||
|
|
||||||
```
|
```
|
||||||
false = t
|
-- Anything after `--` on a line is a comment
|
||||||
_ = t
|
-- We can define functions or "variables" as tree calculus values
|
||||||
true = t t
|
false = t
|
||||||
id = (\a : a)
|
_ = t
|
||||||
triage = (\a b c : t (t a b) c)
|
true = t t
|
||||||
match_bool = (\ot of : triage of (\_ : ot) t)
|
-- We can define functions as lambda expressions that are eliminated to tree
|
||||||
and = match_bool id (\_ : false)
|
-- calculus terms.
|
||||||
if = (\cond then else : t (t else (t t then)) t cond)
|
id = (\a : a) -- t (t (t t)) t
|
||||||
triage = (\a b c : t (t a b) c)
|
triage = (\a b c : t (t a b) c)
|
||||||
test = triage "leaf" (\_ : "stem") (\_ _ : "fork")
|
triage = (\a b c : t (t a b) c)
|
||||||
|
-- Intensionality !!!
|
||||||
|
test = triage "Leaf" (\_ : "Stem") (\_ _ : "Fork")
|
||||||
|
|
||||||
-- The REPL outputs the tree form results by default; they are elided here.
|
-- REPL
|
||||||
|
-- `sapling <` is the input prompt
|
||||||
|
-- `sapling >` is the Tree Calculus form output. Most are elided below.
|
||||||
|
-- `DECODE -:` is an attempt to interpret the TC output as strings/numbers.
|
||||||
sapling < test t
|
sapling < test t
|
||||||
DECODE -: "leaf"
|
sapling > Fork (Fork Leaf (Fork ...) ... )
|
||||||
|
DECODE -: "Leaf"
|
||||||
sapling < test (t t)
|
sapling < test (t t)
|
||||||
DECODE -: "stem"
|
DECODE -: "Stem"
|
||||||
sapling < test (t t t)
|
sapling < test (t t t)
|
||||||
DECODE -: "fork"
|
DECODE -: "Fork"
|
||||||
sapling < map (\i : listConcat i " is super cool!") [("He") ("She") ("Everybody")]
|
sapling < map (\i : listConcat i " is super cool!") [("He") ("She") ("Everybody")]
|
||||||
DECODE -: ["He is super cool!", "She is super cool!", "Everybody is super cool!"]
|
DECODE -: ["He is super cool!", "She is super cool!", "Everybody is super cool!"]
|
||||||
```
|
```
|
||||||
|
Loading…
x
Reference in New Issue
Block a user