├── .scalafmt.conf ├── project ├── build.properties └── plugins.sbt ├── docs ├── concurrency-thread-pools.png ├── typeclasses-cheat-sheet.jpeg ├── typeclasses-cheat-sheet.png └── index.html ├── slides └── mdoc │ ├── concurrency-thread-pools.png │ ├── typeclasses-cheat-sheet.jpeg │ └── index.html ├── core └── src │ └── main │ └── scala │ └── daenyth │ └── talk │ └── ce │ ├── Foo.scala │ └── MdocConsoleWorkaround.scala ├── .gitignore └── README.md /.scalafmt.conf: -------------------------------------------------------------------------------- 1 | version = "2.0.1" 2 | -------------------------------------------------------------------------------- /project/build.properties: -------------------------------------------------------------------------------- 1 | sbt.version=1.5.5 2 | -------------------------------------------------------------------------------- /project/plugins.sbt: -------------------------------------------------------------------------------- 1 | addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.2.22") -------------------------------------------------------------------------------- /docs/concurrency-thread-pools.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Daenyth/intro-cats-effect/HEAD/docs/concurrency-thread-pools.png -------------------------------------------------------------------------------- /docs/typeclasses-cheat-sheet.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Daenyth/intro-cats-effect/HEAD/docs/typeclasses-cheat-sheet.jpeg -------------------------------------------------------------------------------- /docs/typeclasses-cheat-sheet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Daenyth/intro-cats-effect/HEAD/docs/typeclasses-cheat-sheet.png -------------------------------------------------------------------------------- /slides/mdoc/concurrency-thread-pools.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Daenyth/intro-cats-effect/HEAD/slides/mdoc/concurrency-thread-pools.png -------------------------------------------------------------------------------- /slides/mdoc/typeclasses-cheat-sheet.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Daenyth/intro-cats-effect/HEAD/slides/mdoc/typeclasses-cheat-sheet.jpeg -------------------------------------------------------------------------------- /core/src/main/scala/daenyth/talk/ce/Foo.scala: -------------------------------------------------------------------------------- 1 | package daenyth.talk.ce 2 | 3 | sealed trait Foo extends Product with Serializable 4 | 5 | object Foo { 6 | case class FooInt(i: Int) extends Foo 7 | case class FooString(s: String) extends Foo 8 | } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## IntelliJ files to ignore 2 | *.iml 3 | *.iws 4 | *.ipr 5 | .idea 6 | .idea/* 7 | 8 | ## NetBeans files to ignore 9 | .*_nb 10 | 11 | # bench output 12 | *.csv 13 | 14 | ## scala specific files to ignore 15 | *.class 16 | target/ 17 | project/project/ 18 | _site/ 19 | 20 | .metals/ 21 | .bloop/ 22 | project/.bloop/ 23 | .bsp/ 24 | -------------------------------------------------------------------------------- /core/src/main/scala/daenyth/talk/ce/MdocConsoleWorkaround.scala: -------------------------------------------------------------------------------- 1 | package daenyth.talk.ce 2 | 3 | import cats.effect.IO 4 | 5 | import cats.effect.unsafe.implicits.global 6 | 7 | object MdocConsoleWorkaround { 8 | implicit class IOOps[A](fa: IO[A]) { 9 | def unsafeRunSyncWithRedirect(): A = { 10 | val oldOut = System.out 11 | val newOut = Console.out // important to do this on the calling thread! 12 | try { 13 | System.setOut(newOut) 14 | fa.unsafeRunSync() 15 | } finally System.setOut(oldOut) 16 | } 17 | } 18 | } 19 | 20 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Intro to Cats-Effect 2 | 3 | Cats Effect is a functional side effect library - I'll explain what that means, what it gives you, how to use it, and why you should care. 4 | 5 | At Teikametrics we adopted this library in 2018, and I'll discuss how we approach application design using it, both from a green field perspective as well as the techniques we used to migrate a living codebase away from akka-streams without "the big rewrite". 6 | 7 | ## Slides 8 | 9 | [Available online](https://daenyth.github.io/intro-cats-effect/) 10 | 11 | ## Video recording 12 | 13 | The current version for Cats-Effect 3 is [on Vimeo](https://vimeo.com/586829749) 14 | 15 | The older version for Cats-Effect 2 is [on YouTube](https://www.youtube.com/watch?v=83pXEdCpY4A) 16 | 17 | ## Building 18 | 19 | Code in `core` module is accessible in your slides 20 | 21 | Raw slides are in `slides/tut/index.html` 22 | 23 | ### How to compile slides 24 | 25 | run `sbt slides/mdoc` to compile slides using [mdoc][mdoc]. 26 | You can then view the slides by opening `docs/index.html` in your browser. 27 | 28 | ### How to publish slides with github 29 | 30 | When you are ready push the repository to github (including the compiled slides in `docs`). 31 | Then go to project settings -> GitHub Pages and select `master branch /docs folder` for 32 | the source of github pages. 33 | 34 | 35 | 36 | This project was generated using [Giter8][g8] with template [presentation.g8][presentation.g8] 37 | 38 | 39 | [g8]: http://www.foundweekends.org/giter8/ 40 | [presentation.g8]: https://github.com/julien-truffaut/presentation.g8 41 | [mdoc]: https://scalameta.org/mdoc/ 42 | -------------------------------------------------------------------------------- /slides/mdoc/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Intro to Cats-Effect 6 | 7 | 39 | 40 | 41 | 42 | 656 | 658 | 661 | 662 | 663 | -------------------------------------------------------------------------------- /docs/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Intro to Cats-Effect 6 | 7 | 39 | 40 | 41 | 42 | 674 | 676 | 679 | 680 | 681 | --------------------------------------------------------------------------------