A darn rootin' tootin' language

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.

Syntax

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"
  1. Minimal syntax, meaning semicolons,inand other verbosity is entirely optional.
  2. Implicit type classes allows for a smarter form of overloading.
  3. Pattern matching and guards make it possible to write more intuitive code.

Streams and sugar

let () =
 Stream.range 1 100 (* 1 *)
 |> Stream.map (+10) (* 2 *)
 |> Stream.fold (+) 0
 |> (* 3 *) print
  1. A sometimes smart optimiser allows you to manipulate streams without worrying about a loss of performance.
  2. Operators sections make higher order functions even easier to use
  3. Define custom operators to write code more concisely.