Skip to content
This repository was archived by the owner on May 24, 2018. It is now read-only.

Commit c2fe883

Browse files
committed
Updates for RC
1 parent afc8977 commit c2fe883

File tree

13 files changed

+226
-142
lines changed

13 files changed

+226
-142
lines changed

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ bower install purescript-arrows
1212

1313
## Module documentation
1414

15-
- [Control.Arrow](docs/Control.Arrow.md)
16-
- [Control.Arrow.Kleisli](docs/Control.Arrow.Kleisli.md)
17-
- [Control.Arrow.Cokleisli](docs/Control.Arrow.Cokleisli.md)
15+
- [Control.Arrow](docs/Control/Arrow.md)
16+
- [Control.Arrow.Kleisli](docs/Control/Arrow/Kleisli.md)
17+
- [Control.Arrow.Cokleisli](docs/Control/Arrow/Cokleisli.md)
18+
- [Control.Arrow.Static](docs/Control/Arrow/Static.md)

bower.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
"keywords": [
1010
"purescript"
1111
],
12+
"repository": {
13+
"type": "git",
14+
"url": "git://github.com/purescript/purescript-arrows.git"
15+
},
1216
"license": "MIT",
1317
"ignore": [
1418
"**/.*",
@@ -22,6 +26,7 @@
2226
"package.json"
2327
],
2428
"dependencies": {
25-
"purescript-profunctor": "~0.3.0"
29+
"purescript-prelude": "^0.1.0",
30+
"purescript-profunctor": "^0.3.0"
2631
}
2732
}

docs/Control.Arrow.md

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

docs/Control/Arrow.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
## Module Control.Arrow
2+
3+
Type classes and standard instances for Arrows.
4+
5+
#### `Arrow`
6+
7+
``` purescript
8+
class (Category a, Strong a) <= Arrow a
9+
```
10+
11+
The `Arrow` type class combines the operations of a `Category` with those of
12+
a `Strong` profunctor.
13+
14+
##### Instances
15+
``` purescript
16+
instance arrowFunction :: Arrow Function
17+
```
18+
19+
#### `ArrowZero`
20+
21+
``` purescript
22+
class (Arrow a) <= ArrowZero a where
23+
azero :: forall b c. a b c
24+
```
25+
26+
Arrows with zero morphisms
27+
28+
#### `ArrowPlus`
29+
30+
``` purescript
31+
class (ArrowZero a) <= ArrowPlus a where
32+
aplus :: forall b c. a b c -> a b c -> a b c
33+
```
34+
35+
Arrows with a monoidal operation on morphisms
36+
37+
#### `(<+>)`
38+
39+
``` purescript
40+
(<+>) :: forall a b c. (ArrowPlus a) => a b c -> a b c -> a b c
41+
```
42+
43+
An infix alias for `aplus`.
44+
45+
Lines changed: 9 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,33 @@
1-
# Module Documentation
2-
31
## Module Control.Arrow.Cokleisli
42

3+
The `Cokleisli` arrow for a `Comonad`.
4+
55
#### `Cokleisli`
66

77
``` purescript
88
newtype Cokleisli w a b
99
= Cokleisli (w a -> b)
1010
```
1111

12+
`Cokleisli` gives an `Arrow` instance for the Co-Kleisli category of a `Comonad`.
1213

13-
#### `runCokleisli`
14-
15-
``` purescript
16-
runCokleisli :: forall w a b. Cokleisli w a b -> w a -> b
17-
```
18-
19-
20-
#### `semigroupoidCokleisli`
14+
Composition is defined using `=>=` with `extract` as the identity morhism.
2115

16+
##### Instances
2217
``` purescript
2318
instance semigroupoidCokleisli :: (Extend m) => Semigroupoid (Cokleisli m)
24-
```
25-
26-
27-
#### `categoryCokleisli`
28-
29-
``` purescript
3019
instance categoryCokleisli :: (Comonad m) => Category (Cokleisli m)
31-
```
32-
33-
34-
#### `profunctorCokleisli`
35-
36-
``` purescript
3720
instance profunctorCokleisli :: (Functor f) => Profunctor (Cokleisli f)
38-
```
39-
40-
41-
#### `strongCokleisli`
42-
43-
``` purescript
4421
instance strongCokleisli :: (Comonad m) => Strong (Cokleisli m)
22+
instance arrowCokleisli :: (Comonad m) => Arrow (Cokleisli m)
4523
```
4624

47-
48-
#### `arrowCokleisli`
25+
#### `runCokleisli`
4926

5027
``` purescript
51-
instance arrowCokleisli :: (Comonad m) => Arrow (Cokleisli m)
28+
runCokleisli :: forall w a b. Cokleisli w a b -> w a -> b
5229
```
5330

54-
31+
Unpack a `Cokleisli` arrow.
5532

5633

Lines changed: 12 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,35 @@
1-
# Module Documentation
2-
31
## Module Control.Arrow.Kleisli
42

3+
The `Kleisli` arrow for a `Monad`.
4+
55
#### `Kleisli`
66

77
``` purescript
88
newtype Kleisli m a b
99
= Kleisli (a -> m b)
1010
```
1111

12+
`Kleisli` gives an `Arrow` instance for the Kleisli category of a `Monad`.
1213

13-
#### `runKleisli`
14-
15-
``` purescript
16-
runKleisli :: forall m a b. Kleisli m a b -> a -> m b
17-
```
18-
19-
20-
#### `semigroupoidKleisli`
14+
Composition is defined using `>=>` with `return` as the identity morhism.
2115

16+
##### Instances
2217
``` purescript
2318
instance semigroupoidKleisli :: (Monad m) => Semigroupoid (Kleisli m)
24-
```
25-
26-
27-
#### `categoryKleisli`
28-
29-
``` purescript
3019
instance categoryKleisli :: (Monad m) => Category (Kleisli m)
31-
```
32-
33-
34-
#### `profunctorKleisli`
35-
36-
``` purescript
3720
instance profunctorKleisli :: (Functor f) => Profunctor (Kleisli f)
21+
instance strongKleisli :: (Functor m) => Strong (Kleisli m)
22+
instance arrowKleisli :: (Monad m) => Arrow (Kleisli m)
23+
instance arrowZeroKleisli :: (MonadPlus m) => ArrowZero (Kleisli m)
24+
instance arrowPlusKleisli :: (MonadPlus m) => ArrowPlus (Kleisli m)
3825
```
3926

40-
41-
#### `strongKleisli`
42-
43-
``` purescript
44-
instance strongKleisli :: (Monad m) => Strong (Kleisli m)
45-
```
46-
47-
48-
#### `arrowKleisli`
27+
#### `runKleisli`
4928

5029
``` purescript
51-
instance arrowKleisli :: (Monad m) => Arrow (Kleisli m)
30+
runKleisli :: forall m a b. Kleisli m a b -> a -> m b
5231
```
5332

54-
33+
Unpack a `Kleisli` arrow.
5534

5635

docs/Control/Arrow/Static.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
## Module Control.Arrow.Static
2+
3+
The `Static` arrow transformer for an `Applicative` functor.
4+
5+
#### `Static`
6+
7+
``` purescript
8+
newtype Static f a b c
9+
= Static (f (a b c))
10+
```
11+
12+
`Static` gives an `Arrow` instance for the static arrows of an `Applicative` functor.
13+
14+
##### Instances
15+
``` purescript
16+
instance semigroupoidStatic :: (Applicative f, Semigroupoid a) => Semigroupoid (Static f a)
17+
instance categoryStatic :: (Applicative f, Category a) => Category (Static f a)
18+
instance profunctorStatic :: (Functor f, Profunctor a) => Profunctor (Static f a)
19+
instance strongStatic :: (Functor f, Strong a) => Strong (Static f a)
20+
instance choiceStatic :: (Functor f, Choice a) => Choice (Static f a)
21+
instance arrowStatic :: (Applicative f, Arrow a) => Arrow (Static f a)
22+
```
23+
24+
#### `runStatic`
25+
26+
``` purescript
27+
runStatic :: forall f a b c. Static f a b c -> f (a b c)
28+
```
29+
30+
Unpack a `Static` arrow.
31+
32+

gulpfile.js

Lines changed: 32 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,54 @@
1+
/* jshint node: true */
12
"use strict";
23

34
var gulp = require("gulp");
45
var plumber = require("gulp-plumber");
56
var purescript = require("gulp-purescript");
6-
var jsvalidate = require("gulp-jsvalidate");
7+
var rimraf = require("rimraf");
78

8-
var paths = [
9+
var sources = [
910
"src/**/*.purs",
1011
"bower_components/purescript-*/src/**/*.purs"
1112
];
1213

13-
gulp.task("make", function() {
14-
return gulp.src(paths)
15-
.pipe(plumber())
16-
.pipe(purescript.pscMake());
17-
});
14+
var foreigns = [
15+
"src/**/*.js",
16+
"bower_components/purescript-*/src/**/*.js"
17+
];
1818

19-
gulp.task("jsvalidate", ["make"], function () {
20-
return gulp.src("output/**/*.js")
21-
.pipe(plumber())
22-
.pipe(jsvalidate());
19+
gulp.task("clean-docs", function (cb) {
20+
rimraf("docs", cb);
2321
});
2422

25-
var docTasks = [];
23+
gulp.task("clean-output", function (cb) {
24+
rimraf("output", cb);
25+
});
2626

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-
};
27+
gulp.task("clean", ["clean-docs", "clean-output"]);
3728

38-
["Control.Arrow", "Control.Arrow.Kleisli", "Control.Arrow.Cokleisli"].forEach(docTask);
29+
gulp.task("make", function() {
30+
return gulp.src(sources)
31+
.pipe(plumber())
32+
.pipe(purescript.pscMake({ ffi: foreigns }));
33+
});
3934

40-
gulp.task("docs", docTasks);
35+
gulp.task("docs", ["clean-docs"], function () {
36+
return gulp.src(sources)
37+
.pipe(plumber())
38+
.pipe(purescript.pscDocs({
39+
docgen: {
40+
"Control.Arrow": "docs/Control/Arrow.md",
41+
"Control.Arrow.Kleisli": "docs/Control/Arrow/Kleisli.md",
42+
"Control.Arrow.Cokleisli": "docs/Control/Arrow/Cokleisli.md",
43+
"Control.Arrow.Static": "docs/Control/Arrow/Static.md"
44+
}
45+
}));
46+
});
4147

4248
gulp.task("dotpsci", function () {
43-
return gulp.src(paths)
49+
return gulp.src(sources)
4450
.pipe(plumber())
4551
.pipe(purescript.dotPsci());
4652
});
4753

48-
gulp.task("default", ["jsvalidate", "docs", "dotpsci"]);
54+
gulp.task("default", ["make", "docs", "dotpsci"]);

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
"private": true,
33
"devDependencies": {
44
"gulp": "^3.8.11",
5-
"gulp-jsvalidate": "^1.0.1",
65
"gulp-plumber": "^1.0.0",
7-
"gulp-purescript": "^0.3.1"
6+
"gulp-purescript": "^0.5.0-rc.1",
7+
"rimraf": "^2.3.3"
88
}
99
}

0 commit comments

Comments
 (0)