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 11language : node_js
22dist : trusty
33sudo : required
4- node_js : 6
4+ node_js : stable
55env :
66 - PATH=$HOME/purescript:$PATH
77install :
Original file line number Diff line number Diff line change 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}
Original file line number Diff line number Diff line change 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}
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
3131rmap 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
3535arr 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
3838unwrapIso = 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
4141wrapIso _ = dimap unwrap wrap
4242
4343instance profunctorFn :: Profunctor (-> ) where
Original file line number Diff line number Diff 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 )
4854splitChoice l r = left l >>> right r
4955
5056infixr 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
6981fanin l r = (l +++ r) >>> join
7082 where
7183 join :: p (Either c c ) c
Original file line number Diff line number Diff 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 )
4753splitStrong l r = first l >>> second r
4854
4955infixr 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 )
6678fanout l r = split >>> (l *** r)
6779 where
6880 split :: p a (Tuple a a )
You can’t perform that action at this time.
0 commit comments