Skip to content

Commit 003779d

Browse files
authored
Merge pull request #76 from jqyu/bump
Bumps dependencies for 2.0 release [WIP]
2 parents 91745ac + ed70a65 commit 003779d

File tree

25 files changed

+91
-74
lines changed

25 files changed

+91
-74
lines changed

bower.json

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,26 @@
2424
"package.json"
2525
],
2626
"dependencies": {
27-
"purescript-arrays": "^1.0.0",
28-
"purescript-distributive": "^1.0.0",
29-
"purescript-lazy": "^1.0.0",
30-
"purescript-tailrec": "^1.0.0",
31-
"purescript-unfoldable": "^1.0.0"
27+
"purescript-arrays": "^1.1.0",
28+
"purescript-lazy": "^2.0.0",
29+
"purescript-tailrec": "^2.0.0",
30+
"purescript-unfoldable": "^1.1.0",
31+
"purescript-distributive": "bump",
32+
"purescript-tuples": "^3.0.0"
3233
},
3334
"devDependencies": {
34-
"purescript-console": "^1.0.0"
35+
"purescript-console": "^2.0.0"
36+
},
37+
"resolutions": {
38+
"purescript-tuples": "^3.0.0",
39+
"purescript-monoid": "^2.0.0",
40+
"purescript-foldable-traversable": "^2.0.0",
41+
"purescript-st": "^2.0.0",
42+
"purescript-eff": "^2.0.0",
43+
"purescript-control": "^2.0.0",
44+
"purescript-bifunctors": "^2.0.0",
45+
"purescript-invariant": "^2.0.0",
46+
"purescript-maybe": "^2.0.0",
47+
"purescript-prelude": "^2.1.0"
3548
}
3649
}

src/Control/Comonad/Env.purs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ import Prelude
1515
import Control.Comonad.Env.Class (class ComonadEnv, ask, asks, local)
1616
import Control.Comonad.Env.Trans (EnvT(..), mapEnvT, runEnvT, withEnvT)
1717

18-
import Data.Identity (Identity(..), runIdentity)
18+
import Data.Identity (Identity(..))
19+
import Data.Newtype (unwrap)
1920
import Data.Tuple (Tuple(..))
2021

2122
-- | The `Env` comonad is a synonym for the `EnvT` comonad transformer, applied
@@ -24,7 +25,7 @@ type Env e = EnvT e Identity
2425

2526
-- | Unwrap a value in the `Env` comonad.
2627
runEnv :: forall e a. Env e a -> Tuple e a
27-
runEnv (EnvT x) = runIdentity <$> x
28+
runEnv (EnvT x) = unwrap <$> x
2829

2930
-- | Change the environment type in an `Env` computation.
3031
withEnv :: forall e1 e2 a. (e1 -> e2) -> Env e1 a -> Env e2 a

src/Control/Comonad/Env/Class.purs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import Data.Tuple (Tuple(..), fst)
2020
-- | - `ask (local f x) = f (ask x)`
2121
-- | - `extract (local _ x) = extract a`
2222
-- | - `extend g (local f x) = extend (g <<< local f) x`
23-
class Comonad w <= ComonadEnv e w where
23+
class Comonad w <= ComonadEnv e w | w -> e where
2424
ask :: forall a. w a -> e
2525
local :: forall a. (e -> e) -> w a -> w a
2626

src/Control/Comonad/Store.purs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ import Prelude
1313
import Control.Comonad.Store.Class (class ComonadStore, experiment, peek, peeks, pos, seek, seeks)
1414
import Control.Comonad.Store.Trans (StoreT(..), runStoreT)
1515

16-
import Data.Identity (Identity(..), runIdentity)
16+
import Data.Identity (Identity(..))
17+
import Data.Newtype (unwrap)
1718
import Data.Tuple (Tuple(..), swap)
1819

1920
-- | The `Store` comonad is a synonym for the `StoreT` comonad transformer, applied
@@ -22,7 +23,7 @@ type Store s a = StoreT s Identity a
2223

2324
-- | Unwrap a value in the `Store` comonad.
2425
runStore :: forall s a. Store s a -> Tuple (s -> a) s
25-
runStore (StoreT s) = swap (runIdentity <$> swap s)
26+
runStore (StoreT s) = swap (unwrap <$> swap s)
2627

2728
-- | Create a value in context in the `Store` comonad.
2829
store :: forall s a. (s -> a) -> s -> Store s a

