Skip to content

mateusKoppe/lambdakalc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lambda Kalc - A ML Interpreter

This is a study project to build a interpreter based on a ML language implementing Lambda Calculus using Haskell and the Happy Parser.

Features

  • Lambdas
  • Type Validation
  • Tuples and Arrays
  • If
  • Let
  • Math operators
  • Boolean operators

Code example:

let double = (\x: Number -> x * 2)
let isDoubleBiggerThan = (\x:(Number, Number) -> (double nth (0, x)) > nth (1, x)) 

isDoubleBiggerThan (6, 11) -- true

More examples in the examples folder.

Build

Dependencies:

Parsing the grammar to generate the app/Parser.hs:

make parse

## Or if you don't have make you can just run:
happy grammar.y -o app/Parser.hs

Running the code:

cabal run < examples/1-math.lk  # Or use any other file in the example folder

About

A Interpreter based on a ML language implementing Lambda Calculus

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published