r/purescript • • 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):

  1. Pure Functions

  2. Immutability

  3. Higher-order Functions

  4. Currying

  5. Partial Application

  6. Recursion

  7. Tail Recursion

  8. Pattern Matching

  9. Types

    1. Polymorphic

    2. Monomorphic

    3. Sum

    4. Product

  10. Typeclasses

  11. Multi-parametric Typeclasses

  12. Overlapping Instances

  13. Orphaned Instances

  14. Functional Dependencies

  15. Isomorphisms

  16. Homomorphisms

  17. Abstract Algebra

  18. Magma

  19. Semigroup

    1. Monoid

    2. Group

    3. Abelian Group (aka Commutative Group)

    4. Semiring

    5. Ring and Commutative RingEuclidean Ring

  20. Folds

  21. Algebraic Data Types (ADT)

  22. Functors (Covariant, Contravariant, Invariant)

  23. Functors of Values vs Functions

  24. Bifunctors

  25. Profunctors

  26. Applicative Functors

  27. Traversables

  28. Foldables

  29. Applicative Parsers

  30. Monads

  31. Monadic Parsers

  32. Monad Stacks (aka Monad Transformers)

  33. Category Theory (superficially)

    1. Definition

    2. Hask Category

    3. Functors

    4. Applicative

    5. Kleisli Category

Some of the skills it’ll teach you along the way are:

  1. Interpreting Compiler Errors

  2. Type Holes

  3. Effects (Synchronous and Asynchronous)

  4. AVars and Refs (Managed Global State)

  5. Data Bus

  6. Ajax

  7. JSON Decoding

  8. Foreign Function Interface (FFI)

From the exercises and final project you will learn:

  1. Hash Routing

  2. Static File Servers

  3. CORS

  4. Salt Hashing Passwords

91 Upvotes

30 comments sorted by

View all comments

Show parent comments

1

u/[deleted] Sep 09 '22

[removed] — view removed comment

1

u/imright_anduknowit Sep 09 '22

So, Haskell compiles to binary, which makes it good for servers or desktop applications. PureScript compiles to Javascript, which makes it good for anywhere Javascript is, e.g. the browser, or anywhere Node.js runs well.

1

u/demesisx Jan 18 '24

I'm wondering if you've revisited this comment. Wondering if it's still true. I am developing a DApp with Haskell and Purescript with Plutus for on chain code and Purescript is really impressing me with Halogen. Wondering what you think now that Haskell is able to (or close to being able to) compile to JS and WASM.

2

u/imright_anduknowit Jan 18 '24

I cannot speak to how Haskell has closed the gap since my comment. But even if it did close the gap, there’s no benefit to writing my backend in another language. Especially since most of my developers know PureScript and only a handful know Haskell or its ecosystem which still pails in comparison to PureScript’s.

1

u/demesisx Jan 20 '24

Thanks. I actually disagree. I actually find Haskell easier and far superior for back end applications. Everything I tried to do in Haskell just worked for the back end stuff and everything I have tried in Purescript has had major issues. Anecdotal, I guess. But I'm glad to discuss further.