GithubHelp home page GithubHelp logo

racket-lambda-calculus's Introduction

λ-calculus language for Racket

This is a #lang module that implements a simple λ-calculus language inside Racket.

It allows only the following forms:

  • lambda and λ
  • A simple let that allows to bind a single variable without recursive definitions: (let id expr)
  • Functions to convert lists and integers into their usual encoding in λ-calculus
  • An if macro based on the λ-calculus usual encoding for true and false

Literals and quoted data are available but since no standard operator is, the only possible use of them is through the conversion functions mentioned above.

This module is primarily intended at teaching purposes, to be used to implement λ-calculus encodings and constructions in Racket. Only the required constructions are provided (and literals for nicer syntax) and it's up to you to implement everything else: arithmetics on Peano integers, fixpoint combinators, Church encoding for pairs, lists, etc...

Usage

The easier way to use this module is to install it as a package using the raco tool:

cd lambda-calculus
raco pkg install

To update the package later:

# at the repository root!
raco pkg update --link lambda-calculus

It can then be used inside any Racket module:

#lang lambda-calculus

(let id (λ (x) x))

racket-lambda-calculus's People

Contributors

wangjiezhe avatar leotestard avatar

Watchers

 avatar  avatar

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.