0dd14a3aeab3e011d2fba04bc4be3c5d4b01a412
				
			
			
		
	 James Eversole
		
	
	0dd14a3aea
	
	
	Automatic decoding of supported literals in REPL
			James Eversole
		
	
	0dd14a3aea
	
	
	Automatic decoding of supported literals in REPL
		
			
			Automatic decoding & display of string, number, and list types in REPL. General updates to README, style, and comments.
sapling
Introduction
sapling is a "micro-language" that I'm working on to investigate Tree Calculus .
It offers a minimal amount of syntax sugar:
- toperator behaving by the rules of Tree Calculus
- Function ("variable") definitions
- Lambda abstractions
- List, Number, and String literals (WIP)
This is an active experimentation project by someone who has no idea what they're doing.
What does it look like?
false = t
true = t t
id = (\\a : a)
triage = (\\a b c : t (t a b) c) 
match_bool = (\\ot of : triage of (\\z : ot) t)
and = match_bool id (\\z : false)
if = (\\cond then else : t (t else (t t then)) t cond)
triage = (\\a b c : t (t a b) c)
test = triage \"leaf\" (\\z : \"stem\") (\\a b : \"fork\")
sapling < test t
sapling > Fork (...)
DECODE -: "leaf"
sapling < test (t t)
sapling > Fork (...)
DECODE -: "stem"
sapling < test (t t t)
sapling > Fork (...)
DECODE -: "fork"
How to use
For now, you can easily build and run this project using Nix:
- Clone the repository:
a. git clone ssh://git.eversole.co/sapling.gitb.git clone https://git.eversole/sapling.git
- Run the REPL: nix run
Acknowledgements
Tree Calculus was discovered by Barry Jay.
treecalcul.us is an excellent website with an intuitive playground created by Johannes Bader that introduced me to Tree Calculus. If sapling sounds interesting but compiling this repo sounds like a hassle, you should check out his site.
					Languages
				
				
								
								
									Haskell
								
								97.9%
							
						
							
								
								
									Nix
								
								2.1%