tricu/src/Eval.hs
James Eversole 9f9aca4040 Initialize Repo
Working (but likely buggy!) lexing, parsing, and evaluation of Tree Calculus terms
2024-12-18 18:59:07 -06:00

11 lines
303 B
Haskell

module Eval where
import Parser
import Research
evalSapling :: SaplingAST -> T
evalSapling TLeaf = Leaf
evalSapling (TStem t) = Stem (evalSapling t)
evalSapling (TFork t1 t2) = Fork (evalSapling t1) (evalSapling t2)
evalSapling _ = error "Evaluation currently only supported for Tree Calculus terms."