A sighting of sequence function in Practical FP...

Sponsored · Your Podcast. Everywhere. Effortlessly. Share. Educate. Inspire. Entertain. You do you. We'll handle the rest. →

A sighting of sequence function in Practical FP in Scala

Philip Schwarz PRO

September 24, 2023

Annual Pro sale · Save $30

Have presentations of your own?

Share with private links, password protection, and more control over your work.

Transcript

4 slides
  1. @typeclass trait Traverse[F[_]] extends Functor[F] with Foldable[F] with … …

    Thread all the G effects through the F structure to invert the structure from F[G[A]] to G[F[A]]. def sequence[G[_]: Applicative, A](fga: F[G[A]]): G[F[A]] = traverse(fga)(ga => ga) List[F[Unit]] => F[List[Unit]] case class CartRoutes[F[_]: JsonDecoder: Monad] Applicative Monad Functor Traverse Foldable

More Decks by Philip Schwarz

Other Decks in Programming