Skip to content

Commit 878ce25

Browse files
committed
Updates for 0.11.1
1 parent c8dc23e commit 878ce25

File tree

4 files changed

+40
-15
lines changed

4 files changed

+40
-15
lines changed

.travis.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,21 @@
11
language: node_js
22
dist: trusty
33
sudo: required
4-
node_js: 6
4+
node_js: stable
5+
env:
6+
- PATH=$HOME/purescript:$PATH
57
install:
8+
- TAG=$(wget -q -O - https://github.com/purescript/purescript/releases/latest --server-response --max-redirect 0 2>&1 | sed -n -e 's/.*Location:.*tag\///p')
9+
- wget -O $HOME/purescript.tar.gz https://github.com/purescript/purescript/releases/download/$TAG/linux64.tar.gz
10+
- tar -xvf $HOME/purescript.tar.gz -C $HOME/
11+
- chmod a+x $HOME/purescript
612
- npm install -g bower
713
- npm install
814
- bower install
915
script:
1016
- npm run -s build
1117
after_success:
12-
- >-
13-
test $TRAVIS_TAG &&
14-
echo $GITHUB_TOKEN | pulp login &&
15-
echo y | pulp publish --no-push
18+
- >-
19+
test $TRAVIS_TAG &&
20+
echo $GITHUB_TOKEN | pulp login &&
21+
echo y | pulp publish --no-push

bower.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"purescript-control": "^3.0.0",
2020
"purescript-tailrec": "^3.0.0",
2121
"purescript-transformers": "^3.0.0",
22-
"purescript-exists": "^3.0.0"
22+
"purescript-exists": "^3.0.0",
23+
"purescript-eff": "^3.0.0"
2324
}
2425
}

package.json

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@
22
"private": true,
33
"scripts": {
44
"clean": "rimraf output && rimraf .pulp-cache",
5-
"build": "pulp build -- --censor-lib --strict"
5+
"build": "jshint src && jscs src && pulp build --censor-lib --strict",
6+
"test": "pulp test"
67
},
78
"devDependencies": {
8-
"pulp": "^10.0.1",
9-
"purescript-psa": "^0.5.0",
10-
"purescript": "^0.11.1",
11-
"rimraf": "^2.5.4"
9+
"jscs": "^2.8.0",
10+
"jshint": "^2.9.1",
11+
"pulp": "^10.0.4",
12+
"purescript-psa": "^0.3.9",
13+
"rimraf": "^2.5.0"
1214
}
1315
}

src/Control/Monad/Free/Trans.purs

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,19 @@ module Control.Monad.Free.Trans
1313

1414
import Prelude
1515

16+
import Control.Apply (lift2)
17+
import Control.Monad.Eff.Class (class MonadEff, liftEff)
18+
import Control.Monad.Error.Class (class MonadThrow, throwError)
19+
import Control.Monad.Reader.Class (class MonadAsk, ask)
20+
import Control.Monad.Rec.Class (class MonadRec, Step(..), tailRecM)
21+
import Control.Monad.State.Class (class MonadState, state)
22+
import Control.Monad.Trans.Class (class MonadTrans, lift)
23+
import Control.Monad.Writer.Class (class MonadTell, tell)
1624
import Data.Bifunctor (bimap)
1725
import Data.Either (Either(..))
1826
import Data.Exists (Exists, mkExists, runExists)
1927
import Data.Monoid (class Monoid, mempty)
2028

21-
import Control.Apply (lift2)
22-
import Control.Monad.Rec.Class (class MonadRec, Step(..), tailRecM)
23-
import Control.Monad.Trans.Class (class MonadTrans)
24-
2529
-- | Instead of implementing `bind` directly, we capture the bind using this data structure, to
2630
-- | evaluate later.
2731
data Bound f m b a = Bound (Unit -> FreeT f m a) (a -> FreeT f m b)
@@ -84,6 +88,18 @@ instance semigroupFreeT :: (Functor f, Monad m, Semigroup w) => Semigroup (FreeT
8488
instance monoidFreeT :: (Functor f, Monad m, Monoid w) => Monoid (FreeT f m w) where
8589
mempty = pure mempty
8690

91+
instance monadEffFreeT :: (Functor f, MonadEff eff m) => MonadEff eff (FreeT f m) where
92+
liftEff = lift <<< liftEff
93+
94+
instance monadAskFreeT :: (Functor f, MonadAsk r m) => MonadAsk r (FreeT f m) where
95+
ask = lift ask
96+
97+
instance monadTellFreeT :: (Functor f, MonadTell w m) => MonadTell w (FreeT f m) where
98+
tell = lift <<< tell
99+
100+
instance monadThrowFreeT :: (Functor f, MonadThrow e m) => MonadThrow e (FreeT f m) where
101+
throwError = lift <<< throwError
102+
87103
-- | Lift an action from the functor `f` to a `FreeT` action.
88104
liftFreeT :: forall f m a. Functor f => Monad m => f a -> FreeT f m a
89105
liftFreeT fa = FreeT \_ -> pure (Right (map pure fa))

0 commit comments

Comments
 (0)