Skip to content

[solutions] learn-by-doing course/tutorial for functional programming on scala

License

Notifications You must be signed in to change notification settings

spavikevik/solutions-learn-fp

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Learn Functional Programming course/tutorial on Scala

Solutions by @spavikevik.

Type classes

Monoids

  • Observe general monoid pattern in learnfp/monoid/Monoid.scala
  • Implement learn-fp/src/main/scala/learnfp/monoid/ListMonoid.scala
  • Implement learn-fp/src/main/scala/learnfp/monoid/SimpleMonoid.scala
  • Implement learnfp/monoid/PairAdditiveMonoid.scala
  • Extra material:
    • Bartosz Milewski: Category Theory 3.1: Examples of categories, orders, monoids

Functors

Monads

  • Observe general monad pattern in learnfp/monad/Monad.scala
  • Implement learnfp/monad/Id.scala
  • Implement learnfp/monad/Maybe.scala
  • Implement learnfp/monad/List.scala
  • Implement learnfp/monad/Disjunction.scala
  • Implement learnfp/monad/Writer.scala
  • Implement learnfp/monad/State.scala
  • Extra material

Foldable

  • Implement foldable in learnfp/foldable/Foldable.scala

Applicatives

Traversable

  • Implement learnfp/traversable/Traversable.scala

Nested

  • Implement learnfp/nested/Nested.scala

IO

  • Implement learnfp/nested/IO.scala

Monad Transformers

  • Observe general monad transformer typeclass in learnfp/transformer/MonadTransformer.scala
  • Implement learnfp/transformer/IdT.scala
  • Implement learnfp/transformer/MaybeT.scala
  • Implement learnfp/transformer/WriterT.scala
  • Implement learnfp/transformer/StateT.scala
  • Extra material:

Free monad

Contravariant functor

  • Observe general contravariant functor pattern in learnfp/contravariant/ContravariantFunctor.scala
  • Implement learnfp/contravariant/Show.scala
  • Implement learnfp/contravariant/Predicate.scala

CoMonads

  • Observe general comonad pattern in learnfp/comonad/CoMonad.scala
  • Implement learnfp/comonad/Id.scala
  • Implement learnfp/comonad/Env.scala

Bonus

  • Implement Reader functor, monad, applicative and write unit tests for that
  • Implement ReaderT and write unit tests for that
  • Implement applicative for monad transformers
  • Implement applicative for Free

Credits

About

[solutions] learn-by-doing course/tutorial for functional programming on scala

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Scala 100.0%