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

Commit

Permalink
Updates for RC
Browse files Browse the repository at this point in the history
  • Loading branch information
paf31 committed Jun 10, 2015
1 parent afc8977 commit c2fe883
Show file tree
Hide file tree
Showing 13 changed files with 226 additions and 142 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ bower install purescript-arrows

## Module documentation

- [Control.Arrow](docs/Control.Arrow.md)
- [Control.Arrow.Kleisli](docs/Control.Arrow.Kleisli.md)
- [Control.Arrow.Cokleisli](docs/Control.Arrow.Cokleisli.md)
- [Control.Arrow](docs/Control/Arrow.md)
- [Control.Arrow.Kleisli](docs/Control/Arrow/Kleisli.md)
- [Control.Arrow.Cokleisli](docs/Control/Arrow/Cokleisli.md)
- [Control.Arrow.Static](docs/Control/Arrow/Static.md)
7 changes: 6 additions & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
"keywords": [
"purescript"
],
"repository": {
"type": "git",
"url": "git://github.com/purescript/purescript-arrows.git"
},
"license": "MIT",
"ignore": [
"**/.*",
Expand All @@ -22,6 +26,7 @@
"package.json"
],
"dependencies": {
"purescript-profunctor": "~0.3.0"
"purescript-prelude": "^0.1.0",
"purescript-profunctor": "^0.3.0"
}
}
36 changes: 0 additions & 36 deletions docs/Control.Arrow.md

This file was deleted.

45 changes: 45 additions & 0 deletions docs/Control/Arrow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
## Module Control.Arrow

Type classes and standard instances for Arrows.

#### `Arrow`

``` purescript
class (Category a, Strong a) <= Arrow a
```

The `Arrow` type class combines the operations of a `Category` with those of
a `Strong` profunctor.

##### Instances
``` purescript
instance arrowFunction :: Arrow Function
```

#### `ArrowZero`

``` purescript
class (Arrow a) <= ArrowZero a where
azero :: forall b c. a b c
```

Arrows with zero morphisms

#### `ArrowPlus`

``` purescript
class (ArrowZero a) <= ArrowPlus a where
aplus :: forall b c. a b c -> a b c -> a b c
```

Arrows with a monoidal operation on morphisms

#### `(<+>)`

``` purescript
(<+>) :: forall a b c. (ArrowPlus a) => a b c -> a b c -> a b c
```

An infix alias for `aplus`.


Original file line number Diff line number Diff line change
@@ -1,56 +1,33 @@
# Module Documentation

## Module Control.Arrow.Cokleisli

The `Cokleisli` arrow for a `Comonad`.

#### `Cokleisli`

``` purescript
newtype Cokleisli w a b
= Cokleisli (w a -> b)
```

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

#### `runCokleisli`

``` purescript
runCokleisli :: forall w a b. Cokleisli w a b -> w a -> b
```


#### `semigroupoidCokleisli`
Composition is defined using `=>=` with `extract` as the identity morhism.

##### Instances
``` purescript
instance semigroupoidCokleisli :: (Extend m) => Semigroupoid (Cokleisli m)
```


#### `categoryCokleisli`

``` purescript
instance categoryCokleisli :: (Comonad m) => Category (Cokleisli m)
```


#### `profunctorCokleisli`

``` purescript
instance profunctorCokleisli :: (Functor f) => Profunctor (Cokleisli f)
```


#### `strongCokleisli`

``` purescript
instance strongCokleisli :: (Comonad m) => Strong (Cokleisli m)
instance arrowCokleisli :: (Comonad m) => Arrow (Cokleisli m)
```


#### `arrowCokleisli`
#### `runCokleisli`

``` purescript
instance arrowCokleisli :: (Comonad m) => Arrow (Cokleisli m)
runCokleisli :: forall w a b. Cokleisli w a b -> w a -> b
```


Unpack a `Cokleisli` arrow.


45 changes: 12 additions & 33 deletions docs/Control.Arrow.Kleisli.md → docs/Control/Arrow/Kleisli.md
Original file line number Diff line number Diff line change
@@ -1,56 +1,35 @@
# Module Documentation

## Module Control.Arrow.Kleisli

The `Kleisli` arrow for a `Monad`.

#### `Kleisli`

``` purescript
newtype Kleisli m a b
= Kleisli (a -> m b)
```

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

#### `runKleisli`

``` purescript
runKleisli :: forall m a b. Kleisli m a b -> a -> m b
```


#### `semigroupoidKleisli`
Composition is defined using `>=>` with `return` as the identity morhism.

