PureScript is a functional language with strong, static types which compiles to JavaScript.
PureScript is a small strongly, statically typed programming language with expressive types, written in and inspired by haskell, and compiling to javascript.
PureScript has a number of interesting features, such as:
- Type Inference
- Higher Kinded Polymorphism
- Support for basic Javascript types
- Extensible records
- Extensible effects
- Optimizer rules for generation of efficient Javascript
- Pattern matching
- Simple FFI
- Modules
- Rank N Types
- Do Notation
- Tail-call elimination
- Type Classes
Sample "Hello word" :
import Control.Monad.Eff.Console
main = do
log "Hello, PureScript"
Would be compiled into:
var Control_Monad_Eff_Console = require("Control.Monad.Eff.Console");
var main = Control_Monad_Eff_Console.log("Hello sailor!");
module.exports = {
main: main
};
References: