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))
forked from gleam-lang/gleam
-
Notifications
You must be signed in to change notification settings - Fork 0
⭐️ A statically typed language for the Erlang VM
License
tsloughter/gleam
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
⭐️ A statically typed language for the Erlang VM
Resources
License
Code of conduct
Stars
Watchers
Forks
Packages 0
No packages published
Languages
- Rust 95.6%
- Erlang 3.0%
- Other 1.4%