https://github.com/phipsgabler/mini-lambda
A small normalizer for lambda calculus, implementing (almost) everything from scratch.
https://github.com/phipsgabler/mini-lambda
lambda-calculus parser-combinators
Last synced: 8 months ago
JSON representation
A small normalizer for lambda calculus, implementing (almost) everything from scratch.
- Host: GitHub
- URL: https://github.com/phipsgabler/mini-lambda
- Owner: phipsgabler
- License: unlicense
- Created: 2015-11-06T19:00:04.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2019-10-12T20:03:47.000Z (over 6 years ago)
- Last Synced: 2025-01-22T03:33:03.739Z (over 1 year ago)
- Topics: lambda-calculus, parser-combinators
- Language: Haskell
- Size: 22.5 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[](http://unmaintained.tech/)
# Mini-Lambda #
The initial purpose of this project was just to try setting up a real-world Haskell project with stack, cleanly written and tested.
It ended up in an interesting task of understanding and implementing a normalizer for the untyped lambda calculus.
## Usage ##
There is a command-line interface to the normalizer, which can most easily be accessed via `stack exec mini-lambda`. Currently, this does only run the full reduction and prints the result. The syntax is defined as follows:
EXPR = VAR
| "(" LAMBDA VAR "." EXPR ")"
| "(" EXPR EXPR ")"
LAMBDA = "λ" | "\\" (a single backspace)
VAR = (['!'..'\''] | ['*'..'-'] | ['/'..'['] | [']'..'~'])+
This means that every lambda and every application have to be fully parenthesized -- this might get improved in the future. For more details, see [Parser.hs](https://github.com/phipsgabler/mini-lambda/blob/master/src/MiniLambda/Parser.hs) (the parser combinator used is self-written, just for fun, so there's poor error handling).