scala-fp

scala-fp

  • Book
  • GitHub

›Functional Programming

Book

  • Table of contents

Scala

  • Introduction
  • JVM
  • TODO

Functional Programming

  • Introduction
  • Advanced
  • Ecosystem
  • More

Other

  • Haskell
  • Math

Ecosystem

Cats

Resources

  • Cats (Documentation)
  • Cats Infographic
  • Scala with Cats by Noel Welsh and Dave Gurnell (Book)
  • Practical FP in Scala: A hands-on approach by Gabriel Volpe (Book)
  • TODO herding cats
  • ScalaFP: Firsthand With Scala-Cats
  • Scala Cats library for dummies
  • A comprehensive introduction to Cats-mtl
  • Law Enforcement using Discipline
  • Cats: Essential Type Class Hierarchy, Explained

ZIO

Resources

  • ZIO (Documentation)
  • Reimagining Functional Type Classes (video)
  • An intro to writing native DB driver in Scala
  • What's Ap with zio-prelude?

Examples

# run
sbt "ecosystem/runMain com.github.niqdev.zio.ExampleZIOApp"
sbt "ecosystem/runMain com.github.niqdev.zio.ExampleZLayerApp"

http4s

Resources

  • http4s (Documentation)
  • Pure functional HTTP APIs in Scala by Jens Grassel (Book)

Examples

TODO examples

  • JSON encoder/decoder with circe
  • integration with doobie
# run tests
sbt "test:testOnly *http4s*"

# start server
sbt "ecosystem/runMain com.github.niqdev.http4s.ExampleServer"

# verify endpoints
http :8080/hello/scala
http :8080/metrics

FS2

Resources

  • FS2 (Documentation)

Examples

# run tests
sbt "test:testOnly *fs2*"

Doobie

Resources

  • doobie (Documentation)
  • Pure Functional Database Programming with Fixpoint Types by Rob Norris (video)
  • Describing Data with free applicative functors by Kris Nuttycombe (video)

Examples

# run
sbt "ecosystem/runMain com.github.niqdev.doobie.ExampleH2"

shapeless

Resources

  • shapeless (Documentation)
  • The Type Astronaut's Guide to Shapeless by Dave Gurnell (Book)
  • Shapeless for Mortals (2015) by Sam Halliday (Talk)
  • First-class polymorphic function values in shapeless
  • Scala Tagged types
  • Scala's Modular Roots
  • Type classes and generic derivation
  • Automatic type-class derivation with Shapeless

Examples

# run tests
sbt "test:testOnly *shapeless*"

ScalaTest and ScalaCheck

Resources

  • ScalaTest (Documentation)
  • ScalaCheck (Documentation)
  • ScalaCheck User Guide
  • Practical ScalaCheck
  • ScalaCheck lesson
  • Code Examples
  • Using ScalaCheck to Verify Infinite Algebraic Structures

Examples

# run tests
sbt "test:testOnly *scalacheck*"

# auto derivation of ScalaCheck generators using Magnolia
sbt "ecosystem/test:runMain com.github.niqdev.scalacheck.RandomApp"

GraphQL

Resources

  • GraphQL (Documentation)
  • Specification
  • GraphQL Playground
  • The Fullstack Tutorial for GraphQL
  • Sangria
  • Building GraphQL API with Sangria by Oleg Ilyenko (Video)
  • GraphQL at Twitter
  • Caliban
  • Caliban: Designing a Functional GraphQL Library by Pierre Ricadat (Video)
  • GraphQL in Scala with Caliban
  • GraphiQL
    • graphiql-app (GUI)
    • graphiql (Docker)

Examples

# run
sbt "ecosystem/runMain com.github.niqdev.caliban.CalibanZIOApp"
sbt "ecosystem/runMain com.github.niqdev.caliban.CalibanCatsHttp4sApp"

# verify
http -v :8080/api/graphql query='{models{id}model(id:"model-8"){description,count,valid}}'

# run tests
sbt "test:testOnly *caliban*"

Droste

Resources

  • Droste (Documentation)
  • Recursion schemes fundamentals
  • Practical Droste [ code | video ] by Beni Villa
  • Recursion schemes with Higherkindness [ code | video ] by Oli Makhasoeva & Andy Scott
  • Peeling the Banana: Recursion Schemes from First Principles by Zainab Ali (video)
  • Recursion Schemes in Scala
  • Matryoshka
    • Matryoshka (Documentation)
    • Introduction to Recursion Schemes with Matryoshka
    • AST playground: recursion schemes and recursive data
    • matryoshka-examples-scala
    • Recursion Schemes Cookbook

Examples

# run tests
sbt "test:testOnly *droste*"

cats-retry

Resources

  • cats-retry (Documentation)

Examples

# run
sbt "ecosystem/runMain com.github.niqdev.retry.ExampleRetry"

More libraries

  • refined
  • Enumeratum
  • Monocle
    • Lens in scala
    • Example
  • circe
  • Ciris
← AdvancedMore →
  • Cats
    • Resources
  • ZIO
    • Resources
    • Examples
  • http4s
    • Resources
    • Examples
  • FS2
    • Resources
    • Examples
  • Doobie
    • Resources
    • Examples
  • shapeless
    • Resources
    • Examples
  • ScalaTest and ScalaCheck
    • Resources
    • Examples
  • GraphQL
    • Resources
    • Examples
  • Droste
    • Resources
    • Examples
  • cats-retry
    • Resources
    • Examples
  • More libraries
scala-fp
Contribute
How toGitHub
Copyright © 2022 niqdev