Skip to content

Commit b4cff5e

Browse files
authored
Merge pull request #21 from purescript/ps-0.11
Update for PureScript 0.11
2 parents ba3d96a + c3c023b commit b4cff5e

File tree

6 files changed

+39
-15
lines changed

6 files changed

+39
-15
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
language: node_js
22
dist: trusty
33
sudo: required
4-
node_js: 6
4+
node_js: stable
55
env:
66
- PATH=$HOME/purescript:$PATH
77
install:

bower.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
"package.json"
2323
],
2424
"dependencies": {
25-
"purescript-distributive": "^2.0.0",
26-
"purescript-either": "^2.0.0",
27-
"purescript-tuples": "^3.0.0"
25+
"purescript-distributive": "^3.0.0",
26+
"purescript-either": "^3.0.0",
27+
"purescript-tuples": "^4.0.0"
2828
}
2929
}

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
"private": true,
33
"scripts": {
44
"clean": "rimraf output && rimraf .pulp-cache",
5-
"build": "pulp build --censor-lib --strict"
5+
"build": "pulp build -- --censor-lib --strict"
66
},
77
"devDependencies": {
8-
"pulp": "^9.0.1",
9-
"purescript-psa": "^0.3.9",
10-
"rimraf": "^2.5.0"
8+
"pulp": "^10.0.4",
9+
"purescript-psa": "^0.5.0-rc.1",
10+
"rimraf": "^2.6.1"
1111
}
1212
}

src/Data/Profunctor.purs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ rmap :: forall a b c p. Profunctor p => (b -> c) -> p a b -> p a c
3131
rmap b2c = dimap id b2c
3232

3333
-- | Lift a pure function into any `Profunctor` which is also a `Category`.
34-
arr :: forall a b p. (Category p, Profunctor p) => (a -> b) -> p a b
34+
arr :: forall a b p. Category p => Profunctor p => (a -> b) -> p a b
3535
arr f = rmap f id
3636

37-
unwrapIso :: forall p t a. (Profunctor p, Newtype t a) => p t t -> p a a
37+
unwrapIso :: forall p t a. Profunctor p => Newtype t a => p t t -> p a a
3838
unwrapIso = dimap wrap unwrap
3939

40-
wrapIso :: forall p t a. (Profunctor p, Newtype t a) => (t -> a) -> p a a -> p t t
40+
wrapIso :: forall p t a. Profunctor p => Newtype t a => (t -> a) -> p a a -> p t t
4141
wrapIso _ = dimap unwrap wrap
4242

4343
instance profunctorFn :: Profunctor (->) where

src/Data/Profunctor/Choice.purs

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,13 @@ instance choiceFn :: Choice (->) where
4444
-- | We take two functions, `f` and `g`, and we transform them into a single function which
4545
-- | takes an `Either`and maps `f` over the left side and `g` over the right side. Just like
4646
-- | `bi-map` would do for the `bi-functor` instance of `Either`.
47-
splitChoice :: forall p a b c d. (Category p, Choice p) => p a b -> p c d -> p (Either a c) (Either b d)
47+
splitChoice
48+
:: forall p a b c d
49+
. Category p
50+
=> Choice p
51+
=> p a b
52+
-> p c d
53+
-> p (Either a c) (Either b d)
4854
splitChoice l r = left l >>> right r
4955

5056
infixr 2 splitChoice as +++
@@ -65,7 +71,13 @@ infixr 2 splitChoice as +++
6571
-- | whether the `Either` value is a `Left` or a `Right`.
6672
-- | This allows us to bundle two different computations which both have the same result type into one
6773
-- | function which will run the approriate computation based on the parameter supplied in the `Either` value.
68-
fanin :: forall p a b c. (Category p, Choice p) => p a c -> p b c -> p (Either a b) c
74+
fanin
75+
:: forall p a b c
76+
. Category p
77+
=> Choice p
78+
=> p a c
79+
-> p b c
80+
-> p (Either a b) c
6981
fanin l r = (l +++ r) >>> join
7082
where
7183
join :: p (Either c c) c

src/Data/Profunctor/Strong.purs

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,13 @@ instance strongFn :: Strong (->) where
4343
-- | We take two functions, `f` and `g`, and we transform them into a single function which
4444
-- | takes a `Tuple` and maps `f` over the first element and `g` over the second. Just like `bi-map`
4545
-- | would do for the `bi-functor` instance of `Tuple`.
46-
splitStrong :: forall p a b c d. (Category p, Strong p) => p a b -> p c d -> p (Tuple a c) (Tuple b d)
46+
splitStrong
47+
:: forall p a b c d
48+
. Category p
49+
=> Strong p
50+
=> p a b
51+
-> p c d
52+
-> p (Tuple a c) (Tuple b d)
4753
splitStrong l r = first l >>> second r
4854

4955
infixr 3 splitStrong as ***
@@ -62,7 +68,13 @@ infixr 3 splitStrong as ***
6268
-- | single function which takes one parameter and returns a `Tuple` of the results of running
6369
-- | `f` and `g` on the parameter, respectively. This allows us to run two parallel computations
6470
-- | on the same input and return both results in a `Tuple`.
65-
fanout :: forall p a b c. (Category p, Strong p) => p a b -> p a c -> p a (Tuple b c)
71+
fanout
72+
:: forall p a b c
73+
. Category p
74+
=> Strong p
75+
=> p a b
76+
-> p a c
77+
-> p a (Tuple b c)
6678
fanout l r = split >>> (l *** r)
6779
where
6880
split :: p a (Tuple a a)

0 commit comments

Comments
 (0)