️ A friendly language for building type-safe, scalable systems!
Find a file
Louis Pilfold 1b64cf931c v0.4.2
2019-10-22 23:39:37 +01:00
.circleci Remove first class modules, use . for module select 2019-08-26 11:57:25 +01:00
bin Handle multiple tags in build script 2019-09-19 22:23:06 +01:00
book Book: Commonly used enums, float operators 2019-09-19 21:46:14 +01:00
docs Book: Commonly used enums, float operators 2019-09-19 21:46:14 +01:00
gleam Backport label fixes 2019-10-22 23:27:33 +01:00
gleam_stdlib Belated changelog update 2019-09-22 18:07:04 +01:00
.gitattributes Mark website as generated for GitHub 2019-08-07 10:11:49 +01:00
CHANGELOG.md v0.4.2 2019-10-22 23:39:37 +01:00
CODE_OF_CONDUCT.md CODE_OF_CONDUCT.md 2018-09-22 14:44:53 +01:00
CONTRIBUTING.md Erlang installation instructions 2019-03-12 21:40:24 +00:00
LICENCE copyright 2019-06-23 21:30:28 +01:00
Makefile Removing is_error from tests 2019-09-17 22:20:26 +01:00
README.md Update CHANGELOG for named structs 2019-09-03 20:37:35 +01:00

Gleam

build GitHub release IRC: #gleam-lang on chat.freenode.net

Gleam is a statically typed functional programming language for building scalable concurrent systems. It compiles to Erlang and has straightforward interop with other BEAM languages such as Erlang, Elixir and LFE.

pub enum Tree(value) =
  | Leaf(value)
  | Node(Tree(value), Tree(value))

pub fn any(tree: Tree(a), check: fn(a) -> Bool) -> Bool {
  case tree {
  | Leaf(i) -> check(i)
  | Node(left, right) -> any(left, check) || any(right, check)
  }
}

pub fn has_even_leaf(tree: Tree(Int)) -> Bool {
  any(tree, fn(i) {
    i % 2 == 0
  })
}

For more information see the Gleam website: https://gleam.run.