Giter Site home page Giter Site logo

jllang / lambdacalculator Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 12 KB

This is a calculator (or interpreter) for Lambda Calculus implemented with Haskell, a pure functional programming language inspired by Lambda Calculus.

License: MIT License

Haskell 100.00%

lambdacalculator's Introduction

LambdaCalculator

This is a calculator (or interpreter) for Lambda Calculus implemented with Haskell, a pure functional programming language inspired by Lambda Calculus.

lambdacalculator's People

Stargazers

 avatar  avatar

Watchers

 avatar

lambdacalculator's Issues

Incorrect parentheses

I want to implement the traditional syntax where application is left-associative. If I don't type any parentheses on input, I get an expression of the form <a><b><c>, which is correct:

*Lambda> s appkapp o
(λx.λy.λz.xz(yz))(λx.λy.x)((λx.xx)(λx.xx))

But if I type parentheses to the right-hand-side applicative expression, a strange thing happens. Instead of the number of parentheses increasing, the parentheses around Ω disappear:

*Lambda> s app(kapp o)
(λx.λy.λz.xz(yz))(λx.λy.x)(λx.xx)(λx.xx)

If I type the parentheses to the applicative expression at left-hand side, I get the same expression as in the first case. This makes sense, because of the left-associativity of application. Additional parentheses would only make the expression look more complicated:

*Lambda> (s appk)app o
(λx.λy.λz.xz(yz))(λx.λy.x)((λx.xx)(λx.xx))

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.