Amulet takes the beauty and power of existing functional languages like ML and Haskell, strips them down to their bare essentials and builds up a new, elegant language.
Amulet provides support for higher-rank parametric polymorphic types and row-polymorphic records, pattern matching with algebraic data types, and tail recursion elimination.
let () = let value = Random.of_range 1 10 (* 1 *) print "Guess a number between 1 and 10: " match IO.read with (* 2 *) | Nothing -> print "Not a number" | Just guess when value = guess (* 3 *) -> print "Correct!" | Just _ -> print "Incorrect"
inand other verbosity is entirely optional.
let () = Stream.range 1 100 (* 1 *) |> Stream.map (+10) (* 2 *) |> Stream.fold (+) 0 |> (* 3 *) print