Skip to content

Latest commit

 

History

History
63 lines (37 loc) · 651 Bytes

README.md

File metadata and controls

63 lines (37 loc) · 651 Bytes

Mini

Build

A purely functional ML like language with Hindley-Milner type inference.

WIP.

Basic syntax

Let bindings

let a = 10
a : number

let b = [] 
b : List<a>

Function bindings

let f a b = [a, b]

f : a -> a -> List<a>

This is also the same as:

let f = fn a b => [a, b] 

let f = fn a => fn b => [a, b]

f : a -> a -> List<a>

Currying

let g = f 10 

g : number -> List<number>

Recursive definitions

let rec fact n = 
  if n <= 0 then 1 else n * fact (n-1)
  
fact : number -> number