General refactor for legibility

Priming to update all source to lhs and document extensively
This commit is contained in:
James Eversole
2025-01-19 14:41:25 -06:00
parent a3282b794f
commit ad02c8b86a
6 changed files with 127 additions and 171 deletions

View File

@ -28,7 +28,7 @@ data TricuAST
| SEmpty
deriving (Show, Eq, Ord)
-- Tokens from Lexer
-- Lexer Tokens
data LToken
= LKeywordT
| LIdentifier String
@ -61,19 +61,6 @@ apply (Fork (Fork a1 a2) a3) Leaf = a1
apply (Fork (Fork a1 a2) a3) (Stem u) = apply a2 u
apply (Fork (Fork a1 a2) a3) (Fork u v) = apply (apply a3 u) v
-- SKI Combinators
_S :: T
_S = Fork (Stem (Fork Leaf Leaf)) Leaf
_K :: T
_K = Stem Leaf
-- Identity
-- We use the "point-free" style which drops a redundant node
-- Full I form (SKK): Fork (Stem (Stem Leaf)) (Stem Leaf)
_I :: T
_I = Fork (Stem (Stem Leaf)) Leaf
-- Booleans
_false :: T
_false = Leaf