File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2727 " output" ,
2828 " test" ,
2929 " bower.json" ,
30- " gulpfile.js" ,
3130 " package.json"
3231 ],
3332 "dependencies" : {
33+ "purescript-distributive" : " ^0.5.0" ,
3434 "purescript-lazy" : " ^0.4.0" ,
3535 "purescript-tailrec" : " ^0.3.0" ,
3636 "purescript-unfoldable" : " ^0.4.0"
Original file line number Diff line number Diff line change @@ -6,10 +6,11 @@ import Prelude
66
77import Control.Alt
88import Control.Alternative
9- import Control.Plus
9+ import Control.Monad.Eff.Class
1010import Control.Monad.Trans
1111import Control.MonadPlus
12- import Control.Monad.Eff.Class
12+ import Control.Plus
13+ import Data.Distributive (Distributive , distribute , collect )
1314
1415-- | The reader monad transformer.
1516-- |
@@ -63,6 +64,10 @@ instance monadTransReaderT :: MonadTrans (ReaderT r) where
6364instance monadEffReader :: (Monad m , MonadEff eff m ) => MonadEff eff (ReaderT r m ) where
6465 liftEff = lift <<< liftEff
6566
67+ instance distributiveReaderT :: (Distributive g ) => Distributive (ReaderT e g ) where
68+ distribute a = ReaderT \e -> collect (flip runReaderT e) a
69+ collect f = distribute <<< map f
70+
6671liftReaderT :: forall r m a . m a -> ReaderT r m a
6772liftReaderT m = ReaderT (const m)
6873
You can’t perform that action at this time.
0 commit comments