Something went wrong. Try again.
The Monad language. Dependent types, functional programming compiled with LLVM. Hobby project. monad-lang.org
dependent-types language compiler programming-language functional-programming
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031323334353637383940414243#![mote { name := "iteration" }]def double (x : I64) : I64 := x * 2def to_string (x : I64) : String := I64.to_string x#[test]def test_map : Bool := let list := ([1, 2, 3, 4] : List I64) in let doubled : List I64 := List.map double list in match doubled { cons h t => h == 2, empty => false }#[test]def test_map_pipe : Bool := let list := ([1, 2, 3, 4] : List I64) in let doubled : List I64 := list |> List.map double in let strings : List String := doubled |> List.map to_string in match strings { cons h t => h == "2", empty => false }#[test]def test_map_all : Bool := let list := ([1, 2, 3] : List I64) in let doubled : List I64 := List.map double list in match doubled { cons h t => h == 2 && match t { cons h2 t2 => h2 == 4 && match t2 { cons h3 empty => h3 == 6, empty => false }, empty => false }, empty => false }