O'Reilly logo

Haskell Cookbook by Yogesh Sajanikar

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Working with Applicatives

An Applicative is a type class that is somewhere between a Functor and a Monad. An Applicative takes a Functor one step further. A Functor talks about application of a function a -> b to a data type f a, whereas an Applicative talks about application of a data type of a function f (a -> b) to a data type f a.

In this recipe, we will work with Maybe and Either data types, and see how we can work with Applicative instances in the context of these data types.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required