Skip to content

rizo/ppx_lambda

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ppx_lambda

Simplified lambda syntax extension for OCaml.

let obtain_number = () => 42
let inc = x => x + 1
let ignore = (x) => 42
let hello = name => "Hello, " ^ name ^ "!"
let sum = x y => x + y


let test () =
    assert (inc 1 = 2);
    assert (inc 101 = 102);
    assert (inc (-1) = 0);
    assert (ignore 987 = 42);
    assert (ignore true = 42);
    assert (ignore () = 42);
    assert (hello "Bob" = "Hello, Bob!");
    assert (((x => x + 1) 1) = 2);
    assert (sum 2 3 = 5);
    assert ((List.map (x => x * x) [1; 2; 3]) = [1; 4; 9]);

About

Simplified lambda syntax extension for OCaml.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages