File tree Expand file tree Collapse file tree 7 files changed +25
-59
lines changed Expand file tree Collapse file tree 7 files changed +25
-59
lines changed Original file line number Diff line number Diff line change 4
4
/bower_components /
5
5
/node_modules /
6
6
/output /
7
- /tmp /
Original file line number Diff line number Diff line change 1
1
language : node_js
2
2
sudo : false
3
3
node_js :
4
- - 0.10
4
+ - 5
5
5
env :
6
6
- PATH=$HOME/purescript:$PATH
7
7
install :
8
8
- TAG=$(wget -q -O - https://github.com/purescript/purescript/releases/latest --server-response --max-redirect 0 2>&1 | sed -n -e 's/.*Location:.*tag\///p')
9
9
- wget -O $HOME/purescript.tar.gz https://github.com/purescript/purescript/releases/download/$TAG/linux64.tar.gz
10
10
- tar -xvf $HOME/purescript.tar.gz -C $HOME/
11
11
- chmod a+x $HOME/purescript
12
+ - npm install -g bower
12
13
- npm install
13
14
script :
14
15
- npm run build
16
+ after_success :
17
+ - >-
18
+ test $TRAVIS_TAG &&
19
+ psc-publish > .pursuit.json &&
20
+ curl -X POST http://pursuit.purescript.org/packages \
21
+ -d @.pursuit.json \
22
+ -H 'Accept: application/json' \
23
+ -H "Authorization: token ${GITHUB_TOKEN}"
Original file line number Diff line number Diff line change @@ -12,6 +12,6 @@ Invariant functors.
12
12
bower install purescript-invariant
13
13
```
14
14
15
- ## Module documentation
15
+ ## Documentation
16
16
17
- - [ Data.Functor.Invariant ] ( docs/Data/Functor/Invariant.md )
17
+ Module documentation is [ published on Pursuit ] ( http://pursuit.purescript.org/packages/purescript-invariant ) .
Original file line number Diff line number Diff line change 2
2
"name" : " purescript-invariant" ,
3
3
"homepage" : " https://github.com/purescript/purescript-invariant" ,
4
4
"description" : " Invariant functors for PureScript" ,
5
- "keywords" : [
6
- " purescript" ,
7
- " invariant" ,
8
- " functor"
9
- ],
10
- "authors" : [
11
- " Gary Burgess <gary.burgess@gmail.com>"
12
- ],
13
5
"license" : " MIT" ,
14
6
"repository" : {
15
7
"type" : " git" ,
25
17
" package.json"
26
18
],
27
19
"dependencies" : {
28
- "purescript-prelude" : " ^0. 1.0"
20
+ "purescript-prelude" : " ^1.0.0-rc.1 "
29
21
}
30
22
}
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 2
2
"private" : true ,
3
3
"scripts" : {
4
4
"postinstall" : " pulp dep install" ,
5
- "build" : " pulp build && rimraf docs && pulp docs"
5
+ "clean" : " rimraf output && rimraf .pulp-cache" ,
6
+ "build" : " pulp build"
6
7
},
7
8
"devDependencies" : {
8
- "pulp" : " ^4 .0.2 " ,
9
- "rimraf" : " ^2.4.1 "
9
+ "pulp" : " ^8 .0.0 " ,
10
+ "rimraf" : " ^2.5.0 "
10
11
}
11
12
}
Original file line number Diff line number Diff line change 1
1
module Data.Functor.Invariant where
2
2
3
- import Prelude
3
+ import Data.Function (const , (<<<))
4
+ import Data.Functor (class Functor , map )
4
5
5
6
-- | A type of functor that can be used to adapt the type of a wrapped function
6
7
-- | where the parameterised type occurs in both the positive and negative
@@ -14,14 +15,14 @@ import Prelude
14
15
class Invariant f where
15
16
imap :: forall a b . (a -> b ) -> (b -> a ) -> f a -> f b
16
17
17
- -- | As all `Functor`s are also trivially `Invariant`, this function can be
18
- -- | used as the `imap` implementation for all `Invariant` instances for
19
- -- | `Functors`.
20
- imapF :: forall f a b . (Functor f ) => (a -> b ) -> (b -> a ) -> f a -> f b
21
- imapF = const <<< map
22
-
23
18
instance invariantFn :: Invariant ((-> ) a ) where
24
19
imap = imapF
25
20
26
21
instance invariantArray :: Invariant Array where
27
22
imap = imapF
23
+
24
+ -- | As all `Functor`s are also trivially `Invariant`, this function can be
25
+ -- | used as the `imap` implementation for any types that has an existing
26
+ -- | `Functor` instance.
27
+ imapF :: forall f a b . Functor f => (a -> b ) -> (b -> a ) -> f a -> f b
28
+ imapF = const <<< map
You can’t perform that action at this time.
0 commit comments