element.version === currentVersion)) { versionNodes.unshift({ version: currentVersion, url: "#" }); } document.querySelector("#project-version").innerHTML = versionNodes.reduce( (acc, element) => { const status = currentVersion === element.version ? "selected disabled" : ""; return ` ${acc} `; }, `
glatch · v1.1.1

glatch

Package Version Hex Docs

logo

Gleam type check using pattern matching

gleam add glatch
import glatch.{IsString}
import gleam/string

pub fn main() {
  case glatch.get_type("Lucy") {
    IsString(_) -> "Hello, 𓇼"
    unknown -> "Who are you? " <> string.inspect(unknown)
  }
}

Further documentation can be found at https://hexdocs.pm/glatch.

Current status

Native / Stdlib

  • String
  • Int
  • Float
  • Bool
  • List
    • nested type check
    • empty type check
  • Option
    • Some type check
    • None type check
  • Result
    • Ok type check
    • Error type check
  • Dict
    • key type check
    • value type check
    • empty type check
  • Tuple
    • Arity 0-6

Development

gleam run   # Run the project
gleam test  # Run the tests
gleam shell # Run an Erlang shell
Search Document