Skip to content

Commit 9ee7970

Browse files
committed
Updates for RC
1 parent d3874aa commit 9ee7970

File tree

6 files changed

+98
-86
lines changed

6 files changed

+98
-86
lines changed

Gruntfile.js

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

README.md

Lines changed: 8 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,15 @@
1-
# Module Documentation
1+
# purescript-unfoldable
22

3-
## Module Data.Unfoldable
3+
[![Build Status](https://travis-ci.org/purescript/purescript-unfoldable.svg?branch=master)](https://travis-ci.org/purescript/purescript-unfoldable)
44

5+
Unfoldable functors.
56

6-
This module provides a type class for _unfoldable functors_, i.e.
7-
functors which support an `unfoldr` operation.
7+
## Installation
88

9-
This allows us to unify various operations on arrays, lists,
10-
sequences, etc.
11-
12-
#### `Unfoldable`
13-
14-
``` purescript
15-
class Unfoldable t where
16-
unfoldr :: forall a b. (b -> Maybe (Tuple a b)) -> b -> t a
9+
```
10+
bower install purescript-unfoldable
1711
```
1812

19-
This class identifies data structures which can be _unfolded_,
20-
generalizing `unfoldr` on arrays.
21-
22-
The generating function `f` in `unfoldr f` in understood as follows:
23-
24-
- If `f b` is `Nothing`, then `unfoldr f b` should be empty.
25-
- If `f b` is `Just (Tuple a b1)`, then `unfoldr f b` should consist of `a`
26-
appended to the result of `unfoldr f b1`.
27-
28-
#### `unfoldableArray`
13+
## Module documentation
2914

30-
``` purescript
31-
instance unfoldableArray :: Unfoldable Prim.Array
32-
```
15+
- [Data.Unfoldable](docs/Data.Unfoldable.md)

bower.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,10 @@
1818
"package.json"
1919
],
2020
"dependencies": {
21-
"purescript-arrays": "~0.4.0",
22-
"purescript-maybe": "~0.3.0",
23-
"purescript-tuples": "~0.4.0"
21+
"purescript-arrays": "^0.4.0",
22+
"purescript-tuples": "^0.4.0"
2423
},
2524
"devDependencies": {
26-
"purescript-console": "~0.1.0"
25+
"purescript-console": "^0.1.0"
2726
}
2827
}

docs/Data.Unfoldable.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
## Module Data.Unfoldable
2+
3+
This module provides a type class for _unfoldable functors_, i.e.
4+
functors which support an `unfoldr` operation.
5+
6+
This allows us to unify various operations on arrays, lists,
7+
sequences, etc.
8+
9+
#### `Unfoldable`
10+
11+
``` purescript
12+
class Unfoldable t where
13+
unfoldr :: forall a b. (b -> Maybe (Tuple a b)) -> b -> t a
14+
```
15+
16+
This class identifies data structures which can be _unfolded_,
17+
generalizing `unfoldr` on arrays.
18+
19+
The generating function `f` in `unfoldr f` in understood as follows:
20+
21+
- If `f b` is `Nothing`, then `unfoldr f b` should be empty.
22+
- If `f b` is `Just (Tuple a b1)`, then `unfoldr f b` should consist of `a`
23+
appended to the result of `unfoldr f b1`.
24+
25+
##### Instances
26+
``` purescript
27+
instance unfoldableArray :: Unfoldable Array
28+
```
29+
30+

gulpfile.js

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
/* jshint node: true */
2+
"use strict";
3+
4+
var gulp = require("gulp");
5+
var plumber = require("gulp-plumber");
6+
var purescript = require("gulp-purescript");
7+
var rimraf = require("rimraf");
8+
9+
var sources = [
10+
"src/**/*.purs",
11+
"bower_components/purescript-*/src/**/*.purs"
12+
];
13+
14+
var foreigns = [
15+
"src/**/*.js",
16+
"bower_components/purescript-*/src/**/*.js"
17+
];
18+
19+
gulp.task("clean-docs", function (cb) {
20+
rimraf("docs", cb);
21+
});
22+
23+
gulp.task("clean-output", function (cb) {
24+
rimraf("output", cb);
25+
});
26+
27+
gulp.task("clean", ["clean-docs", "clean-output"]);
28+
29+
gulp.task("make", function() {
30+
return gulp.src(sources)
31+
.pipe(plumber())
32+
.pipe(purescript.pscMake({ ffi: foreigns }));
33+
});
34+
35+
gulp.task("docs", ["clean-docs"], function () {
36+
return gulp.src(sources)
37+
.pipe(plumber())
38+
.pipe(purescript.pscDocs({
39+
docgen: {
40+
"Data.Unfoldable": "docs/Data.Unfoldable.md"
41+
}
42+
}));
43+
});
44+
45+
gulp.task("dotpsci", function () {
46+
return gulp.src(sources)
47+
.pipe(plumber())
48+
.pipe(purescript.dotPsci());
49+
});
50+
51+
gulp.task("default", ["make", "docs", "dotpsci"]);

package.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
{
22
"private": true,
33
"devDependencies": {
4-
"grunt": "^0.4.5",
5-
"grunt-contrib-clean": "^0.5.0",
6-
"grunt-execute": "^0.2.2",
7-
"grunt-jsvalidate": "^0.2.2",
8-
"grunt-purescript": "^0.6.0"
4+
"gulp": "^3.8.11",
5+
"gulp-jscs": "^1.6.0",
6+
"gulp-jshint": "^1.10.0",
7+
"gulp-plumber": "^1.0.0",
8+
"gulp-purescript": "^0.5.0-rc.1",
9+
"rimraf": "^2.3.3"
910
}
1011
}

0 commit comments

Comments
 (0)