Skip to content

Commit

Permalink
Updates for RC
Browse files Browse the repository at this point in the history
  • Loading branch information
garyb committed Jun 6, 2015
1 parent 74210ce commit 8a6204e
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 43 deletions.
8 changes: 4 additions & 4 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@
"package.json"
],
"dependencies": {
"purescript-bifunctors": "~0.4.0",
"purescript-maybe": "~0.3.0"
"purescript-bifunctors": "^0.4.0",
"purescript-maybe": "^0.3.0"
},
"devDependencies": {
"purescript-console": "~0.1.0",
"purescript-assert": "~0.1.0"
"purescript-console": "^0.1.0",
"purescript-assert": "^0.1.0"
}
}
4 changes: 2 additions & 2 deletions docs/Data.Bifoldable.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,15 @@ ignoring the final result.
#### `biany`

``` purescript
biany :: forall t a b c. (Bifoldable t, BoundedLattice c) => (a -> c) -> (b -> c) -> t a b -> c
biany :: forall t a b c. (Bifoldable t, BooleanAlgebra c) => (a -> c) -> (b -> c) -> t a b -> c
```

Test whether a predicate holds at any position in a data structure.

#### `biall`

``` purescript
biall :: forall t a b c. (Bifoldable t, BoundedLattice c) => (a -> c) -> (b -> c) -> t a b -> c
biall :: forall t a b c. (Bifoldable t, BooleanAlgebra c) => (a -> c) -> (b -> c) -> t a b -> c
```


24 changes: 12 additions & 12 deletions docs/Data.Foldable.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ class Foldable f where
foldMap :: forall a m. (Monoid m) => (a -> m) -> f a -> m
```

`Foldable` represents data structures which can be _folded_.

- `foldr` folds a structure from the right
- `foldl` folds a structure from the left
- `foldMap` folds a structure by accumulating values in a `Monoid`

##### Instances
``` purescript
instance foldableArray :: Foldable Array
Expand All @@ -17,17 +23,11 @@ instance foldableFirst :: Foldable First
instance foldableLast :: Foldable Last
instance foldableAdditive :: Foldable Additive
instance foldableDual :: Foldable Dual
instance foldableInf :: Foldable Inf
instance foldableDisj :: Foldable Disj
instance foldableConj :: Foldable Conj
instance foldableMultiplicative :: Foldable Multiplicative
instance foldableSup :: Foldable Sup
```

`Foldable` represents data structures which can be _folded_.

- `foldr` folds a structure from the right
- `foldl` folds a structure from the left
- `foldMap` folds a structure by accumulating values in a `Monoid`

#### `fold`

``` purescript
Expand Down Expand Up @@ -106,31 +106,31 @@ combining adjacent elements using the specified separator.
#### `and`

``` purescript
and :: forall a f. (Foldable f, BoundedLattice a) => f a -> a
and :: forall a f. (Foldable f, BooleanAlgebra a) => f a -> a
```

Test whether all `Boolean` values in a data structure are `true`.

#### `or`

``` purescript
or :: forall a f. (Foldable f, BoundedLattice a) => f a -> a
or :: forall a f. (Foldable f, BooleanAlgebra a) => f a -> a
```

Test whether any `Boolean` value in a data structure is `true`.

#### `any`

``` purescript
any :: forall a b f. (Foldable f, BoundedLattice b) => (a -> b) -> f a -> b
any :: forall a b f. (Foldable f, BooleanAlgebra b) => (a -> b) -> f a -> b
```

Test whether a predicate holds for any element in a data structure.

#### `all`

``` purescript
all :: forall a b f. (Foldable f, BoundedLattice b) => (a -> b) -> f a -> b
all :: forall a b f. (Foldable f, BooleanAlgebra b) => (a -> b) -> f a -> b
```

