r/purescript • u/imright_anduknowit • Jun 15 '21
PureScript Book: Functional Programming Made Easier: A Step-by-Step Guide
I’m excited to announce that I finished my book, Functional Programming Made Easier: A Step-by-Step Guide. By the end of this book, the reader will not only learn Functional Programming, but they will learn PureScript.
https://leanpub.com/fp-made-easier
This book takes the reader from knowing zero about Functional Programming to writing a Full-Stack application using HTTPure on the backend and Halogen 6on the front-end.
Below is a list of some of what’s covered (in no particular order):
- Pure Functions
- Immutability
- Higher-order Functions
- Currying
- Partial Application
- Recursion
- Tail Recursion
- Pattern Matching
Types
- Polymorphic
- Monomorphic
- Sum
- Product
- Typeclasses
- Multi-parametric Typeclasses
- Overlapping Instances
- Orphaned Instances
- Functional Dependencies
- Isomorphisms
- Homomorphisms
- Abstract Algebra
- Magma
Semigroup
- Monoid
- Group
- Abelian Group (aka Commutative Group)
- Semiring
- Ring and Commutative RingEuclidean Ring
- Folds
- Algebraic Data Types (ADT)
- Functors (Covariant, Contravariant, Invariant)
- Functors of Values vs Functions
- Bifunctors
- Profunctors
- Applicative Functors
- Traversables
- Foldables
- Applicative Parsers
- Monads
- Monadic Parsers
- Monad Stacks (aka Monad Transformers)
Category Theory (superficially)
- Definition
- Hask Category
- Functors
- Applicative
- Kleisli Category
Some of the skills it’ll teach you along the way are:
- Interpreting Compiler Errors
- Type Holes
- Effects (Synchronous and Asynchronous)
- AVars and Refs (Managed Global State)
- Data Bus
- Ajax
- JSON Decoding
- Foreign Function Interface (FFI)
From the exercises and final project you will learn:
- Hash Routing
- Static File Servers
- CORS
- Salt Hashing Passwords
9
u/znsnnwanderer Jun 15 '21
Looks great! At 1900 pages this is roughly three times "Real World Haskell" ;-) After working through "PureScript by Example" I was looking for something to continue my adventures in PureScript. This seems like a good fit. Thanks for writing!
7
u/mikerob215 Jun 22 '21
Was very excited after seeing this post so I got myself a copy. I'm about 200 pages in and it's just great. The writing is clear and I think the exercises were put in in a way that makes them easy to do and hard to skip. Even though I'm comfortable with beginner level purescript and Haskell, I still took the advice of going through the early chapters anyway and it was totally worth it.
Great job on this, I'd recommend it to anyone who wants to get started with fp.
5
u/[deleted] Jun 17 '21
Whoa. Sensational. Excellent job. I look forward to checking it out too. I was just looking into PureScript as it seems 'Haskell to Browser Stuff' is not quite well developed. I'm working heavily with React, but I want the type-powah (and more) of Haskell. And I don't want TypeScript.
I'm going to bookmark this. Very excited.
4
u/deadshot465 Jun 26 '21
This is really good. Personally I have been stuck at practices in PureScript by Example because there seems to not have many explanations, so I was very pleased to discover this book. After reading the sample I immediately decided to buy the whole book. The explanations are detailed and clear as it promised in the very beginning, from A to Z. Even though I already have some experiences in ML languages and Clojure, I still find refreshing what I already know by reading the texts very helpful and fun. Highly recommended.
3
u/dnkuroski Jul 19 '21
Thank you so much for this book <3
I have a huge interest in FP, but I was never able to "go to the next level".
I've already tried Elm before, and sincerely, after you experience this kind of environment, it sucks hard to go back to JS/TS.
But I always got stuck on basic concepts, sometimes I even felt that I didn't have the capacity to go beyond the "traditional way of building applications".
I'm already on the 300's page, and I'm feeling happy and excited to learn everything!
This is probably the best book I've read until now, thanks for writing it.
5
u/[deleted] Jun 24 '21
Can we pin this?
1
u/janat087 Aug 15 '21
You explain the difference between sum and product types without pointing to the fact that if you were to count the permutations those hold you’d sum or multiply. It got theoretical and meaningless in your description of reasoning. Otherwise I like the rest of segways into theory.
1
u/daigoro_sensei Jan 03 '23
This is actually an incredible book. Completed it a few months ago and continue to refer back to it. The 2k pages and theory were daunting at first but well worth the effort.
2
u/[deleted] Jun 17 '21
Great, I don't know Purescript but I would still love to learn about FP..
5
u/[deleted] Jun 17 '21
[removed] — view removed comment