Skip to content
forked from gleam-lang/gleam

⭐️ A statically typed language for the Erlang VM

License

Notifications You must be signed in to change notification settings

tsloughter/gleam

Repository files navigation

Gleam

module Shape

export Quadrilateral(..), from_dimensions/2

type Quadrilateral
  = Square(Int)
  | Rectangle(Int, Int)

fn from_dimensions(width, height) =
  case width == height
  | True => Square(width)
  | False => Rectangle(width, height)

test from_dimensions =
  from_dimensions(100, 100) |> Assert.equal(_, Square(100))
  from_dimensions(100, 120) |> Assert.equal(_, Rectangle(100, 120))

About

⭐️ A statically typed language for the Erlang VM

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Rust 95.6%
  • Erlang 3.0%
  • Other 1.4%