This repository was archived by the owner on Jun 6, 2018. It is now read-only.
File tree Expand file tree Collapse file tree 6 files changed +127
-107
lines changed
Expand file tree Collapse file tree 6 files changed +127
-107
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1- # Module Documentation
1+ # purescript-coproducts
22
3- ## Module Data.Functor.Coproduct
3+ [ ![ Build Status ] ( https://travis-ci.org/purescript/purescript-coproducts.svg?branch=master )] ( https://travis-ci.org/purescript/purescript-coproducts )
44
5+ Functor coproducts.
56
6- Functor coproducts
7+ ## Installation
78
8- #### ` Coproduct `
9-
10- ``` purescript
11- newtype Coproduct f g a
12- = Coproduct (Either (f a) (g a))
139```
14-
15- ` Coproduct f g ` is the coproduct of two functors ` f ` and ` g `
16-
17- #### ` runCoproduct `
18-
19- ``` purescript
20- runCoproduct :: forall f g a. Coproduct f g a -> Either (f a) (g a)
10+ bower install purescript-coproducts
2111```
2212
23- Unwrap a coproduct
24-
25- #### ` left `
26-
27- ``` purescript
28- left :: forall f g a. f a -> Coproduct f g a
29- ```
30-
31- Left injection
32-
33- #### ` right `
34-
35- ``` purescript
36- right :: forall f g a. g a -> Coproduct f g a
37- ```
38-
39- Right injection
40-
41- #### ` coproduct `
42-
43- ``` purescript
44- coproduct :: forall f g a b. (f a -> b) -> (g a -> b) -> Coproduct f g a -> b
45- ```
46-
47- Eliminate a coproduct by providing eliminators for the left and
48- right components
49-
50- #### ` functorCoproduct `
51-
52- ``` purescript
53- instance functorCoproduct :: (Functor f, Functor g) => Functor (Coproduct f g)
54- ```
55-
56-
57- #### ` foldableCoproduct `
58-
59- ``` purescript
60- instance foldableCoproduct :: (Foldable f, Foldable g) => Foldable (Coproduct f g)
61- ```
62-
63-
64- #### ` traversableCoproduct `
13+ ## Module documentation
6514
66- ``` purescript
67- instance traversableCoproduct :: (Traversable f, Traversable g) => Traversable (Coproduct f g)
68- ```
15+ - [ Data.Functor.Coproduct] ( docs/Data.Functor.Coproduct.md )
Original file line number Diff line number Diff line change 11{
22 "name" : " purescript-coproducts" ,
3+ "homepage" : " https://github.com/purescript/purescript-coproducts" ,
4+ "description" : " Functor coproducts" ,
35 "keywords" : [
46 " purescript"
57 ],
68 "license" : " MIT" ,
9+ "repository" : {
10+ "type" : " git" ,
11+ "url" : " git://github.com/purescript/purescript-coproducts.git"
12+ },
713 "ignore" : [
814 " **/.*" ,
915 " bower_components" ,
1016 " node_modules" ,
1117 " output" ,
12- " tests" ,
13- " tmp" ,
18+ " test" ,
1419 " bower.json" ,
15- " Gruntfile .js" ,
20+ " gulpfile .js" ,
1621 " package.json"
1722 ],
1823 "dependencies" : {
19- "purescript-either" : " ~0.2.0" ,
20- "purescript-foldable-traversable" : " ~0.4.0"
24+ "purescript-either" : " ^0.2.0"
2125 }
2226}
Original file line number Diff line number Diff line change 1+ ## Module Data.Functor.Coproduct
2+
3+ Functor coproducts
4+
5+ #### ` Coproduct `
6+
7+ ``` purescript
8+ newtype Coproduct f g a
9+ = Coproduct (Either (f a) (g a))
10+ ```
11+
12+ ` Coproduct f g ` is the coproduct of two functors ` f ` and ` g `
13+
14+ ##### Instances
15+ ``` purescript
16+ instance functorCoproduct :: (Functor f, Functor g) => Functor (Coproduct f g)
17+ instance foldableCoproduct :: (Foldable f, Foldable g) => Foldable (Coproduct f g)
18+ instance traversableCoproduct :: (Traversable f, Traversable g) => Traversable (Coproduct f g)
19+ ```
20+
21+ #### ` runCoproduct `
22+
23+ ``` purescript
24+ runCoproduct :: forall f g a. Coproduct f g a -> Either (f a) (g a)
25+ ```
26+
27+ Unwrap a coproduct
28+
29+ #### ` left `
30+
31+ ``` purescript
32+ left :: forall f g a. f a -> Coproduct f g a
33+ ```
34+
35+ Left injection
36+
37+ #### ` right `
38+
39+ ``` purescript
40+ right :: forall f g a. g a -> Coproduct f g a
41+ ```
42+
43+ Right injection
44+
45+ #### ` coproduct `
46+
47+ ``` purescript
48+ coproduct :: forall f g a b. (f a -> b) -> (g a -> b) -> Coproduct f g a -> b
49+ ```
50+
51+ Eliminate a coproduct by providing eliminators for the left and
52+ right components
53+
54+
Original file line number Diff line number Diff line change 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.Functor.Coproduct" : "docs/Data.Functor.Coproduct.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" ] ) ;
Original file line number Diff line number Diff line change 11{
22 "private" : true ,
3- "dependencies" : {
4- "grunt" : " ~0.4.4" ,
5- "grunt-purescript" : " ~0.5.1" ,
6- "grunt-contrib-clean" : " ~0.5.0"
7- },
83 "devDependencies" : {
9- "grunt" : " ^0.4.5" ,
10- "grunt-contrib-clean" : " ^0.5.0" ,
11- "grunt-jsvalidate" : " ^0.2.2" ,
12- "grunt-purescript" : " ^0.5.3"
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"
1310 }
1411}
You can’t perform that action at this time.
0 commit comments