Skip to content

Commit bc60f63

Browse files
committedJun 5, 2016
Merge pull request #9 from purescript-node/1.0-updates
Updates for 1.0 core libraries
·
v9.0.0v1.0.0
2 parents f2597ea + c7f1a7f commit bc60f63

File tree

11 files changed

+26
-29
lines changed

11 files changed

+26
-29
lines changed
 

‎.travis.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
language: node_js
22
sudo: false
33
node_js:
4-
- 0.10
5-
- 0.12
64
- 4.1
75
env:
86
- PATH=$HOME/purescript:$PATH
@@ -11,6 +9,7 @@ install:
119
- wget -O $HOME/purescript.tar.gz https://github.com/purescript/purescript/releases/download/$TAG/linux64.tar.gz
1210
- tar -xvf $HOME/purescript.tar.gz -C $HOME/
1311
- chmod a+x $HOME/purescript
12+
- npm install -g bower
1413
- npm install
1514
script:
1615
- npm run build

‎bower.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@
1313
"url": "git://github.com/purescript-node/purescript-node-buffer"
1414
},
1515
"dependencies": {
16-
"purescript-eff": "~0.1.0",
17-
"purescript-maybe": "~0.3.1"
16+
"purescript-eff": "^1.0.0",
17+
"purescript-maybe": "^1.0.0"
1818
},
1919
"devDependencies": {
20-
"purescript-assert": "~0.1.1",
21-
"purescript-console": "~0.1.1",
22-
"purescript-foldable-traversable": "~0.4.1"
20+
"purescript-assert": "^1.0.0",
21+
"purescript-console": "^1.0.0",
22+
"purescript-foldable-traversable": "^1.0.0"
2323
}
2424
}

‎docs/Node/Buffer.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ An instance of Node's Buffer class.
2727

2828
##### Instances
2929
``` purescript
30-
instance showBuffer :: Show Buffer
30+
Show Buffer
3131
```
3232

3333
#### `BUFFER`
@@ -62,7 +62,7 @@ Enumeration of the numeric types that can be written to a buffer.
6262

6363
##### Instances
6464
``` purescript
65-
instance showBufferValueType :: Show BufferValueType
65+
Show BufferValueType
6666
```
6767

6868
#### `create`

‎docs/Node/Buffer/Unsafe.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,9 @@
66
slice :: Offset -> Offset -> Buffer -> Buffer
77
```
88

9+
Creates a new buffer slice that acts like a window on the original buffer.
10+
Writing to the slice buffer updates the original buffer and vice-versa.
11+
This is considered unsafe as writing to a slice can result in action at a
12+
distance.
13+
914

‎docs/Node/Encoding.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ data Encoding
1515

1616
##### Instances
1717
``` purescript
18-
instance showEncoding :: Show Encoding
18+
Show Encoding
1919
```
2020

2121
#### `byteLength`

‎package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
22
"private": true,
33
"devDependencies": {
4-
"pulp": "^4.0.1",
4+
"pulp": "^9.0.0",
55
"rimraf": "^2.4.1"
66
},
77
"scripts": {
8-
"postinstall": "pulp dep install",
8+
"postinstall": "bower install",
99
"build": "pulp build && pulp test && rimraf docs && pulp docs"
1010
}
1111
}

‎src/Node/Buffer.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
/* global require */
44
"use strict";
55

6-
// module Node.Buffer
7-
86
exports.showImpl = require('util').inspect;
97

108
exports.create = function (size) {

‎src/Node/Buffer.purs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ module Node.Buffer
2323
) where
2424

2525
import Prelude
26-
import Control.Monad.Eff
27-
import Data.Maybe
28-
import Node.Encoding
26+
import Control.Monad.Eff (Eff)
27+
import Data.Maybe (Maybe(..))
28+
import Node.Encoding (Encoding)
2929

3030
-- | Type synonym indicating the value should be an octet (0-255). If the value
3131
-- | provided is outside this range it will be used as modulo 255.

‎src/Node/Buffer/Unsafe.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
/* global Buffer */
33
"use strict";
44

5-
// module Node.Buffer.Unsafe
6-
75
exports.slice = function (start) {
86
return function (end) {
97
return function (buff) {

‎src/Node/Encoding.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
/* global Buffer */
33
"use strict";
44

5-
// module Node.Encoding
6-
75
exports.byteLengthImpl = function (str) {
86
return function (enc) {
97
return Buffer.byteLength(str, enc);

‎test/Main.purs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
module Test.Main where
22

33
import Prelude
4-
import Data.Traversable (traverse)
5-
import Control.Monad.Eff
4+
import Control.Monad.Eff (Eff)
65
import Control.Monad.Eff.Console (log, CONSOLE())
7-
import Test.Assert
8-
9-
import Node.Buffer
10-
import Node.Encoding
6+
import Data.Traversable (traverse)
7+
import Node.Buffer (BUFFER, BufferValueType(..), toArray, concat', fromArray, fill, copy, readString, fromString, toString, read, write, create)
8+
import Node.Encoding (Encoding(..))
9+
import Test.Assert (ASSERT, assert')
1110

1211
type Test = forall e. Eff (assert :: ASSERT, buffer :: BUFFER, console :: CONSOLE | e) Unit
1312

@@ -124,6 +123,6 @@ testConcat' = do
124123
assertEq :: forall a. (Eq a, Show a) => a -> a -> Test
125124
assertEq x y =
126125
if x == y
127-
then return unit
128-
else let msg = show x ++ " and " ++ show y ++ " were not equal."
126+
then pure unit
127+
else let msg = show x <> " and " <> show y <> " were not equal."
129128
in assert' msg false

0 commit comments

Comments
 (0)
Please sign in to comment.