File tree Expand file tree Collapse file tree 5 files changed +62
-19
lines changed Expand file tree Collapse file tree 5 files changed +62
-19
lines changed Original file line number Diff line number Diff line change 1- node_modules
2- bower_components
3- dist
1+ /. *
2+ ! /.gitignore
3+ ! /.travis.yml
4+ /bower_components /
5+ /node_modules /
6+ /output /
Original file line number Diff line number Diff line change @@ -96,6 +96,20 @@ these :: forall a b c. (a -> c) -> (b -> c) -> (a -> b -> c) -> These a b -> c
9696```
9797
9898
99+ #### ` thisOrBoth `
100+
101+ ``` purescript
102+ thisOrBoth :: forall a b. a -> Maybe b -> These a b
103+ ```
104+
105+
106+ #### ` thatOrBoth `
107+
108+ ``` purescript
109+ thatOrBoth :: forall a b. b -> Maybe a -> These a b
110+ ```
111+
112+
99113#### ` fromThese `
100114
101115``` purescript
Original file line number Diff line number Diff line change 1- require ( 'mandragora-bucket' ) ( require ( 'gulp' ) , {
2- paths : {
3- bower : [
4- 'bower_components/purescript-*/src/**/*.purs' ,
5- 'bower_components/purescript-*/purescript-*/src/**/*.purs'
6- ] ,
7- src : [ 'src/**/*.purs' ] ,
8- test : [ 'test/**/*.purs' ] ,
9- docs : {
10- dest : 'MODULES.md'
11- }
12- } ,
13- tmpDir : 'dist'
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+
8+ var sources = [
9+ "src/**/*.purs" ,
10+ "bower_components/purescript-*/src/**/*.purs"
11+ ] ;
12+
13+ gulp . task ( "make" , function ( ) {
14+ return gulp . src ( sources )
15+ . pipe ( plumber ( ) )
16+ . pipe ( purescript . pscMake ( ) ) ;
1417} ) ;
18+
19+ gulp . task ( "docs" , function ( ) {
20+ return gulp . src ( [ "src/**/*.purs" ] )
21+ . pipe ( plumber ( ) )
22+ . pipe ( purescript . pscDocs ( ) )
23+ . pipe ( gulp . dest ( "MODULES.md" ) ) ;
24+ } ) ;
25+
26+ gulp . task ( "dotpsci" , function ( ) {
27+ return gulp . src ( sources )
28+ . pipe ( plumber ( ) )
29+ . pipe ( purescript . dotPsci ( ) ) ;
30+ } ) ;
31+
32+ gulp . task ( "default" , [ "make" , "docs" ] ) ;
Original file line number Diff line number Diff line change 11{
22 "private" : true ,
33 "devDependencies" : {
4- "gulp" : " ~ 3.8.1 " ,
5- "bower " : " ~1.4.1 " ,
6- "mandragora-bucket " : " ~0.2.1 "
4+ "gulp" : " ^ 3.8.11 " ,
5+ "gulp-plumber " : " ^1.0.0 " ,
6+ "gulp-purescript " : " ^0.4.2 "
77 }
88}
Original file line number Diff line number Diff line change @@ -85,6 +85,14 @@ these l _ _ (This a) = l a
8585these _ r _ (That x) = r x
8686these _ _ lr (Both a x) = lr a x
8787
88+ thisOrBoth :: forall a b . a -> Maybe b -> These a b
89+ thisOrBoth a Nothing = This a
90+ thisOrBoth a (Just b) = Both a b
91+
92+ thatOrBoth :: forall a b . b -> Maybe a -> These a b
93+ thatOrBoth b Nothing = That b
94+ thatOrBoth b (Just a) = Both a b
95+
8896fromThese :: forall a b . a -> b -> These a b -> Tuple a b
8997fromThese _ x (This a) = Tuple a x
9098fromThese a _ (That x) = Tuple a x
You can’t perform that action at this time.
0 commit comments