An experimental pure functional language. Goals:
- statically typed
- strictly evaluated
- uses System F with row polymorphism as the core calculus
- compiles to Emacs Lisp (or possibly lapcode).
Current status:
- Reference
- Parser
- Typechecking
- Desugaring
- System F
- Code gen
We'll see how far I get. ;)
The current Whippet syntax is OCaml-inspired, though it might become more Haskelly as I iterate on the design.
type Option a = Some a | None
signature Option {
let get : a -> Option a -> a
let some? : Option a -> Bool
let none? : Option a -> Bool
let map : (a -> b) -> Option a -> Option b
let flatMap : (a -> Option b) -> Option a -> Option b
}
module Option {
let get d = fn {
| Some x -> x
| None -> d
}
let some? = fn {
| Some _ -> True
| None -> False
}
let none? = fn {
| Some _ -> False
| None -> True
}
let map f = fn {
| Some x -> Some (f x)
| None -> None
}
let flatMap f = fn {
| Some x -> f x
| None -> None
}
}
Make sure you have Stack installed, then run:
git clone https://github.com/chrisbarrett/whippet.git
cd whippet
stack build