Scala Cats and Cats-Effect 3.x

Tijdsduur

Scala Cats and Cats-Effect 3.x

EDC4IT Europe BV
Logo van EDC4IT Europe BV

Tip: meer info over het programma, prijs, en inschrijven? Download de brochure!

Startdata en plaatsen

Er zijn nog geen startdata bekend voor dit product.

Beschrijving

Course Overview

With this course we will be covering a range of topics that will give you a solid grounding in Scala Cats and Cats-Effect 3. Not only will you receive an introduction to Category Theory, Cats, Cats Effects, but we will also go through Tagless Final Encoding to give you a well-rounded overview. This course has been designed to give you as comprehensive an introduction as possible while still leaving time and space for questions and discussion.

Course Prerequisites

Students should be familiar with the Scala programming language (preferable version 3). You should in particular be familiar with aspects such as type-classes and context bounds. It is a great course for student p…

Lees de volledige beschrijving

Veelgestelde vragen

Er zijn nog geen veelgestelde vragen over dit product. Als je een vraag hebt, neem dan contact op met onze klantenservice.

Nog niet gevonden wat je zocht? Bekijk deze onderwerpen: Scala, Programmeren (algemeen), Java, OO (Object Oriented) Programmeren en Ruby.

Course Overview

With this course we will be covering a range of topics that will give you a solid grounding in Scala Cats and Cats-Effect 3. Not only will you receive an introduction to Category Theory, Cats, Cats Effects, but we will also go through Tagless Final Encoding to give you a well-rounded overview. This course has been designed to give you as comprehensive an introduction as possible while still leaving time and space for questions and discussion.

Course Prerequisites

Students should be familiar with the Scala programming language (preferable version 3). You should in particular be familiar with aspects such as type-classes and context bounds. It is a great course for student preparing to use Scala libraries such as fs2, http4s, ZIO, akka etc

Outline

Scala Recap (if needed)

  • Type constructors
  • Higher-kinded types
  • Type classes in Scala
  • Context bounds

Introduction to Cats

  • Understand the scope and intent of Cats
  • Explain the structure of the library
  • List cats modules
  • Various import approaches
  • List and discuss related projects
  • Using a cats Type class
  • Defining your own instance
  • Discuss ID Operations
  • List various small enhancements to Scala (e.g, for Either/Option)
  • Introduce Monoids and Semigroups

Overview of Category Theory

  • Introduce Category Theory for Developers
  • What is a category
  • Understand objects and morphisms
  • Define composition and associativity
  • Introduce the identity arrow
  • Introduce the term Hom-Set
  • Discuss Example Categories (0 , 1, 2, Monoid, Set)
  • Understand the category of types and functions
  • Discuss and implement Kleisli as an example
  • Initial and Terminal Objects
  • Discuss the concept of Universal Construction
  • Discuss and implement Product Types
  • Introduce natural transformations

Cats Functors, Applicatives, Traverse and Monads

Functors

  • Introduce Functors in terms of Categories
  • Use Endofunctors in Programming
  • Introduce the functor laws
  • Introduce the Cats Functor Type class
  • Using derived methods (liftas, …)
  • Introduce Natural Transformations
  • Understand FunctionK
  • Combing Functors using the Nested type
  • Introduce Bifunctors
  • Using bifunctors with ADTs

Applicatives and Traverse

  • Introduce the Applicative functor
  • compose independent effects
  • Using product/tuple functions
  • Using mapN functions
  • Replicating Applicatives
  • Composing Applicatives
  • Introduce Traverse
  • Using Traverse sequence

Monads

  • Recap Kleisli
  • Introduce Monads
  • Introduce the monad laws
  • composing dependent effects using Monads
  • Writing tail-recursive Monads

Cats Core Data Types

Validated

  • Using Validated to accumulate errors
  • Understand the role of sequence
  • Using the Chain and NonEmptyChain

Parallel

  • Understand the need to Parallel
  • Recap FunctionK and Natural Transformations
  • Using parallel operations on Monads (e.g, parProductparSequence etc)

Eval

  • Using Eval to control synchronous evaluation
  • Understand the concept of trampolining
  • Understand the concepts of now, later, always
  • Using defer to lift a value into 'Eval'

Monad Transformers

  • Understand the role of Monad Transformers
  • Composing Monads using Transformers
  • Use transformers to stack effects
  • List bundled transformers (OptionTEitherT, ..)
  • Caveats and alternatives

Reader, Writer and State Monads

  • Turning functions into monads using Reader
  • Use the Reader for implicit contextual objects (e.g, configuration)
  • Using the Reader for dependency injection (with effect tracking)
  • Using ReaderT to stack other effects
  • Understand the relation between ReaderKleisli nad the identity monad
  • Introduce the Writer monad
  • Using the writer for audit trails

