Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to v0.15.0 #142

Merged
merged 7 commits into from
Mar 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ jobs:
- uses: actions/checkout@v2

- uses: purescript-contrib/setup-purescript@main
with:
purescript: "unstable"

- uses: actions/setup-node@v1
with:
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Notable changes to this project are documented in this file. The format is based
## [Unreleased]

Breaking changes:
- Update project and deps to PureScript v0.15.0 (#142 by @JordanMartinez)

New features:
- Add `Foldable`, `FoldableWithIndex`, and `Traversable` instances for `EnvT` (#113 by @abaco)
Expand Down
32 changes: 16 additions & 16 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,23 @@
"package.json"
],
"dependencies": {
"purescript-control": "^5.0.0",
"purescript-distributive": "^5.0.0",
"purescript-effect": "^3.0.0",
"purescript-either": "^5.0.0",
"purescript-exceptions": "^5.0.0",
"purescript-foldable-traversable": "^5.0.0",
"purescript-identity": "^5.0.0",
"purescript-lazy": "^5.0.0",
"purescript-maybe": "^5.0.0",
"purescript-newtype": "^4.0.0",
"purescript-prelude": "^5.0.0",
"purescript-tailrec": "^5.0.0",
"purescript-tuples": "^6.0.0",
"purescript-unfoldable": "^5.0.0"
"purescript-control": "master",
"purescript-distributive": "master",
"purescript-effect": "master",
"purescript-either": "master",
"purescript-exceptions": "master",
"purescript-foldable-traversable": "master",
"purescript-identity": "master",
"purescript-lazy": "master",
"purescript-maybe": "master",
"purescript-newtype": "master",
"purescript-prelude": "master",
"purescript-tailrec": "master",
"purescript-tuples": "master",
"purescript-unfoldable": "master"
},
"devDependencies": {
"purescript-arrays": "^6.0.0",
"purescript-console": "^5.0.0"
"purescript-arrays": "master",
"purescript-console": "master"
}
}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"test": "pulp test"
},
"devDependencies": {
"pulp": "^15.0.0",
"purescript-psa": "^0.8.0",
"pulp": "16.0.0-0",
"purescript-psa": "^0.8.2",
"rimraf": "^3.0.2"
}
}
4 changes: 2 additions & 2 deletions src/Control/Monad/Except/Trans.purs
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ instance monadExceptT :: Monad m => Monad (ExceptT e m)

instance monadRecExceptT :: MonadRec m => MonadRec (ExceptT e m) where
tailRecM f = ExceptT <<< tailRecM \a ->
case f a of ExceptT m ->
m >>= \m' ->
case f a of
ExceptT m -> m >>= \m' ->
pure case m' of
Left e -> Done (Left e)
Right (Loop a1) -> Loop a1
Expand Down
4 changes: 2 additions & 2 deletions src/Control/Monad/Maybe/Trans.purs
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ instance monadZeroMaybeT :: Monad m => MonadZero (MaybeT m)
instance monadRecMaybeT :: MonadRec m => MonadRec (MaybeT m) where
tailRecM f =
MaybeT <<< tailRecM \a ->
case f a of MaybeT m ->
m >>= \m' ->
case f a of
MaybeT m -> m >>= \m' ->
pure case m' of
Nothing -> Done Nothing
Just (Loop a1) -> Loop a1
Expand Down
8 changes: 4 additions & 4 deletions src/Control/Monad/RWS/Trans.purs
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,12 @@ instance monadTellRWST :: (Monad m, Monoid w) => MonadTell w (RWST r w s m) wher

instance monadWriterRWST :: (Monad m, Monoid w) => MonadWriter w (RWST r w s m) where
listen m = RWST \r s ->
case m of RWST m' ->
m' r s >>= \(RWSResult s' a w) ->
case m of
RWST m' -> m' r s >>= \(RWSResult s' a w) ->
pure $ RWSResult s' (Tuple a w) w
pass m = RWST \r s ->
case m of RWST m' ->
m' r s >>= \(RWSResult s' (Tuple a f) w) ->
case m of
RWST m' -> m' r s >>= \(RWSResult s' (Tuple a f) w) ->
pure $ RWSResult s' a (f w)

instance monadThrowRWST :: (MonadThrow e m, Monoid w) => MonadThrow e (RWST r w s m) where
Expand Down
4 changes: 2 additions & 2 deletions src/Control/Monad/State/Trans.purs
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ instance monadRecStateT :: MonadRec m => MonadRec (StateT s m) where
tailRecM f a = StateT \s -> tailRecM f' (Tuple a s)
where
f' (Tuple a' s) =
case f a' of StateT st ->
st s >>= \(Tuple m s1) ->
case f a' of
StateT st -> st s >>= \(Tuple m s1) ->
pure case m of
Loop x -> Loop (Tuple x s1)
Done y -> Done (Tuple y s1)
Expand Down
4 changes: 2 additions & 2 deletions src/Control/Monad/Writer/Trans.purs
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ instance monadRecWriterT :: (Monoid w, MonadRec m) => MonadRec (WriterT w m) whe
tailRecM f a = WriterT $ tailRecM f' (Tuple a mempty)
where
f' (Tuple a' w) =
case f a' of WriterT wt ->
wt >>= \(Tuple m w1) ->
case f a' of
WriterT wt -> wt >>= \(Tuple m w1) ->
pure case m of
Loop x -> Loop (Tuple x (w <> w1))
Done y -> Done (Tuple y (w <> w1))
Expand Down
4 changes: 2 additions & 2 deletions test/Example/RWS.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// module Example.RWS

exports.t = function(){
export function t() {
return new Date().valueOf();
};
}
4 changes: 2 additions & 2 deletions test/Example/RWS.purs
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ loopState n = tailRecM go n
main :: Effect Unit
main = do
t1 <- t
res1 <- pure $ unwrap (runRWST (loop 1000000) "" 0)
_ <- pure $ unwrap (runRWST (loop 1000000) "" 0)
t2 <- t
log $ "RWST: " <> show (t2 - t1)
t3 <- t
res2 <- pure $ execState (loopState 1000000) 0
_ <- pure $ execState (loopState 1000000) 0
t4 <- t
log $ "StateT: " <> show (t4 - t3)

Expand Down