Skip to content

Commit

Permalink
Merge pull request #3 from purescript-node/updates
Browse files Browse the repository at this point in the history
More updates, including build
  • Loading branch information
garyb authored Oct 21, 2016
2 parents 19ec2ad + 41d310f commit 6e42856
Show file tree
Hide file tree
Showing 7 changed files with 66 additions and 44 deletions.
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/.*
!/.gitignore
!/.travis.yml
/bower_components/
/node_modules/
/.pulp-cache/
/output/
/.psci*
/src/.webpack.js
15 changes: 15 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
language: node_js
dist: trusty
sudo: required
node_js: 6
install:
- npm install -g bower
- npm install
- bower install
script:
- npm run -s build
after_success:
- >-
test $TRAVIS_TAG &&
echo $GITHUB_TOKEN | pulp login &&
echo y | pulp publish --no-push
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# purescript-posix-types

[![Latest release](http://img.shields.io/github/release/purescript-node/purescript-posix-types.svg)](https://github.com/purescript-node/purescript-posix-types/releases)
[![Build Status](https://travis-ci.org/purescript-node/purescript-posix-types.svg?branch=master)](https://travis-ci.org/purescript-node/purescript-posix-types)

Basic types for use with bindings to POSIX-style APIs.

Documentation is [on Pursuit](http://pursuit.purescript.org/packages/purescript-posix-types).
## Installation

```
bower install purescript-posix-types
```

## Documentation

Module documentation is [published on Pursuit](http://pursuit.purescript.org/packages/purescript-posix-types).
16 changes: 9 additions & 7 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
{
"name": "purescript-posix-types",
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"output"
],
"license": "MIT",
"repository": {
"type": "git",
"url": "git://github.com/purescript-node/purescript-posix-types"
},
"ignore": [
"**/.*",
"bower_components",
"node_modules",
"output",
"test",
"bower.json",
"package.json"
],
"dependencies": {
"purescript-prelude": "^2.1.0",
"purescript-functions": "^2.0.0",
"purescript-maybe": "^2.0.0"
},
"devDependencies": {
Expand Down
13 changes: 13 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"private": true,
"scripts": {
"clean": "rimraf output && rimraf .pulp-cache",
"build": "pulp build --censor-lib --strict"
},
"devDependencies": {
"pulp": "^9.0.1",
"purescript-psa": "^0.3.9",
"purescript": "^0.10.1",
"rimraf": "^2.5.4"
}
}
37 changes: 11 additions & 26 deletions src/Data/Posix.purs
Original file line number Diff line number Diff line change
@@ -1,49 +1,34 @@
module Data.Posix where

import Prelude (class Show, show, (<>), class Ord, compare, class Eq, eq)
import Data.Function (on)
import Prelude
import Data.Newtype (class Newtype)

-- | A process ID.
newtype Pid = Pid Int

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

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

instance eqPid :: Eq Pid where
eq = eq `on` runPid

instance ordPid :: Ord Pid where
compare = compare `on` runPid

-- | A group ID (for a process or a file).
newtype Gid = Gid Int

runGid :: Gid -> Int
runGid (Gid x) = x
derive instance newtypeGid :: Newtype Gid _
derive newtype instance eqGid :: Eq Gid
derive newtype instance ordGid :: Ord Gid

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

instance eqGid :: Eq Gid where
eq = eq `on` runGid

instance ordGid :: Ord Gid where
compare = compare `on` runGid

-- | A user ID (for a process or a file).
newtype Uid = Uid Int

runUid :: Uid -> Int
runUid (Uid x) = x
derive instance newtypeUid :: Newtype Uid _
derive newtype instance eqUid :: Eq Uid
derive newtype instance ordUid :: Ord Uid

instance showUid :: Show Uid where
show (Uid uid) = "(Uid " <> show uid <> ")"

instance eqUid :: Eq Uid where
eq = eq `on` runUid

instance ordUid :: Ord Uid where
compare = compare `on` runUid
10 changes: 3 additions & 7 deletions src/Data/Posix/Signal.purs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
module Data.Posix.Signal where

import Prelude (class Show, class Eq, eq, class Ord, compare)
import Data.Function (on)
import Prelude
import Data.Maybe (Maybe(..))

data Signal
Expand Down Expand Up @@ -137,8 +136,5 @@ fromString s = case s of
instance showSignal :: Show Signal where
show = toString

instance eqSignal :: Eq Signal where
eq = eq `on` toString

instance ordSignal :: Ord Signal where
compare = compare `on` toString
derive instance eqSignal :: Eq Signal
derive instance ordSignal :: Ord Signal

0 comments on commit 6e42856

Please sign in to comment.