Raising and Handling Errors

  • Introduce the ApplicativeError and MonadError
  • Raising errors
  • Handling errors
  • Transforming errors (e.g, to Either)
  • Using an error-tap

Dealing with Side Effects (Cats Effect)

  • What are effects?
  • Challenges with effects and Functional Programming
  • Side effects and Referential Transparency
  • Introduce Cats Effect
  • Understand the relation with Cats

Introduce the IO Monad

  • Introduce the IO Monad reference implementation
  • Trampolining and IO
  • Understand the different execution styles (pure, lazy, async)
  • Introduce Fibers
  • Understand non-preemptive multitasking
  • Understand the problems with JVM Threads and Concurrency
  • Introduce green-threads and fibers
  • Discuss best practices for application thread-pools
  • Introduce the IOApp and IOApp.Simple

The Effect Type Classes

  • Provide an overview of the Cats effect type classes (MonadCancelSpawnConcurrentSyncAsync etc )
  • List and introduce the other type classes (e.g, UniqueFClockF, …)
  • Using ConsoleF from the cats effect standard library
  • Writing polymorphic code using context bounds
  • Discuss logging (log4cats)

Cancellation (MonadCancelF)

  • Recap MonadError
  • Understand the concept of fiber cancellation
  • Apply masking using uncancelable
  • Appreciate the concept of *polling
  • Introduce the Bracket use case
  • Understand nested brackets

Resource (Data type)

  • Introduce and use the Resource type
  • Building Resources
  • Composing Resources

SyncF

  • Recap the type-classes on which Sync[F] is based
  • Suspending effects
  • Suspending blocking effects
  • Building cancable blocking effects
  • Understand context shifting

Suspending Fibers (TemporalF)

  • Understand the concept of semantic blocking
  • Using combinators such as sleepdelayBy etc
  • Using alternative effects in time-outs

Fibers (SpawnF)

  • Recap Fibers
  • Creating fiber using Spawn[F]
  • Understand the Spawn[F] algebra
  • Joining multiple fibers
  • Cancelling fibers
  • Understand the Fiber OutCome
  • Race multiple fibers
  • Appreciate the Parallel implementation for Spawn[F]
  • Recap Parallel[F]
  • Using Parallel[F] with Spawn[F] (parMapparTraverse, etc)

Concurrent State (ConcurrentF)

  • Introduce the Concurrent[F] type-class
  • Using Ref to share mutable state between fibers
  • Understand Ref and the benefits over traditional locking
  • Appreciate atomic updates to the Ref
  • Using Deferred communicate between fibers
  • Understand the difference between Ref and Deferred
  • Discuss various scenario's for using the constructs
  • Memoization effects using Concurrent[F]
  • Using bounded versions of Parellel operations (e.g, parReplicateANparTraverseN etc)

Asynchronous Effects (AsyncF)

  • Introduce the Async[F] type-class
  • using callbacks for asynchronous code
  • Add cancellation and finalization to asynchronous code
  • Integrate with legacy Futures and CancelableFuture
  • Understand context shifting
  • Shifting between thread pools

Tagless Final

  • Understand the theory behind TF
  • Discuss Initial vs Final encoding
  • Appreciate Tagged vs Tagless
  • Encode your algebra using TF
  • Discuss laws
  • Using TF with Cats/ Cats Effect
  • Discuss various Encoding styles (functions, modules, traits etc)

Welkom bij EDC4IT: Uw Innovatiehub voor IT-Training

Ontdek de kracht van onze interactieve Open Source Technologieën, DevOps en Infrastructuur cursussen:

  • Praktisch & Toepasbaar: Cursusmateriaal dat direct impact maakt in uw werk.
  • Persoonlijke Groei: On-the-job coaching en gepersonaliseerde consultancy.
  • Deskundige Trainers: Leer van de besten, met state-of-the-art materiaal.
  • Voorop in IT: Blijf vooruit met onze actuele en innovatieve aanpak.

Zet Nu de Stap met EDC4IT – Vergroot uw vaardigheden, versnel uw carrière.

Blijf op de hoogte van nieuwe ervaringen

Er zijn nog geen ervaringen.
  • Vraag informatie aan over deze training. Je ontvangt vanaf dan ook een seintje wanneer iemand een ervaring deelt. Handige manier om jezelf eraan te herinneren dat je wilt blijven leren!
  • Bekijk gerelateerde producten mét ervaringen: Scala.

Deel je ervaring

Heb je ervaring met deze cursus? Deel je ervaring en help anderen kiezen. Als dank voor de moeite doneert Springest € 1,- aan Stichting Edukans.

Er zijn nog geen veelgestelde vragen over dit product. Als je een vraag hebt, neem dan contact op met onze klantenservice.

Vraag nu gratis en vrijblijvend informatie aan:

(optioneel)
(optioneel)
(optioneel)
(optioneel)
(optioneel)