Skip to content

Commit df6345b

Browse files
committed
Merge pull request #1 from purescript-contrib/0.9-updates
Updates for PureScript 0.9.1
2 parents bf9393c + 6503a81 commit df6345b

File tree

5 files changed

+26
-51
lines changed

5 files changed

+26
-51
lines changed

.travis.yml

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
11
language: node_js
2-
sudo: false
3-
node_js:
4-
- 5
2+
dist: trusty
3+
sudo: required
4+
node_js: 6
55
install:
66
- npm install -g bower
77
- npm install
8+
- bower install
89
script:
9-
- npm run build
10+
- npm run -s build
1011
after_success:
1112
- >-
1213
test $TRAVIS_TAG &&
13-
psc-publish > .pursuit.json &&
14-
curl -X POST http://pursuit.purescript.org/packages \
15-
-d @.pursuit.json \
16-
-H 'Accept: application/json' \
17-
-H "Authorization: token ${GITHUB_TOKEN}"
14+
echo $GITHUB_TOKEN | pulp login &&
15+
echo y | pulp publish --no-push

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
[![Latest release](http://img.shields.io/bower/v/purescript-http-methods.svg)](https://github.com/purescript-contrib/purescript-http-methods/releases)
44
[![Build Status](https://travis-ci.org/purescript-contrib/purescript-http-methods.svg?branch=master)](https://travis-ci.org/purescript-contrib/purescript-http-methods)
5+
[![Dependency Status](https://www.versioneye.com/user/projects/57558c637757a00041b3a750/badge.svg?style=flat)](https://www.versioneye.com/user/projects/57558c637757a00041b3a750)
56
[![Maintainer: garyb](https://img.shields.io/badge/maintainer-garyb-lightgrey.svg)](http://github.com/garyb)
67

78
HTTP method type.

bower.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,8 @@
1717
"package.json"
1818
],
1919
"dependencies": {
20-
"purescript-either": "^0.2.3",
21-
"purescript-generics": "^0.7.2",
22-
"purescript-prelude": "^0.1.4",
23-
"purescript-strings": "^0.7.1"
20+
"purescript-either": "^1.0.0",
21+
"purescript-generics": "^1.0.0",
22+
"purescript-strings": "^1.0.0"
2423
}
2524
}

package.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
{
22
"private": true,
33
"scripts": {
4-
"postinstall": "pulp dep install",
54
"clean": "rimraf output && rimraf .pulp-cache",
6-
"build": "pulp build"
5+
"build": "pulp build --censor-lib --strict",
6+
"test": "pulp test"
77
},
88
"devDependencies": {
9-
"pulp": "^8.0.0",
10-
"purescript": "^0.7.6",
9+
"pulp": "^9.0.0",
10+
"purescript-psa": "^0.3.9",
11+
"purescript": "^0.9.1",
1112
"rimraf": "^2.5.0"
1213
}
1314
}

src/Data/HTTP/Method.purs

Lines changed: 10 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
module Data.HTTP.Method
22
( Method(..)
3-
, CustomMethod()
4-
, runCustomMethod
3+
, CustomMethod
4+
, unCustomMethod
55
, fromString
66
, print
77
) where
88

99
import Prelude
1010

1111
import Data.Either (Either(..), either)
12-
import Data.Generic (Generic, gCompare)
12+
import Data.Generic (class Generic)
1313
import Data.String as Str
1414

1515
data Method
@@ -35,30 +35,10 @@ data Method
3535
-- RFC5789
3636
| PATCH
3737

38+
derive instance eqMethod :: Eq Method
39+
derive instance ordMethod :: Ord Method
3840
derive instance genericMethod :: Generic Method
3941

40-
instance eqMethod :: Eq Method where
41-
eq OPTIONS OPTIONS = true
42-
eq GET GET = true
43-
eq HEAD HEAD = true
44-
eq POST POST = true
45-
eq PUT PUT = true
46-
eq DELETE DELETE = true
47-
eq TRACE TRACE = true
48-
eq CONNECT CONNECT = true
49-
eq PROPFIND PROPFIND = true
50-
eq PROPPATCH PROPPATCH = true
51-
eq MKCOL MKCOL = true
52-
eq COPY COPY = true
53-
eq MOVE MOVE = true
54-
eq LOCK LOCK = true
55-
eq UNLOCK UNLOCK = true
56-
eq PATCH PATCH = true
57-
eq _ _ = false
58-
59-
instance ordMethod :: Ord Method where
60-
compare = gCompare
61-
6242
instance showMethod :: Show Method where
6343
show OPTIONS = "OPTIONS"
6444
show GET = "GET"
@@ -79,17 +59,13 @@ instance showMethod :: Show Method where
7959

8060
newtype CustomMethod = CustomMethod String
8161

82-
runCustomMethod :: CustomMethod -> String
83-
runCustomMethod (CustomMethod m) = m
62+
unCustomMethod :: CustomMethod -> String
63+
unCustomMethod (CustomMethod m) = m
8464

65+
derive instance eqCustomMethod :: Eq CustomMethod
66+
derive instance ordCustomMethod :: Ord CustomMethod
8567
derive instance genericCustomMethod :: Generic CustomMethod
8668

87-
instance eqCustomMethod :: Eq CustomMethod where
88-
eq (CustomMethod m1) (CustomMethod m2) = m1 == m2
89-
90-
instance ordCustomMethod :: Ord CustomMethod where
91-
compare = gCompare
92-
9369
instance showCustomMethod :: Show CustomMethod where
9470
show (CustomMethod m) = "(CustomMethod " <> show m <> ")"
9571

@@ -114,4 +90,4 @@ fromString s =
11490
m -> Right (CustomMethod m)
11591

11692
print :: Either Method CustomMethod -> String
117-
print = either show runCustomMethod
93+
print = either show unCustomMethod

0 commit comments

Comments
 (0)