Test whether a predicate holds for all elements in a data structure.
Expand Down
26 changes: 13 additions & 13 deletions docs/Data.Traversable.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,6 @@ class (Functor t, Foldable t) <= Traversable t where
sequence :: forall a m. (Applicative m) => t (m a) -> m (t a)
```

##### Instances
``` purescript
instance traversableArray :: Traversable Array
instance traversableMaybe :: Traversable Maybe
instance traversableFirst :: Traversable First
instance traversableLast :: Traversable Last
instance traversableAdditive :: Traversable Additive
instance traversableDual :: Traversable Dual
instance traversableInf :: Traversable Inf
instance traversableMultiplicative :: Traversable Multiplicative
instance traversableSup :: Traversable Sup
```

`Traversable` represents data structures which can be _traversed_,
accumulating results and effects in some `Applicative` functor.

Expand All @@ -40,6 +27,19 @@ following sense:

- `foldMap f = runConst <<< traverse (Const <<< f)`

##### Instances
``` purescript
instance traversableArray :: Traversable Array
instance traversableMaybe :: Traversable Maybe
instance traversableFirst :: Traversable First
instance traversableLast :: Traversable Last
instance traversableAdditive :: Traversable Additive
instance traversableDual :: Traversable Dual
instance traversableConj :: Traversable Conj
instance traversableDisj :: Traversable Disj
instance traversableMultiplicative :: Traversable Multiplicative
```

#### `for`

``` purescript
Expand Down
28 changes: 21 additions & 7 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,30 @@ var jshint = require("gulp-jshint");
var jscs = require("gulp-jscs");
var purescript = require("gulp-purescript");
var run = require("gulp-run");
var rimraf = require("rimraf");

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

var foreigns = [
"src/**/*.js",
"bower_components/purescript-*/src/**/*.js"
"bower_components/purescript-*/src/**/*.js",
"bower_components/purescript-*/test/**/*.js"
];

gulp.task("clean-docs", function (cb) {
rimraf("docs", cb);
});

gulp.task("clean-output", function (cb) {
rimraf("output", cb);
});

gulp.task("clean", ["clean-docs", "clean-output"]);

gulp.task("lint", function() {
return gulp.src("src/**/*.js")
.pipe(jshint())
Expand All @@ -31,7 +44,7 @@ gulp.task("make", ["lint"], function() {
.pipe(purescript.pscMake({ ffi: foreigns }));
});

gulp.task("docs", function () {
gulp.task("docs", ["clean-docs"], function () {
return gulp.src(sources)
.pipe(plumber())
.pipe(purescript.pscDocs({
Expand All @@ -53,10 +66,11 @@ gulp.task("dotpsci", function () {
gulp.task("test", ["make"], function() {
return gulp.src(sources.concat(["test/Main.purs"]))
.pipe(plumber())
.pipe(purescript.psc({ main: "Test.Main"
, ffi: foreigns.concat(["test/Main.js"])
}))
.pipe(purescript.psc({
main: "Test.Main",
ffi: foreigns.concat(["test/Main.js"])
}))
.pipe(run("node"));
});

gulp.task("default", ["make", "docs", "dotpsci"]);
gulp.task("default", ["make", "docs", "dotpsci", "test"]);
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
"private": true,
"devDependencies": {
"gulp": "^3.8.11",
"gulp-jscs": "^1.6.0",
"gulp-jshint": "^1.10.0",
"gulp-plumber": "^1.0.0",
"gulp-purescript": "^0.5.0",
"gulp-purescript": "^0.5.0-rc.1",
"gulp-run": "^1.6.7",
"gulp-jscs": "^1.6.0",
"gulp-jshint": "^1.10.0"
"rimraf": "^2.3.4"
}
}
4 changes: 2 additions & 2 deletions test/Main.purs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ module Test.Main where

import Prelude

import Control.Monad.Eff.Console
import Data.Foldable
import Data.Maybe
import Data.Monoid.Additive
import Data.Foldable
import Data.Traversable
import Console
import Test.Assert

foreign import arrayFrom1UpTo :: Int -> Array Int
Expand Down

0 comments on commit 8a6204e

Please sign in to comment.