File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change 27
27
" output" ,
28
28
" test" ,
29
29
" bower.json" ,
30
- " gulpfile.js" ,
31
30
" package.json"
32
31
],
33
32
"dependencies" : {
33
+ "purescript-distributive" : " ^0.5.0" ,
34
34
"purescript-lazy" : " ^0.4.0" ,
35
35
"purescript-tailrec" : " ^0.3.0" ,
36
36
"purescript-unfoldable" : " ^0.4.0"
Original file line number Diff line number Diff line change @@ -6,10 +6,11 @@ import Prelude
6
6
7
7
import Control.Alt
8
8
import Control.Alternative
9
- import Control.Plus
9
+ import Control.Monad.Eff.Class
10
10
import Control.Monad.Trans
11
11
import Control.MonadPlus
12
- import Control.Monad.Eff.Class
12
+ import Control.Plus
13
+ import Data.Distributive (Distributive , distribute , collect )
13
14
14
15
-- | The reader monad transformer.
15
16
-- |
@@ -63,6 +64,10 @@ instance monadTransReaderT :: MonadTrans (ReaderT r) where
63
64
instance monadEffReader :: (Monad m , MonadEff eff m ) => MonadEff eff (ReaderT r m ) where
64
65
liftEff = lift <<< liftEff
65
66
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
+
66
71
liftReaderT :: forall r m a . m a -> ReaderT r m a
67
72
liftReaderT m = ReaderT (const m)
68
73
You can’t perform that action at this time.
0 commit comments