https://github.com/herrhotzenplotz/lc
Untyped Lambda Calculus Interpreter in Haskell
https://github.com/herrhotzenplotz/lc
haskell haskell-application interpreter lambda-calculus
Last synced: 11 months ago
JSON representation
Untyped Lambda Calculus Interpreter in Haskell
- Host: GitHub
- URL: https://github.com/herrhotzenplotz/lc
- Owner: herrhotzenplotz
- License: bsd-3-clause
- Created: 2020-03-27T15:06:24.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-06-22T05:14:21.000Z (over 5 years ago)
- Last Synced: 2025-01-26T17:47:35.800Z (about 1 year ago)
- Topics: haskell, haskell-application, interpreter, lambda-calculus
- Language: Haskell
- Size: 82 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: ChangeLog.md
- License: LICENSE
Awesome Lists containing this project
README
# Untyped lambda calculus interpreter
Just something I did in my spare time.

## Quick start
```bash
$ git clone git@github.com:herrhotzenplotz/lc
$ cd lc/
$ stack build
$ stack run
```
## Examples to try
+ `(\x.x \y.y)`
+ `((\x.\y.(x y) \f.f) \r.r)`
+ `let true = \x.\y.x`
+ `let false = \x.\y.y`
+ `let not = \b.((b false) true)`
+ `(not false)`
+ `release true` (removes globally bound true)
## Loading files
```bash
$ lc bool.lc fixpoint.lc
```
## Notes
Because the interpreter internally uses closures, you might sometimes
be getting seemingly incorrect results. These results should start
with a `'` sign, showing that this result still has values bound in
the closure, that have not yet been applied. This is the lazy
evaluation mechanism. To force a result, simply apply an identity
function or something else to force the lazy thunk to evaluate.
## Contributions
If you want to submit pull requests or file issues, please feel free
to do that. I'll address them as soon as I can.
## License
The lc is released under a three clause BSD license. Please see the
LICENSE file.