##### Instances
``` purescript
instance semigroupoidKleisli :: (Monad m) => Semigroupoid (Kleisli m)
```


#### `categoryKleisli`

``` purescript
instance categoryKleisli :: (Monad m) => Category (Kleisli m)
```


#### `profunctorKleisli`

``` purescript
instance profunctorKleisli :: (Functor f) => Profunctor (Kleisli f)
instance strongKleisli :: (Functor m) => Strong (Kleisli m)
instance arrowKleisli :: (Monad m) => Arrow (Kleisli m)
instance arrowZeroKleisli :: (MonadPlus m) => ArrowZero (Kleisli m)
instance arrowPlusKleisli :: (MonadPlus m) => ArrowPlus (Kleisli m)
```


#### `strongKleisli`

``` purescript
instance strongKleisli :: (Monad m) => Strong (Kleisli m)
```


#### `arrowKleisli`
#### `runKleisli`

``` purescript
instance arrowKleisli :: (Monad m) => Arrow (Kleisli m)
runKleisli :: forall m a b. Kleisli m a b -> a -> m b
```


Unpack a `Kleisli` arrow.


32 changes: 32 additions & 0 deletions docs/Control/Arrow/Static.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
## Module Control.Arrow.Static

The `Static` arrow transformer for an `Applicative` functor.

#### `Static`

``` purescript
newtype Static f a b c
= Static (f (a b c))
```

`Static` gives an `Arrow` instance for the static arrows of an `Applicative` functor.

##### Instances
``` purescript
instance semigroupoidStatic :: (Applicative f, Semigroupoid a) => Semigroupoid (Static f a)
instance categoryStatic :: (Applicative f, Category a) => Category (Static f a)
instance profunctorStatic :: (Functor f, Profunctor a) => Profunctor (Static f a)
instance strongStatic :: (Functor f, Strong a) => Strong (Static f a)
instance choiceStatic :: (Functor f, Choice a) => Choice (Static f a)
instance arrowStatic :: (Applicative f, Arrow a) => Arrow (Static f a)
```

#### `runStatic`

``` purescript
runStatic :: forall f a b c. Static f a b c -> f (a b c)
```

Unpack a `Static` arrow.


58 changes: 32 additions & 26 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,48 +1,54 @@
/* jshint node: true */
"use strict";

var gulp = require("gulp");
var plumber = require("gulp-plumber");
var purescript = require("gulp-purescript");
var jsvalidate = require("gulp-jsvalidate");
var rimraf = require("rimraf");

var paths = [
var sources = [
"src/**/*.purs",
"bower_components/purescript-*/src/**/*.purs"
];

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

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

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

var docTask = function(name) {
var taskName = "docs-" + name.toLowerCase();
gulp.task(taskName, function () {
return gulp.src("src/" + name.replace(/\./g, "/") + ".purs")
.pipe(plumber())
.pipe(purescript.pscDocs())
.pipe(gulp.dest("docs/" + name + ".md"));
});
docTasks.push(taskName);
};
gulp.task("clean", ["clean-docs", "clean-output"]);

["Control.Arrow", "Control.Arrow.Kleisli", "Control.Arrow.Cokleisli"].forEach(docTask);
gulp.task("make", function() {
return gulp.src(sources)
.pipe(plumber())
.pipe(purescript.pscMake({ ffi: foreigns }));
});

gulp.task("docs", docTasks);
gulp.task("docs", ["clean-docs"], function () {
return gulp.src(sources)
.pipe(plumber())
.pipe(purescript.pscDocs({
docgen: {
"Control.Arrow": "docs/Control/Arrow.md",
"Control.Arrow.Kleisli": "docs/Control/Arrow/Kleisli.md",
"Control.Arrow.Cokleisli": "docs/Control/Arrow/Cokleisli.md",
"Control.Arrow.Static": "docs/Control/Arrow/Static.md"
}
}));
});

gulp.task("dotpsci", function () {
return gulp.src(paths)
return gulp.src(sources)
.pipe(plumber())
.pipe(purescript.dotPsci());
});

gulp.task("default", ["jsvalidate", "docs", "dotpsci"]);
gulp.task("default", ["make", "docs", "dotpsci"]);
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"private": true,
"devDependencies": {
"gulp": "^3.8.11",
"gulp-jsvalidate": "^1.0.1",
"gulp-plumber": "^1.0.0",
"gulp-purescript": "^0.3.1"
"gulp-purescript": "^0.5.0-rc.1",
"rimraf": "^2.3.3"
}
}
Loading

0 comments on commit c2fe883

Please sign in to comment.