[Haskell-cafe] Help with triple stack monad

Daniel Bergey bergey at teallabs.org
Wed Jun 22 11:08:36 UTC 2016


On 2016-06-21 at 21:12, Christopher Howard <ch.howard at zoho.com> wrote:
> This doesn't seem to work for me, but I'm using 7.6.3 from Debian
> Jessie. I'm curious what the difference is. What extensions and modules
> do you import? I get error

That's very interesting.  Here's my full code.  I needed to add the
`Control.Applicative` import for GHC-7.6.  In GHC-7.10, Applicative is
in Prelude.

{-# LANGUAGE GeneralizedNewtypeDeriving #-}

module Test where

import           Control.Applicative
import           Control.Monad.Random
import           Control.Monad.Reader
import           Control.Monad.State.Lazy

newtype ReaderStateRandom r s g a = RSR {
  rSR :: ReaderT r (StateT s (Rand g)) a
  } deriving (Functor, Applicative, Monad, MonadReader r, MonadState s, MonadRandom)


More information about the Haskell-Cafe mailing list