[Haskell-beginners] \x -> x < 0.5 && x > -0.5

Darrin Thompson darrinth at gmail.com
Fri Oct 23 16:24:38 EDT 2009


On Fri, Oct 23, 2009 at 11:32 AM, Daniel Fischer
<daniel.is.fischer at web.de> wrote:
> It's because ((->) r) *is* the reader monad.
> Control.Monad.Reader's Reader r a is just that wrapped in a newtype:
>
> newtype Reader r a = Reader { runReader :: r -> a }
>

So I was thinking:

:t runReader $ liftM2 (&&) (Reader (< 0.5)) (Reader (> -0.5))

Thanks.

--
Darrin


More information about the Beginners mailing list