Preface
License
Versioning Policy
1.
Getting Started
1.1.
Why Learn PureScript
1.2.
The Strengths of PureScript
1.3.
FAQs on PureScript
1.4.
Install Guide
1.5.
The REPL
1.6.
Other Important Info
2.
FP Philosophical Foundations
2.1.
Composition Everywhere
2.2.
Pure vs Impure Functions
2.3.
Data Types
2.4.
Lazy vs Strict
2.5.
Looping via Recursion
2.6.
Type Classes
2.7.
Equational Reasoning
2.8.
FP: The Big Picture
3.
Build Tools
3.1.
Dependency Managers
3.1.1.
Bower Explained
3.1.2.
Spago Explained
3.1.3.
Why We Need Both
3.2.
Spago: Project Workflow
3.3.
Bower: Project Workflow
3.4.
Continuous Integration
3.5.
Formatters
4.
Syntax
4.1.
Basic Syntax
4.1.1.
src
4.1.1.1.
Comments.purs
4.1.1.2.
Preliminary Concepts
4.1.1.2.1.
Value Function Data Syntax.purs
4.1.1.2.2.
Explaining Kinds
4.1.1.2.3.
The Prim Module.purs
4.1.1.3.
Data and Functions
4.1.1.3.1.
Defining Values and Functions.purs
4.1.1.3.2.
Function Currying.purs
4.1.1.3.3.
Abbreviated Function Body.purs
4.1.1.3.4.
Keyword: Data.purs
4.1.1.3.5.
Pattern Matching in Functions.purs
4.1.1.4.
Special Compiler Features
4.1.1.4.1.
Typed Holes.purs
4.1.1.4.2.
Typed Wildcards.purs
4.1.1.4.3.
Typed Holes On Complex Expressions.purs
4.1.1.5.
Various Keywords
4.1.1.5.1.
Keyword: Forall.purs
4.1.1.5.2.
Keyword: Type.purs
4.1.1.5.3.
Keywords: Case expression of.purs
4.1.1.5.4.
Keywords: Where and Let In.purs
4.1.1.5.5.
Indentation Rules.purs
4.1.1.5.6.
Let Lacks Generalization.purs
4.1.1.5.7.
Keywords: If Then Else.purs
4.1.1.6.
Records
4.1.1.6.1.
Basic Syntax.purs
4.1.1.6.2.
Quoted Key Syntax.purs
4.1.1.6.3.
Row Polymorphism.purs
4.1.1.7.
Infix Notation
4.1.1.7.1.
Regular.purs
4.1.1.7.2.
Extended.purs
4.1.1.8.
Functions and Data with Higher Kinded Types.purs
4.1.1.9.
TypeClasses
4.1.1.9.1.
Single Paramter.purs
4.1.1.9.2.
Constraining Types Using Typeclasses.purs
4.1.1.9.3.
Dictionaries: How Type Classes Work.purs
4.1.1.9.4.
Typeclass Relationships.purs
4.1.1.9.5.
Typeclasses with No Definitions.purs
4.1.1.9.6.
Type Class Kind Signatures.purs
4.1.1.9.7.
Multi Paramter.purs
4.1.1.9.8.
Functional Dependencies.purs
4.1.1.9.9.
Instance Chains.purs
4.1.1.10.
Newtypes
4.1.1.10.1.
Keyword: Newtype.purs
4.1.1.10.2.
Recursive Types Newtypes.purs
4.1.1.11.
Deriving Instances
4.1.1.11.1.
Supported Compiler TypeClasses.purs
4.1.1.11.2.
Instances for Newtyped Types.purs
4.1.1.11.3.
Deriving Newtype.purs
4.1.1.11.4.
Deriving Generic.purs
4.1.1.12.
Special Type Classes
4.1.1.12.1.
Partial.purs
4.1.1.12.2.
Coercible.purs
4.1.1.13.
TypeClass Gotchas
4.1.1.13.1.
Type Equality Not Propagate.purs
4.1.1.13.2.
Global Instances
4.1.1.13.3.
Designing TypeClasses
4.1.1.14.
Visible Type Applications
4.1.1.14.1.
Intro.purs
4.1.1.14.2.
Order Matters.purs
4.1.1.14.3.
Skipping Wildcards.purs
4.1.1.14.4.
Usage.purs
4.1.1.14.5.
TypeClasses.purs
4.1.1.14.6.
Gotchas.purs
4.1.1.15.
Documentation.purs
4.1.1.16.
Unicode Syntax Support.purs
4.1.1.17.
Understanding Type Inference
4.2.
Foreign Function Interface
4.2.1.
src
4.2.1.1.
Same File Name.js
4.2.1.2.
Same File Name.purs
4.2.1.3.
Other Bindings.js
4.2.1.4.
Bindings Tip.js
4.2.1.5.
Bindings Tip.purs
4.3.
Type Level Programming Syntax
4.3.1.
src
4.3.1.1.
An Overview of Terms and Concepts
4.3.1.2.
Basic Syntax
4.3.1.2.1.
Defining Custom Kinds.purs
4.3.1.2.2.
Kind Signatures.purs
4.3.1.2.3.
Polymorphic Kinds.purs
4.3.1.2.4.
Proxy.purs
4.3.1.3.
Defining Functions
4.3.1.3.1.
Single Arg Syntax.purs
4.3.1.3.2.
Multi Arg Syntax.purs
4.3.1.3.3.
Pattern Matching Using Instances.purs
4.3.1.3.4.
Pattern Matching Using Instance Chains.purs
4.3.1.4.
Using Type Level Values
4.3.1.4.1.
Reflection.purs
4.3.1.4.2.
Reification.purs
4.3.1.4.3.
Conventions.purs
4.3.1.5.
Symbol Syntax.purs
4.3.1.6.
Integer Syntax.purs
4.3.1.7.
Row Syntax.purs
4.3.1.8.
RowList
4.4.
Module Syntax
4.4.1.
src
4.4.1.1.
Basic Syntax.purs
4.4.1.2.
Basic Exporting.purs
4.4.1.3.
Basic Importing.purs
4.4.1.4.
Resolving Naming Conflicts Using Keyword: Hiding.purs
4.4.1.5.
Resolving Naming Conflicts Using Module Aliases.purs
4.4.1.6.
Re exporting Modules or Submodules.purs
4.4.1.7.
Exporting Entire Current Module.purs
4.4.1.8.
Full Module Syntax.purs
4.5.
Prelude Syntax
4.5.1.
src
4.5.1.1.
Discard
4.5.1.2.
Do Notation.purs
4.5.1.3.
Reading Do As Nested Binds
4.5.1.4.
Ado Notation.purs
4.5.1.5.
Natural Transformation.purs
4.6.
Modifying Do Ado Syntax Sugar
4.6.1.
src
4.6.1.1.
Rebindable Ado.purs
4.6.1.2.
Rebindable Do.purs
4.6.1.3.
Introducing Qualified Do Ado
4.6.1.4.
MonadLikeTypeClasses.purs
4.6.1.5.
Qualified Do.purs
4.6.1.6.
Qualified Ado.purs
4.6.1.7.
Useful Dos
5.
Hello World
5.1.
Prelude ish
5.1.1.
Basic FP Data Types
5.1.1.1.
Void
5.1.1.2.
Unit
5.1.1.3.
Sum and Product Types
5.1.1.4.
Either
5.1.1.5.
Maybe
5.1.1.6.
Tuple
5.1.1.7.
These
5.1.1.8.
List
5.1.2.
Miscellaneous Functions
5.1.3.
Preludes Type Classes
5.1.4.
Laws
5.1.5.
Composition Typeclasses
5.1.5.1.
Objecty: Show and Equal to Bounded
5.1.5.2.
Arrows: Semigroupoid and Category
5.1.6.
Appendable Typeclasses
5.1.7.
Control Flow Typeclasses
5.1.7.1.
Functor
5.1.7.2.
Apply
5.1.7.3.
Applicative
5.1.7.4.
Bind
5.1.7.5.
Monad
5.1.7.6.
How the Computer Executes FP Programs
5.1.7.7.
Useful Monads
5.1.7.8.
Monoids Reconsidered
5.1.7.9.
One Monadic Type Per Monadic Context
5.1.8.
Numeric Hierarchy
5.2.
Effect and Aff
5.2.1.
src
5.2.1.1.
Effect
5.2.1.1.1.
Native Side Effects via Effect
5.2.1.1.2.
Hello World.purs
5.2.1.1.3.
Hello Number.purs
5.2.1.1.4.
Hello Do Notation.purs
5.2.1.1.5.
Other Effects
5.2.1.1.5.1.
Random Number.purs
5.2.1.1.5.2.
Current Date and Time.purs
5.2.1.1.5.3.
Timeout and Interval.purs
5.2.1.1.6.
Mutable State
5.2.1.1.6.1.
Global.purs
5.2.1.1.6.2.
Local.purs
5.2.1.1.7.
Summary of Effect Libraries
5.2.1.2.
Effect Eff and Aff
5.2.1.3.
Aff
5.2.1.3.1.
Basics
5.2.1.3.1.1.
Launching Aff.purs
5.2.1.3.1.2.
Delay.purs
5.2.1.3.1.3.
Fork Join.purs
5.2.1.3.1.4.
Suspend Join.purs
5.2.1.3.1.5.
Cached Join.purs
5.2.1.3.1.6.
Switching Contexts.purs
5.2.1.3.2.
Lifting Monads
5.2.1.3.2.1.
MonadEffect
5.2.1.3.2.2.
SpecialLog.purs
5.2.1.3.2.3.
Timeout and Interval.purs
5.2.1.3.3.
Node ReadLine
5.2.1.3.3.1.
Readline API
5.2.1.3.3.2.
ReadLine Effect.purs
5.2.1.3.3.3.
Converting Effects with Callbacks into Aff
5.2.1.3.3.4.
ReadLine Aff.purs
5.2.1.3.4.
Useful Aff Libraries
5.3.
Debugging
5.3.1.
src
5.3.1.1.
General Debugging
5.3.1.2.
Custom Type Errors
5.3.1.2.1.
Overview API.purs
5.3.1.2.2.
Values.purs
5.3.1.2.3.
Functions.purs
5.3.1.2.4.
Type Class Instances.purs
5.3.1.3.
Debug
5.3.1.3.1.
Debug.purs
5.3.1.3.2.
DebugWarning
5.3.1.3.3.
Local State.purs
5.3.1.4.
Console Based Debugging
5.3.1.5.
Other Tips
5.4.
Collections and Loops
5.4.1.
src
5.4.1.1.
Foldable
5.4.1.2.
Traversable
5.4.1.3.
Their Variations
5.4.1.4.
PureScript Filterable
5.4.1.5.
Unfoldable
5.4.1.6.
Unfoldable1
5.4.1.7.
Closing Thoughts
5.5.
Application Structure
5.5.1.
src
5.5.1.1.
A Bad Program.purs
5.5.1.2.
Monads and Effects
5.5.1.3.
MTL
5.5.1.3.1.
Foundations
5.5.1.3.1.1.
The Function Monad
5.5.1.3.1.2.
Do Notation for Monadic Functions
5.5.1.3.1.3.
Special Output
5.5.1.3.1.4.
Introducing Monad Transformers
5.5.1.3.2.
Implementing a Monad Transformer
5.5.1.3.2.1.
Looking at OO for a Pattern
5.5.1.3.2.2.
Implementing the Pattern
5.5.1.3.2.3.
A Magical Monad
5.5.1.3.2.4.
Proving the Syntax
5.5.1.3.3.
Ask and Reader
5.5.1.3.3.1.
Overview
5.5.1.3.3.2.
Monad Ask Example.purs
5.5.1.3.3.3.
Monad Reader Example.purs
5.5.1.3.4.
Monad State
5.5.1.3.4.1.
Monad State
5.5.1.3.4.2.
Monad State Example.purs
5.5.1.3.5.
Tell and Writer
5.5.1.3.5.1.
Overview
5.5.1.3.5.2.
Monad Tell Example.purs
5.5.1.3.5.3.
Monad Writer Example.purs
5.5.1.3.6.
Throw and Error
5.5.1.3.6.1.
Overview
5.5.1.3.6.2.
Monad Throw Example.purs
5.5.1.3.6.3.
Monad Error Example.purs
5.5.1.3.7.
Monad Cont
5.5.1.3.7.1.
A Quick Explanation
5.5.1.3.7.2.
Monad Cont
5.5.1.3.7.3.
Monad Cont Example.purs
5.5.1.3.8.
Other Monad Transformers
5.5.1.3.9.
State Like Transformers
5.5.1.3.10.
Using a Monad Transformer
5.5.1.3.10.1.
How Monad Trans Works
5.5.1.3.10.2.
Using Monad Trans
5.5.1.3.10.3.
Monad Transformer Stacks
5.5.1.3.11.
Monad Trans
5.5.1.3.11.1.
Monad Trans
5.5.1.3.11.2.
Monad Trans Example.purs
5.5.1.3.12.
Drawbacks of MTL
5.5.1.3.13.
The ReaderT Capability Design Pattern
5.5.1.4.
Free
5.5.1.4.1.
What Is The Free Monad
5.5.1.4.1.1.
What Are Free SomeTypeClass Types
5.5.1.4.1.2.
What Is And Is Not The Free Monad
5.5.1.4.1.3.
The Original Free Monad
5.5.1.4.1.4.
The Remorseless Free Monad
5.5.1.4.2.
Why Use the Free Monad
5.5.1.4.2.1.
Seeing and Solving a Simple Example
5.5.1.4.2.2.
Reducing Boilerplate via Either
5.5.1.4.2.3.
Seeing and Solving a Harder Example
5.5.1.4.2.4.
Writing the Evaluate Function
5.5.1.4.2.5.
Optional Read: Writing the Show Function
5.5.1.4.2.6.
From Expression to Free
5.5.1.4.2.6.1.
Value.purs
5.5.1.4.2.6.2.
Add.purs
5.5.1.4.2.6.3.
Multiply.purs
5.5.1.4.2.6.4.
AddAndMultiply.purs
5.5.1.4.2.7.
Defining Modular Monads
5.5.1.4.2.8.
Layered Compilers
5.5.1.4.3.
From Free to Run
5.5.1.4.3.1.
From Either to Variant
5.5.1.4.3.2.
From Coproduct to VariantF
5.5.1.4.3.2.1.
Value.purs
5.5.1.4.3.2.2.
Add.purs
5.5.1.4.3.2.3.
Multiply.purs
5.5.1.4.3.2.4.
Original Gist
5.5.1.4.3.3.
Explaining Run
5.5.1.4.3.3.1.
Value.purs
5.5.1.4.3.3.2.
Add.purs
5.5.1.4.3.3.3.
Multiply.purs
5.5.1.4.4.
Drawbacks of Free
5.5.1.5.
Hello World
5.5.1.5.1.
Design Thought Process
5.5.1.5.2.
ReaderT.purs
5.5.1.5.3.
Free.purs
5.5.1.5.4.
Run.purs
5.5.1.6.
Number Comparison
5.5.1.6.1.
Design Thought Process
5.5.1.6.2.
ReaderT.purs
5.5.1.6.3.
Free.purs
5.5.1.6.4.
Run.purs
5.5.1.7.
Modern FP Architecture
5.6.
Type Level Programming
5.6.1.
src
5.6.1.1.
Understanding a Type Level Function
5.6.1.2.
Symbol Example
5.6.1.2.1.
Proxy.purs
5.6.1.2.2.
VTAs.purs
5.6.1.3.
Integer Example
5.6.1.3.1.
Proxy.purs
5.6.1.3.2.
VTAs.purs
5.6.1.4.
Row Example
5.6.1.4.1.
Proxy.purs
5.6.1.4.2.
VTAs.purs
5.6.1.5.
RowList
5.6.1.5.1.
Simple
5.6.1.5.1.1.
Proxy.purs
5.6.1.5.1.2.
VTAs.purs
5.6.1.5.2.
Advanced.purs
5.6.1.6.
Example Comparisons
5.6.1.7.
Type Level Primitives
5.7.
Testing
5.7.1.
test
5.7.1.1.
Unit
5.7.1.1.1.
Spec Examples
5.7.1.1.1.1.
Self Contained
5.7.1.1.1.1.1.
Console Reporter.purs
5.7.1.1.1.1.2.
Dot Reporter.purs
5.7.1.1.1.1.3.
Spec Reporter.purs
5.7.1.1.1.1.4.
Tap Reporter.purs
5.7.1.1.1.2.
Modulated
5.7.1.1.1.2.1.
Runner.purs
5.7.1.1.1.2.2.
Spec1.purs
5.7.1.1.1.2.3.
Spec2.purs
5.7.1.1.1.2.4.
Spec3.purs
5.7.1.1.1.3.
FocusedSpec.purs
5.7.1.2.
Quick Check and Laws
5.7.1.2.1.
Gen and MonadGen
5.7.1.2.2.
Test Syntax.purs
5.7.1.2.3.
Generating Random Data.purs
5.7.1.2.4.
Generating Strings.purs
5.7.1.2.5.
Arbitrary.purs
5.7.1.2.6.
Coarbitrary
5.7.1.2.7.
Problems with Arbitrary
5.7.1.2.8.
Quick Check Laws.purs
5.7.1.3.
Property Testing Libraries Comparison
5.8.
Benchmarking
5.8.1.
benchmark
5.8.1.1.
Benchmark Syntax.purs
5.9.
Next Steps
6.
Design Patterns
6.1.
Smart Constructors
6.2.
Partial Functions
6.2.1.
Via Partial.purs
6.2.2.
Via Maybe.purs
6.2.3.
Via Either String.purs
6.2.4.
Via Either ErrorType.purs
6.2.5.
Via Refined Types.purs
6.2.6.
Using Variant Based Errors
6.2.7.
Via Default Values
6.3.
Phantom Types
6.3.1.
What Are Phantom Types
6.3.2.
Restricting Argument Types.purs
6.4.
Records: Use Type Data or Newtype
6.5.
A Better TODO
6.6.
Boolean Blindness
6.7.
Fairbairn Threshold
6.8.
Keyword Argument Pattern
6.9.
Project Prelude
6.10.
Internal Modules
6.11.
Generics
6.12.
Stack Safety
6.12.1.
Explicit TCO
6.12.2.
Defunctionalization
6.13.
Voidable Sum Type.purs
6.14.
Data Validation via Applicative
6.15.
Parsing
6.16.
Serialization via Codecs
6.17.
Free Data Structures
6.18.
Zipper
6.19.
Optics
6.20.
Recursion Schemes
6.21.
Church Encoding
6.22.
Incorporating Free Structures
6.23.
Or Patterns
6.24.
Free Boolean Cube
6.25.
GADTs
6.26.
Existential Types.purs
6.27.
Higher Kinded Data
6.28.
Hyperfunctions
7.
Type Classes
7.1.
External Explanations
7.2.
Functors
7.3.
Group Like
7.4.
Type Level Programming
7.5.
Utility Functions
Light
Rust
Coal
Navy
Ayu
PureScript: Jordan's Reference
Group-Like
This image
summarizes how the various group-related type classes relate.