Skip to content

Commit 6e42856

Browse files
authored
Merge pull request #3 from purescript-node/updates
More updates, including build
2 parents 19ec2ad + 41d310f commit 6e42856

File tree

7 files changed

+66
-44
lines changed

7 files changed

+66
-44
lines changed

.gitignore

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
/.*
2+
!/.gitignore
3+
!/.travis.yml
14
/bower_components/
25
/node_modules/
3-
/.pulp-cache/
46
/output/
5-
/.psci*
6-
/src/.webpack.js

.travis.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
language: node_js
2+
dist: trusty
3+
sudo: required
4+
node_js: 6
5+
install:
6+
- npm install -g bower
7+
- npm install
8+
- bower install
9+
script:
10+
- npm run -s build
11+
after_success:
12+
- >-
13+
test $TRAVIS_TAG &&
14+
echo $GITHUB_TOKEN | pulp login &&
15+
echo y | pulp publish --no-push

README.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
# purescript-posix-types
22

3+
[![Latest release](http://img.shields.io/github/release/purescript-node/purescript-posix-types.svg)](https://github.com/purescript-node/purescript-posix-types/releases)
4+
[![Build Status](https://travis-ci.org/purescript-node/purescript-posix-types.svg?branch=master)](https://travis-ci.org/purescript-node/purescript-posix-types)
5+
36
Basic types for use with bindings to POSIX-style APIs.
47

5-
Documentation is [on Pursuit](http://pursuit.purescript.org/packages/purescript-posix-types).
8+
## Installation
9+
10+
```
11+
bower install purescript-posix-types
12+
```
13+
14+
## Documentation
15+
16+
Module documentation is [published on Pursuit](http://pursuit.purescript.org/packages/purescript-posix-types).

bower.json

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
11
{
22
"name": "purescript-posix-types",
3-
"ignore": [
4-
"**/.*",
5-
"node_modules",
6-
"bower_components",
7-
"output"
8-
],
93
"license": "MIT",
104
"repository": {
115
"type": "git",
126
"url": "git://github.com/purescript-node/purescript-posix-types"
137
},
8+
"ignore": [
9+
"**/.*",
10+
"bower_components",
11+
"node_modules",
12+
"output",
13+
"test",
14+
"bower.json",
15+
"package.json"
16+
],
1417
"dependencies": {
1518
"purescript-prelude": "^2.1.0",
16-
"purescript-functions": "^2.0.0",
1719
"purescript-maybe": "^2.0.0"
1820
},
1921
"devDependencies": {

package.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"private": true,
3+
"scripts": {
4+
"clean": "rimraf output && rimraf .pulp-cache",
5+
"build": "pulp build --censor-lib --strict"
6+
},
7+
"devDependencies": {
8+
"pulp": "^9.0.1",
9+
"purescript-psa": "^0.3.9",
10+
"purescript": "^0.10.1",
11+
"rimraf": "^2.5.4"
12+
}
13+
}

src/Data/Posix.purs

Lines changed: 11 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,34 @@
11
module Data.Posix where
22

3-
import Prelude (class Show, show, (<>), class Ord, compare, class Eq, eq)
4-
import Data.Function (on)
3+
import Prelude
4+
import Data.Newtype (class Newtype)
55

66
-- | A process ID.
77
newtype Pid = Pid Int
88

9-
runPid :: Pid -> Int
10-
runPid (Pid x) = x
9+
derive instance newtypePid :: Newtype Pid _
10+
derive newtype instance eqPid :: Eq Pid
11+
derive newtype instance ordPid :: Ord Pid
1112

1213
instance showPid :: Show Pid where
1314
show (Pid pid) = "(Pid " <> show pid <> ")"
1415

15-
instance eqPid :: Eq Pid where
16-
eq = eq `on` runPid
17-
18-
instance ordPid :: Ord Pid where
19-
compare = compare `on` runPid
20-
2116
-- | A group ID (for a process or a file).
2217
newtype Gid = Gid Int
2318

24-
runGid :: Gid -> Int
25-
runGid (Gid x) = x
19+
derive instance newtypeGid :: Newtype Gid _
20+
derive newtype instance eqGid :: Eq Gid
21+
derive newtype instance ordGid :: Ord Gid
2622

2723
instance showGid :: Show Gid where
2824
show (Gid gid) = "(Gid " <> show gid <> ")"
2925

30-
instance eqGid :: Eq Gid where
31-
eq = eq `on` runGid
32-
33-
instance ordGid :: Ord Gid where
34-
compare = compare `on` runGid
35-
3626
-- | A user ID (for a process or a file).
3727
newtype Uid = Uid Int
3828

39-
runUid :: Uid -> Int
40-
runUid (Uid x) = x
29+
derive instance newtypeUid :: Newtype Uid _
30+
derive newtype instance eqUid :: Eq Uid
31+
derive newtype instance ordUid :: Ord Uid
4132

4233
instance showUid :: Show Uid where
4334
show (Uid uid) = "(Uid " <> show uid <> ")"
44-
45-
instance eqUid :: Eq Uid where
46-
eq = eq `on` runUid
47-
48-
instance ordUid :: Ord Uid where
49-
compare = compare `on` runUid

src/Data/Posix/Signal.purs

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

3-
import Prelude (class Show, class Eq, eq, class Ord, compare)
4-
import Data.Function (on)
3+
import Prelude
54
import Data.Maybe (Maybe(..))
65

76
data Signal
@@ -137,8 +136,5 @@ fromString s = case s of
137136
instance showSignal :: Show Signal where
138137
show = toString
139138

140-
instance eqSignal :: Eq Signal where
141-
eq = eq `on` toString
142-
143-
instance ordSignal :: Ord Signal where
144-
compare = compare `on` toString
139+
derive instance eqSignal :: Eq Signal
140+
derive instance ordSignal :: Ord Signal

0 commit comments

Comments
 (0)