File tree Expand file tree Collapse file tree 6 files changed +39
-15
lines changed Expand file tree Collapse file tree 6 files changed +39
-15
lines changed Original file line number Diff line number Diff line change 1
1
language : node_js
2
2
dist : trusty
3
3
sudo : required
4
- node_js : 6
4
+ node_js : stable
5
5
env :
6
6
- PATH=$HOME/purescript:$PATH
7
7
install :
Original file line number Diff line number Diff line change 22
22
" package.json"
23
23
],
24
24
"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"
28
28
}
29
29
}
Original file line number Diff line number Diff line change 2
2
"private" : true ,
3
3
"scripts" : {
4
4
"clean" : " rimraf output && rimraf .pulp-cache" ,
5
- "build" : " pulp build --censor-lib --strict"
5
+ "build" : " pulp build -- -- censor-lib --strict"
6
6
},
7
7
"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 "
11
11
}
12
12
}
Original file line number Diff line number Diff line change @@ -31,13 +31,13 @@ rmap :: forall a b c p. Profunctor p => (b -> c) -> p a b -> p a c
31
31
rmap b2c = dimap id b2c
32
32
33
33
-- | 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
35
35
arr f = rmap f id
36
36
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
38
38
unwrapIso = dimap wrap unwrap
39
39
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
41
41
wrapIso _ = dimap unwrap wrap
42
42
43
43
instance profunctorFn :: Profunctor (-> ) where
Original file line number Diff line number Diff line change @@ -44,7 +44,13 @@ instance choiceFn :: Choice (->) where
44
44
-- | We take two functions, `f` and `g`, and we transform them into a single function which
45
45
-- | takes an `Either`and maps `f` over the left side and `g` over the right side. Just like
46
46
-- | `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 )
48
54
splitChoice l r = left l >>> right r
49
55
50
56
infixr 2 splitChoice as +++
@@ -65,7 +71,13 @@ infixr 2 splitChoice as +++
65
71
-- | whether the `Either` value is a `Left` or a `Right`.
66
72
-- | This allows us to bundle two different computations which both have the same result type into one
67
73
-- | 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
69
81
fanin l r = (l +++ r) >>> join
70
82
where
71
83
join :: p (Either c c ) c
Original file line number Diff line number Diff line change @@ -43,7 +43,13 @@ instance strongFn :: Strong (->) where
43
43
-- | We take two functions, `f` and `g`, and we transform them into a single function which
44
44
-- | takes a `Tuple` and maps `f` over the first element and `g` over the second. Just like `bi-map`
45
45
-- | 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 )
47
53
splitStrong l r = first l >>> second r
48
54
49
55
infixr 3 splitStrong as ***
@@ -62,7 +68,13 @@ infixr 3 splitStrong as ***
62
68
-- | single function which takes one parameter and returns a `Tuple` of the results of running
63
69
-- | `f` and `g` on the parameter, respectively. This allows us to run two parallel computations
64
70
-- | 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 )
66
78
fanout l r = split >>> (l *** r)
67
79
where
68
80
split :: p a (Tuple a a )
You can’t perform that action at this time.
0 commit comments