https://github.com/jacoby6000/extensible-ast-poc
Proof of concept for an arbitrarily extensible AST
https://github.com/jacoby6000/extensible-ast-poc
Last synced: about 1 year ago
JSON representation
Proof of concept for an arbitrarily extensible AST
- Host: GitHub
- URL: https://github.com/jacoby6000/extensible-ast-poc
- Owner: Jacoby6000
- License: mit
- Created: 2017-09-05T21:43:33.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-09-11T23:43:35.000Z (almost 9 years ago)
- Last Synced: 2025-02-04T17:47:34.555Z (over 1 year ago)
- Language: Haskell
- Size: 8.79 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
```
$ stack ghci
extensible-ast-poc-0.1.0.0: initial-build-steps (lib)
Configuring GHCi with the following packages: extensible-ast-poc
GHCi, version 8.0.2: http://www.haskell.org/ghc/ :? for help
Loaded GHCi configuration from /Users/jacobbarber/.ghci
[1 of 7] Compiling AST.Core ( /Users/jacobbarber/projects/extensible-ast-poc/src/AST/Core.hs, interpreted )
[2 of 7] Compiling AST.LambdaCalc ( /Users/jacobbarber/projects/extensible-ast-poc/src/AST/LambdaCalc.hs, interpreted )
[3 of 7] Compiling AST.Primitives ( /Users/jacobbarber/projects/extensible-ast-poc/src/AST/Primitives.hs, interpreted )
[4 of 7] Compiling AST.Alg.Eval ( /Users/jacobbarber/projects/extensible-ast-poc/src/AST/Alg/Eval.hs, interpreted )
[5 of 7] Compiling AST.Alg.Simple ( /Users/jacobbarber/projects/extensible-ast-poc/src/AST/Alg/Simple.hs, interpreted )
[6 of 7] Compiling AST.Alg ( /Users/jacobbarber/projects/extensible-ast-poc/src/AST/Alg.hs, interpreted )
[7 of 7] Compiling AST ( /Users/jacobbarber/projects/extensible-ast-poc/src/AST.hs, interpreted )
Ok, modules loaded: AST, AST.Alg, AST.Alg.Eval, AST.Alg.Simple, AST.Core, AST.LambdaCalc, AST.Primitives.
Loaded GHCi configuration from /private/var/folders/5s/7gqq0sgd0_1dsyygvmcsspw80000gn/T/ghci67153/ghci-script
𝝀> import Data.Comp.Multi.Ops
𝝀> import AST
𝝀> case exprAsString(Data.Comp.Multi.Term (Inl (Lam "x" (Data.Comp.Multi.Term(Inr(PrimTerm (Data.Comp.Multi.Term(Inr(PrimInt 5))))))))) of {Evaluated s -> s}
"\120640x.5"
```