PureScript - ChoDragon9/posts GitHub Wiki
A strongly-typed functional programming language that compiles to JavaScript
- Compile to readable JavaScript and reuse existing JavaScript code easily
- An extensive collection of libraries for development of web applications, web servers, apps and more
- Excellent tooling and editor support with instant rebuilds
- An active community with many learning resources
- Build real-world applications using functional techniques and expressive types, such as:
- Algebraic data types and pattern matching
- Row polymorphism and extensible records
- Higher kinded types
- Type classes with functional dependencies
- Higher-rank polymorphism
Functions can be defined at the top-level of a file by specifying arguments before the equals sign:
add :: Int -> Int -> Int
add x y = x + y
string concatenation uses the diamond operator (<>), instead of the plus operator like in JavaScript.
showAddress :: Address -> String
showAddress addr = addr.street <> ", " <>
addr.city <> ", " <>
addr.state