Module

Uncurried.Reader

Package
purescript-uncurried-transformers
Repository
PureFunctor/purescript-uncurried-transformers

This module defines the Reader monad.

#Reader Source

type Reader r = ReaderT r Identity

A type synonym for a ReaderT with Identity as its base monad.

#reader Source

reader :: forall r a. (r -> a) -> Reader r a

Construct a Reader given a function that requires some context.

#runReader Source

runReader :: forall r a. r -> Reader r a -> a

Runs a computation inside of Reader.

#mapReader Source

mapReader :: forall r a b. (a -> b) -> Reader r a -> Reader r b

Modifies the result type of a Reader.

#withReader Source

withReader :: forall r1 r2 a. (r2 -> r1) -> Reader r1 a -> Reader r2 a

Modifies the environment type of a Reader.