Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/billiegoose/lambda-calculator
A small parser for the λ-calculus written in Haskell that I'm making for fun.
https://github.com/billiegoose/lambda-calculator
Last synced: 24 days ago
JSON representation
A small parser for the λ-calculus written in Haskell that I'm making for fun.
- Host: GitHub
- URL: https://github.com/billiegoose/lambda-calculator
- Owner: billiegoose
- License: mit
- Created: 2014-05-11T04:15:09.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-05-13T06:10:05.000Z (over 10 years ago)
- Last Synced: 2024-10-06T03:23:46.082Z (3 months ago)
- Language: Haskell
- Size: 145 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
lambda-calculator
=================A small parser for the λ-calculus written in Haskell that I'm making for fun.
> "You made _what?_" See http://en.wikipedia.org/wiki/Lambda_calculus
Usage
-----
Load the program in ghci.
Type `cal "some lambda expression"` to see the output of small step reduction.
Example:
```Haskell
*Main> cal "(/x./y.y x) y /z.z"
(((/x.(/y.(y x))) y) (/z.z))
((/_y.(_y y)) (/z.z))
((/z.z) y)
y
```Syntax
------
Variables: any word using only lowercase, uppercase, or numbers.Abstraction: λ_var_._term_ is written as `/var.term`
Application: a single space, e.g. `(/id.id) 1` == `1`
Grouping: done using parentheses, e.g. `(/x.x) x 1` == `(x 1)` but `(/x.x x) 1` == `(1 1)`