Sign in Go Pro

Functional programming in Kotlin with Arrow

Dependency Injection with the Reader

This lesson is for PRO members.

Upgrade today to get access to all the PRO lessons.

Unlock this lesson

Up next



Dependency Injection is needed on any app, since you must be able to replace collaborators for your classes at testing time by using test doubles. Arrow provides the Reader to solve this concern. On this lesson, you will learn interesting things like:

  • The Reader data type for Dependency Injection.
  • Why standard Dependency Injection frameworks are not useful if you are going for pure Functional Programming.
  • What's the Reader context.
  • How the Reader allows you to start the call stack whenever you want and is able to implicitly pass in the dependencies automatically at that moment in time, and not before.
  • The similarities on the Reader's context and the usual Dependency Injection scopes in Android.
  • Which dependencies should be abstracted and how to do it with the Reader.
  • The ability to swap them by test doubles on your tests thanks to the Reader.


There are no comments on this lesson, start the conversation below ...


Lessons in Functional programming in Kotlin with Arrow