Professor Frisby Introduces Composable Functional JavaScript

110 minutes

This course teaches the ubiquitous abstractions for modeling pure functional programs. Functional languages have adopted these algebraic constructs across the board as a way to compose applications in a principled way.

We can do the same in JavaScript. While the subject matter will move beyond the functional programming basics, no previous knowledge of functional programming is required. You'll start composing functionality before you know it.

pro-course-rss-logo

PRO RSS Feed

Create linear data flow with container style types (Box)

Refactor imperative code to a single composed expression using Box

Enforce a null check with composable code branching using Either

Use chain for composable error handling with nested Eithers

A collection of Either examples compared to imperative code

Create types with Semigroups

Semigroup examples

Ensure failsafe combination using monoids

A curated collection of Monoids and their uses

Unbox types with foldMap

Delay Evaluation with LazyBox

Capture Side Effects in a Task

Use Task for Asynchronous Actions

You've been using Functors

Lift into a Pointed Functor with of

You've been using Monads

Build curried functions

Applicative Functors for multiple arguments

Apply multiple functors as arguments to a function (Applicatives)

List comprehensions with Applicative Functors

Write applicatives for concurrent actions

Leapfrogging types with Traversable

Maintaining structure whilst asyncing

Principled type conversions with Natural Transformations

Apply Natural Transformations in everyday work

Isomorphisms and round trip data transformations

Build a data flow for a real world app

Retrieve and use data from an api with pure functional constructs

Find the intersection of sets with Semigroups

js tutorial about Create linear data flow with container style types (Box)

Create linear data flow with container style types (Box)

5:04 js

We'll examine how to unnest function calls, capture assignment, and create a linear data flow with a type we call Box. This is our introduction to working with the various container-style types.

js tutorial about Refactor imperative code to a single composed expression using Box

Refactor imperative code to a single composed expression using Box

4:44 js

We refactor 3 functions, taking line by line imperative code to a single composed expression using Box container type.

js tutorial about Enforce a null check with composable code branching using Either

Enforce a null check with composable code branching using Either

5:58 js

We define the Either type and see how it works. Then try it out to enforce a null check and branch our code.

js tutorial about Use chain for composable error handling with nested Eithers

Use chain for composable error handling with nested Eithers

3:57 js

We refactor a function that uses try/catch to a single composed expression using Either. We then introduce the chain function to deal with nested Eithers resulting from two try/catch calls.

js tutorial about A collection of Either examples compared to imperative code

A collection of Either examples compared to imperative code

2:05 js

A tour of simple functions rewritten as composed expressions using Either set to 8 byte music and colorful flying blocks

js tutorial about Create types with Semigroups

Create types with Semigroups

5:52 js

An introduction to concatting items via the formal Semi-group interface. Semi-groups are simply a type with a concat method that are associative. We define three semigroup instances and see them in action.

js tutorial about Semigroup examples

Semigroup examples

2:01 js

A few examples of Semigroup definitions

js tutorial about Ensure failsafe combination using monoids

Ensure failsafe combination using monoids

4:33 js

In this video we define monoids and promote our semigroups

js tutorial about A curated collection of Monoids and their uses

A curated collection of Monoids and their uses

1:12 js

A gallery of monoid definitions and some use cases

js tutorial about Unbox types with foldMap

Unbox types with foldMap

2:50 js

We get a clearer definition of what it means to fold a type, then we look at the foldMap function

js tutorial about Delay Evaluation with LazyBox

Delay Evaluation with LazyBox

1:26 js

We rewrite the Box example using lazy evaulation

js tutorial about Capture Side Effects in a Task

Capture Side Effects in a Task

2:58 js

We examine the data structure Task, see some constructors, familiar methods, and finally how it captures side effects through laziness.

js tutorial about Use Task for Asynchronous Actions

Use Task for Asynchronous Actions

3:46 js

We refactor a standard node callback style workflow into a composed task-based workflow.

js tutorial about You've been using Functors

You've been using Functors

3:19 js

We learn the formal definition of a functor and look at the laws they obey.

js tutorial about Lift into a Pointed Functor with of

Lift into a Pointed Functor with of

1:21 js

We examine the of function we've seen on a few types and discover it's the Pointed interface.

js tutorial about You've been using Monads

You've been using Monads

5:43 js

We discover, we've been using monads! We look a little further into the chain method and see laws that ensure the monadic structure works correctly.

js tutorial about Build curried functions

Build curried functions

4:50 js

We see what it means to curry a function, then walk through several examples of curried functions and their use cases.

js tutorial about Applicative Functors for multiple arguments

Applicative Functors for multiple arguments

4:42 js

Working our way backwards from solution to problem, we define an applicative functor, then use it to apply a function of multiple arguments.

js tutorial about  Apply multiple functors as arguments to a function (Applicatives)

Apply multiple functors as arguments to a function (Applicatives)

2:18 js

We find a couple of DOM nodes that may or may not exist and run a calculation on the page height using applicatives.

js tutorial about List comprehensions with Applicative Functors

List comprehensions with Applicative Functors

2:14 js

We annihilate the need for the ol' nested for loop using Applicatives.

js tutorial about Write applicatives for concurrent actions

Write applicatives for concurrent actions

1:37 js

We start with two sequential finds using monads, then rewrite our code to achieve two concurrent finds.

js tutorial about Leapfrogging types with Traversable

Leapfrogging types with Traversable

2:52 js

We use the traversable instance on List to reimplement Promise.all() type functionality.

js tutorial about Maintaining structure whilst asyncing

Maintaining structure whilst asyncing

2:35 js

We take our Promise.all() analogy further by using traversable on a Map(). Then we use two traversals in the same workflow.

js tutorial about Principled type conversions with Natural Transformations

Principled type conversions with Natural Transformations

4:03 js

We learn what a natural transformation is and see the laws it must obey. We will see how a natural transformation must uphold the law of nt(x).map(f) == nt(x.map(f)).

js tutorial about Apply Natural Transformations in everyday work

Apply Natural Transformations in everyday work

4:24 js

We see three varied examples of where natural transformations come in handy.

js tutorial about Isomorphisms and round trip data transformations

Isomorphisms and round trip data transformations

4:30 js

We formally define isomorphisms, make a few, then use them to accomplish normal programming tasks

js tutorial about Build a data flow for a real world app

Build a data flow for a real world app

6:12 js

We form a plan to find the common ground between two artists from the spotify api. Then we sketch out a data flow to ensure we have what we need, when we need it.

js tutorial about Retrieve and use data from an api with pure functional constructs

Retrieve and use data from an api with pure functional constructs

7:07 js

We flesh out the Spotify api with pure functional constructs to retrieve two sets of related artists.

js tutorial about Find the intersection of sets with Semigroups

Find the intersection of sets with Semigroups

5:57 js

We use semigroups to find the intersection of sets, then expand that to work on as many artists as we'd like. Finally, we use foldable to show a pair of intersection and sum to shed more light on the final result set.

Presented by:

Brian Lonsdorf

Faux academic seeking attention

HEY, QUICK QUESTION!
Joel's Head
Why are we asking?