Skip to content

Commit 9fc8c91

Browse files
committed
Merge pull request #4 from purescript/0.8-updates
Updates for PureScript 0.8
2 parents 709bf96 + 6cd762d commit 9fc8c91

File tree

7 files changed

+25
-59
lines changed

7 files changed

+25
-59
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,3 @@
44
/bower_components/
55
/node_modules/
66
/output/
7-
/tmp/

.travis.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,23 @@
11
language: node_js
22
sudo: false
33
node_js:
4-
- 0.10
4+
- 5
55
env:
66
- PATH=$HOME/purescript:$PATH
77
install:
88
- 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')
99
- wget -O $HOME/purescript.tar.gz https://github.com/purescript/purescript/releases/download/$TAG/linux64.tar.gz
1010
- tar -xvf $HOME/purescript.tar.gz -C $HOME/
1111
- chmod a+x $HOME/purescript
12+
- npm install -g bower
1213
- npm install
1314
script:
1415
- 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}"

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ Invariant functors.
1212
bower install purescript-invariant
1313
```
1414

15-
## Module documentation
15+
## Documentation
1616

17-
- [Data.Functor.Invariant](docs/Data/Functor/Invariant.md)
17+
Module documentation is [published on Pursuit](http://pursuit.purescript.org/packages/purescript-invariant).

bower.json

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,6 @@
22
"name": "purescript-invariant",
33
"homepage": "https://github.com/purescript/purescript-invariant",
44
"description": "Invariant functors for PureScript",
5-
"keywords": [
6-
"purescript",
7-
"invariant",
8-
"functor"
9-
],
10-
"authors": [
11-
"Gary Burgess <gary.burgess@gmail.com>"
12-
],
135
"license": "MIT",
146
"repository": {
157
"type": "git",
@@ -25,6 +17,6 @@
2517
"package.json"
2618
],
2719
"dependencies": {
28-
"purescript-prelude": "^0.1.0"
20+
"purescript-prelude": "^1.0.0-rc.1"
2921
}
3022
}

docs/Data/Functor/Invariant.md

Lines changed: 0 additions & 36 deletions
This file was deleted.

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22
"private": true,
33
"scripts": {
44
"postinstall": "pulp dep install",
5-
"build": "pulp build && rimraf docs && pulp docs"
5+
"clean": "rimraf output && rimraf .pulp-cache",
6+
"build": "pulp build"
67
},
78
"devDependencies": {
8-
"pulp": "^4.0.2",
9-
"rimraf": "^2.4.1"
9+
"pulp": "^8.0.0",
10+
"rimraf": "^2.5.0"
1011
}
1112
}

src/Data/Functor/Invariant.purs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
module Data.Functor.Invariant where
22

3-
import Prelude
3+
import Data.Function (const, (<<<))
4+
import Data.Functor (class Functor, map)
45

56
-- | A type of functor that can be used to adapt the type of a wrapped function
67
-- | where the parameterised type occurs in both the positive and negative
@@ -14,14 +15,14 @@ import Prelude
1415
class Invariant f where
1516
imap :: forall a b. (a -> b) -> (b -> a) -> f a -> f b
1617

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-
2318
instance invariantFn :: Invariant ((->) a) where
2419
imap = imapF
2520

2621
instance invariantArray :: Invariant Array where
2722
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

0 commit comments

Comments
 (0)