src/Control/Comonad/Store/Class.purs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import Data.Tuple (Tuple(..))
2929
-- | blur :: forall w. (ComonadStore Number w) -> w Number -> w Number
3030
-- | blur = extend \r -> (peeks (\n -> n - 1) r + peeks (\n -> n + 1) r) / 2)
3131
-- | ```
32-
class Comonad w <= ComonadStore s w where
32+
class Comonad w <= ComonadStore s w | w -> s where
3333
pos :: forall a. w a -> s
3434
peek :: forall a. s -> w a -> a
3535

src/Control/Comonad/Traced.purs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,16 @@ import Prelude
1313
import Control.Comonad.Traced.Class (class ComonadTraced, censor, listen, listens, track, tracks)
1414
import Control.Comonad.Traced.Trans (TracedT(..), runTracedT)
1515

16-
import Data.Identity (Identity(..), runIdentity)
16+
import Data.Identity (Identity(..))
17+
import Data.Newtype (unwrap)
1718

1819
-- | The `Traced` comonad is a synonym for the `TracedT` comonad transformer, applied
1920
-- | to the `Identity` monad.
2021
type Traced m = TracedT m Identity
2122

2223
-- | Unwrap a value in the `Traced` comonad.
2324
runTraced :: forall m a. Traced m a -> m -> a
24-
runTraced (TracedT t) = runIdentity t
25+
runTraced (TracedT t) = unwrap t
2526

2627
-- | Create a value in context in the `Traced` comonad.
2728
traced :: forall m a. (m -> a) -> Traced m a

src/Control/Comonad/Traced/Class.purs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import Data.Tuple (Tuple(..))
2828
-- | blur :: forall w. (ComonadTraced (Additive Number) w) -> w Number -> w Number
2929
-- | blur = extend \r -> (track (Additive (-1)) r + track (Additive 1) r) / 2
3030
-- | ```
31-
class Comonad w <= ComonadTraced t w where
31+
class Comonad w <= ComonadTraced t w | w -> t where
3232
track :: forall a. t -> w a -> a
3333

3434
-- | Extracts a value at a relative position which depends on the current value.

src/Control/Monad/Cont.purs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,24 +13,25 @@ import Prelude
1313
import Control.Monad.Cont.Class (class MonadCont, callCC)
1414
import Control.Monad.Cont.Trans (class MonadTrans, ContT(..), lift, mapContT, runContT, withContT)
1515

16-
import Data.Identity (Identity(..), runIdentity)
16+
import Data.Identity (Identity(..))
17+
import Data.Newtype (unwrap)
1718

1819
-- | The `Cont` monad is a synonym for the `ContT` monad transformer applied to
1920
-- | the `Identity` monad.
2021
type Cont r a = ContT r Identity a
2122

2223
-- | Creates a computation in the `Cont` monad.
2324
cont :: forall a r. ((a -> r) -> r) -> Cont r a
24-
cont f = ContT (\c -> Identity (f (runIdentity <<< c)))
25+
cont f = ContT (\c -> Identity (f (unwrap <<< c)))
2526

2627
-- | Runs a computation in the `Cont` monad.
2728
runCont :: forall r a. ContT r Identity a -> (a -> r) -> r
28-
runCont cc k = runIdentity (runContT cc (Identity <<< k))
29+
runCont cc k = unwrap (runContT cc (Identity <<< k))
2930

3031
-- | Transform the result of a continuation-passing function.
3132
mapCont :: forall r a. (r -> r) -> Cont r a -> Cont r a
32-
mapCont f = mapContT (Identity <<< f <<< runIdentity)
33+
mapCont f = mapContT (Identity <<< f <<< unwrap)
3334

3435
-- | Transform the continuation passed into the continuation-passing function.
3536
withCont :: forall a b r. ((b -> r) -> (a -> r)) -> Cont r a -> Cont r b
36-
withCont f = withContT (compose Identity <<< f <<< compose runIdentity)
37+
withCont f = withContT (compose Identity <<< f <<< compose unwrap)

src/Control/Monad/Error/Class.purs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import Data.Either (Either(..))
2323
-- | - Catch: `catchError (throwError e) f = f e`
2424
-- | - Pure: `catchError (pure a) f = pure a`
2525
-- |
26-
class Monad m <= MonadError e m where
26+
class Monad m <= MonadError e m | m -> e where
2727
throwError :: forall a. e -> m a
2828
catchError :: forall a. m a -> (e -> m a) -> m a
2929

src/Control/Monad/Except.purs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ import Control.Monad.Error.Class (class MonadError, catchError, catchJust, throw
1414
import Control.Monad.Except.Trans (class MonadTrans, ExceptT(..), except, lift, mapExceptT, runExceptT, withExceptT)
1515

1616
import Data.Either (Either)
17-
import Data.Identity (Identity(..), runIdentity)
17+
import Data.Identity (Identity(..))
18+
import Data.Newtype (unwrap)
1819

1920
-- | A parametrizable exception monad; computations are either exceptions or
2021
-- | pure values. If an exception is thrown (see `throwError`), the computation
@@ -35,11 +36,11 @@ type Except e a = ExceptT e Identity a
3536

3637
-- | Run a computation in the `Except` monad. The inverse of `except`.
3738
runExcept :: forall e a. Except e a -> Either e a
38-
runExcept = runIdentity <<< runExceptT
39+
runExcept = unwrap <<< runExceptT
3940

4041
-- | Transform the unwrapped computation using the given function.
4142
mapExcept :: forall e e' a b. (Either e a -> Either e' b) -> Except e a -> Except e' b
42-
mapExcept f = mapExceptT (Identity <<< f <<< runIdentity)
43+
mapExcept f = mapExceptT (Identity <<< f <<< unwrap)
4344

4445
-- | Transform any exceptions thrown by an `Except` computation using the given function.
4546
withExcept :: forall e e' a. (e -> e') -> Except e a -> Except e' a

0 commit comments

Comments
 (0)