No description
Find a file
2023-05-30 14:54:33 +02:00
demo Change ordering on lammbda_calculus example 2023-05-26 08:03:41 +02:00
sample-programs Update lambda interpreter example 2023-05-24 23:50:01 +02:00
src Cleaned files, output file name match name of text file 2023-05-30 14:39:38 +02:00
tests Refactored HM to use TVar correctly, fixed unbound variable tests from 2023-05-15 22:57:37 +02:00
.gitignore fixed gitignore 2023-05-30 14:40:34 +02:00
CHANGELOG.md cabal init and added formatting options 2023-01-17 11:42:40 +01:00
churf.cabal Cleaned files, output file name match name of text file 2023-05-30 14:39:38 +02:00
Grammar.cf Added η-expander module and removed EAdd from grammar. 2023-05-12 16:25:48 +02:00
Grammar.pdf Cleaned readme and added grammar.pdf 2023-05-30 14:54:33 +02:00
Justfile Cleaned files, output file name match name of text file 2023-05-30 14:39:38 +02:00
LICENSE Initial commit 2023-01-17 11:37:08 +01:00
Makefile Cleaned files, output file name match name of text file 2023-05-30 14:39:38 +02:00
README.md Cleaned readme and added grammar.pdf 2023-05-30 14:54:33 +02:00
shell.nix Remove clang from nix file 2023-05-16 09:54:57 +02:00

Thesis

The branch thesis contain the state of the project when the thesis report was submitted (2023-05-15).

Build

Using make the entire thing can be built by running make

Compiling a program

Using the Hindley-Milner type checker: ./churf -t hm <FILENAME>

Using the bidirectional type checker: ./churf -t bi <FILENAME>

Running ./churf will display a help message for the different available flags

Syntax

Single line comments are written using -- Multi line comments are written using {- and -}

The syntax of Churf can be read in Grammar.pdf

Here is an example program in Churf

main = case odd (sum 123) of
    True => printStr "odd!"
    False => printStr "even!"

sum = \x. case x of
    0 => 0
    n => n + (sum (n - 1))

odd x = case x of
    0 => False
    n => even (n - 1)

even x = case x of
    0 => True
    n => odd (n - 1)