Skip to content

Commit 1fe73fa

Browse files
committed
Update build
1 parent 0ab5305 commit 1fe73fa

9 files changed

Lines changed: 158 additions & 129 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/.*
22
!/.gitignore
3+
!/.travis.yml
34
/bower_components/
45
/node_modules/
56
/output/

.travis.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
language: node_js
2+
node_js:
3+
- 0.10
4+
env:
5+
- PATH=$HOME/purescript:$PATH
6+
install:
7+
- 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')
8+
- wget -O $HOME/purescript.tar.gz https://github.com/purescript/purescript/releases/download/$TAG/linux64.tar.gz
9+
- tar -xvf $HOME/purescript.tar.gz -C $HOME/
10+
- chmod a+x $HOME/purescript
11+
- npm install bower gulp -g
12+
- npm install && bower install
13+
script:
14+
- gulp

Gruntfile.js

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

README.md

Lines changed: 8 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -1,89 +1,16 @@
1-
# Module Documentation
1+
# purescript-refs
22

3-
## Module Control.Monad.Eff.Ref
3+
[![Build Status](https://travis-ci.org/purescript/purescript-refs.svg?branch=master)](https://travis-ci.org/purescript/purescript-refs)
44

5+
Mutable value references.
56

6-
This module defines an effect and actions for working with
7-
global mutable variables.
7+
## Installation
88

9-
_Note_: The `Control.Monad.ST` provides a _safe_ alternative
10-
to global mutable variables when mutation is restricted to a
11-
local scope.
12-
13-
#### `REF`
14-
15-
``` purescript
16-
data REF :: !
179
```
18-
19-
The effect associated with the use of global mutable variables.
20-
21-
#### `Ref`
22-
23-
``` purescript
24-
data Ref :: * -> *
25-
```
26-
27-
A value of type `Ref a` represents a mutable reference
28-
which holds a value of type `a`.
29-
30-
#### `newRef`
31-
32-
``` purescript
33-
newRef :: forall s r. s -> Eff (ref :: REF | r) (Ref s)
34-
```
35-
36-
Create a new mutable reference containing the specified value.
37-
38-
#### `readRef`
39-
40-
``` purescript
41-
readRef :: forall s r. Ref s -> Eff (ref :: REF | r) s
42-
```
43-
44-
Read the current value of a mutable reference
45-
46-
#### `modifyRef'`
47-
48-
``` purescript
49-
modifyRef' :: forall s b r. Ref s -> (s -> { value :: b, state :: s }) -> Eff (ref :: REF | r) b
50-
```
51-
52-
Update the value of a mutable reference by applying a function
53-
to the current value.
54-
55-
#### `modifyRef`
56-
57-
``` purescript
58-
modifyRef :: forall s r. Ref s -> (s -> s) -> Eff (ref :: REF | r) Unit
59-
```
60-
61-
Update the value of a mutable reference by applying a function
62-
to the current value.
63-
64-
#### `writeRef`
65-
66-
``` purescript
67-
writeRef :: forall s r. Ref s -> s -> Eff (ref :: REF | r) Unit
68-
```
69-
70-
Update the value of a mutable reference to the specified value.
71-
72-
73-
## Module Control.Monad.Eff.Ref.Unsafe
74-
75-
76-
Unsafe functions for working with mutable references.
77-
78-
#### `unsafeRunRef`
79-
80-
``` purescript
81-
unsafeRunRef :: forall eff a. Eff (ref :: REF | eff) a -> Eff eff a
10+
bower install purescript-refs
8211
```
8312

84-
This handler function unsafely removes the `Ref` effect from an
85-
effectful action.
13+
## Module documentation
8614

87-
This function might be used when it is impossible to prove to the
88-
typechecker that a particular mutable reference does not escape
89-
its scope.
15+
- [Control.Monad.Eff.Ref](docs/Control.Monad.Eff.Ref.md)
16+
- [Control.Monad.Eff.Ref.Unsafe](docs/Control.Monad.Eff.Ref.Unsafe.md)

bower.json

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,15 @@
11
{
2-
"name": "purescript-refs",
3-
"homepage": "https://github.com/purescript/purescript-refs",
4-
"description": "Mutable value references",
5-
"keywords": [
6-
"purescript"
2+
"name": "purescript-semirings",
3+
"moduleType": [
4+
"node"
75
],
8-
"license": "MIT",
96
"ignore": [
107
"**/.*",
11-
"bower_components",
128
"node_modules",
13-
"output",
14-
"tests",
15-
"tmp",
16-
"bower.json",
17-
"Gruntfile.js",
18-
"package.json"
9+
"bower_components",
10+
"output"
1911
],
2012
"dependencies": {
21-
"purescript-eff": "~0.1.0"
13+
"purescript-foldable-traversable": "~0.4.0"
2214
}
2315
}

docs/Control.Monad.Eff.Ref.md

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# Module Documentation
2+
3+
## Module Control.Monad.Eff.Ref
4+
5+
6+
This module defines an effect and actions for working with
7+
global mutable variables.
8+
9+
_Note_: The `Control.Monad.ST` provides a _safe_ alternative
10+
to global mutable variables when mutation is restricted to a
11+
local scope.
12+
13+
#### `REF`
14+
15+
``` purescript
16+
data REF :: !
17+
```
18+
19+
The effect associated with the use of global mutable variables.
20+
21+
#### `Ref`
22+
23+
``` purescript
24+
data Ref :: * -> *
25+
```
26+
27+
A value of type `Ref a` represents a mutable reference
28+
which holds a value of type `a`.
29+
30+
#### `newRef`
31+
32+
``` purescript
33+
newRef :: forall s r. s -> Eff (ref :: REF | r) (Ref s)
34+
```
35+
36+
Create a new mutable reference containing the specified value.
37+
38+
#### `readRef`
39+
40+
``` purescript
41+
readRef :: forall s r. Ref s -> Eff (ref :: REF | r) s
42+
```
43+
44+
Read the current value of a mutable reference
45+
46+
#### `modifyRef'`
47+
48+
``` purescript
49+
modifyRef' :: forall s b r. Ref s -> (s -> { value :: b, state :: s }) -> Eff (ref :: REF | r) b
50+
```
51+
52+
Update the value of a mutable reference by applying a function
53+
to the current value.
54+
55+
#### `modifyRef`
56+
57+
``` purescript
58+
modifyRef :: forall s r. Ref s -> (s -> s) -> Eff (ref :: REF | r) Unit
59+
```
60+
61+
Update the value of a mutable reference by applying a function
62+
to the current value.
63+
64+
#### `writeRef`
65+
66+
``` purescript
67+
writeRef :: forall s r. Ref s -> s -> Eff (ref :: REF | r) Unit
68+
```
69+
70+
Update the value of a mutable reference to the specified value.
71+
72+
73+

docs/Control.Monad.Eff.Unsafe.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Module Documentation
2+
3+

gulpfile.js

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
"use strict";
2+
3+
var gulp = require("gulp");
4+
var plumber = require("gulp-plumber");
5+
var purescript = require("gulp-purescript");
6+
var jsvalidate = require("gulp-jsvalidate");
7+
8+
var paths = [
9+
"src/**/*.purs",
10+
"bower_components/purescript-*/src/**/*.purs"
11+
];
12+
13+
gulp.task("make", function() {
14+
return gulp.src(paths)
15+
.pipe(plumber())
16+
.pipe(purescript.pscMake());
17+
});
18+
19+
gulp.task("jsvalidate", ["make"], function () {
20+
return gulp.src("output/**/*.js")
21+
.pipe(plumber())
22+
.pipe(jsvalidate());
23+
});
24+
25+
var docTasks = [];
26+
27+
var docTask = function(name) {
28+
var taskName = "docs-" + name.toLowerCase();
29+
gulp.task(taskName, function () {
30+
return gulp.src("src/" + name.replace(/\./g, "/") + ".purs")
31+
.pipe(plumber())
32+
.pipe(purescript.pscDocs())
33+
.pipe(gulp.dest("docs/" + name + ".md"));
34+
});
35+
docTasks.push(taskName);
36+
};
37+
38+
["Control.Monad.Eff.Ref", "Control.Monad.Eff.Unsafe"].forEach(docTask);
39+
40+
gulp.task("docs", docTasks);
41+
42+
gulp.task("dotpsci", function () {
43+
return gulp.src(paths)
44+
.pipe(plumber())
45+
.pipe(purescript.dotPsci());
46+
});
47+
48+
gulp.task("default", ["jsvalidate", "docs", "dotpsci"]);

package.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
{
22
"private": true,
3-
"dependencies": {
4-
"grunt": "~0.4.4",
5-
"grunt-purescript": "~0.6.0",
6-
"grunt-contrib-clean": "~0.5.0"
3+
"devDependencies": {
4+
"gulp": "^3.8.11",
5+
"gulp-jsvalidate": "^1.0.1",
6+
"gulp-plumber": "^1.0.0",
7+
"gulp-purescript": "^0.3.1"
78
}
89
}

0 commit comments

Comments
 (0)