geam-stdlib 0.2.0

Official Gleam standard-library providers for Geam
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import gleam/function

type Boxed(value) {
  Boxed(value)
}

pub fn main() {
  assert function.identity(1) == 1
  assert function.identity(#("one", True)) == #("one", True)
  assert function.identity([1, 2, 3]) == [1, 2, 3]
  assert function.identity(Boxed("value")) == Boxed("value")

  let increment = function.identity(fn(value) { value + 1 })
  assert increment(1) == 2

  Nil
}
// @geam:expect Nil