chenjianxin / gleam

⭐️ A statically typed language for the Erlang VM

Home Page:https://gleam.run

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Gleam logo

Fast, friendly, functional!

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.

It looks like this:

pub type 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.

About

⭐️ A statically typed language for the Erlang VM

https://gleam.run

License:Apache License 2.0


Languages

Language:Rust 97.7%Language:HTML 0.8%Language:CSS 0.8%Language:Erlang 0.3%Language:Shell 0.2%Language:Makefile 0.1%Language:Dockerfile 0.1%