Skip to content
This repository was archived by the owner on Oct 4, 2020. It is now read-only.

Commit b7ba0ff

Browse files
committed
Update for foreign JS files
1 parent 8b1f596 commit b7ba0ff

File tree

10 files changed

+189
-4
lines changed

10 files changed

+189
-4
lines changed

.gitignore

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
output
2-
bower_components
3-
.psci
4-
.psci_modules
1+
/.*
2+
!/.gitignore
3+
!/.jscsrc
4+
!/.jshintrc
5+
!/.travis.yml
6+
/bower_components/
7+
/node_modules/
8+
/output/
9+
/tmp/

.jscsrc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"preset": "grunt",
3+
"disallowSpacesInAnonymousFunctionExpression": null,
4+
"requireSpacesInAnonymousFunctionExpression": {
5+
"beforeOpeningRoundBrace": true,
6+
"beforeOpeningCurlyBrace": true
7+
},
8+
"validateQuoteMarks": "\"",
9+
"requireCurlyBraces": null
10+
}

.jshintrc

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"bitwise": true,
3+
"eqeqeq": true,
4+
"forin": true,
5+
"freeze": true,
6+
"funcscope": true,
7+
"futurehostile": true,
8+
"globalstrict": true,
9+
"latedef": true,
10+
"maxparams": 1,
11+
"noarg": true,
12+
"nocomma": true,
13+
"nonew": true,
14+
"notypeof": true,
15+
"singleGroups": true,
16+
"undef": true,
17+
"unused": true,
18+
"eqnull": true
19+
}

.travis.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
language: node_js
2+
node_js:
3+
- 0.10
4+
env:
5+
- PATH=$HOME/purescript:$PATH
6+
install:
7+
- TAG=$(wget -q -O - https://github.com/purescript/purescript/releases/latest --server-response --max-redirect 0 2>&1 | sed -n -e 's/.*Location:.*tag\///p')
8+
- wget -O $HOME/purescript.tar.gz https://github.com/purescript/purescript/releases/download/$TAG/linux64.tar.gz
9+
- tar -xvf $HOME/purescript.tar.gz -C $HOME/
10+
- chmod a+x $HOME/purescript
11+
- npm install bower gulp -g
12+
- npm install && bower install
13+
script:
14+
- gulp

docs/Prelude.Unsafe.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Module Documentation
2+
3+

docs/Prelude.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Module Documentation
2+
3+

gulpfile.js

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
/* jshint node: true */
2+
"use strict";
3+
4+
var gulp = require("gulp");
5+
var jshint = require("gulp-jshint");
6+
var jscs = require("gulp-jscs");
7+
var plumber = require("gulp-plumber");
8+
var purescript = require("gulp-purescript");
9+
10+
var paths = [
11+
"src/**/*.purs",
12+
"bower_components/purescript-*/src/**/*.purs"
13+
];
14+
15+
gulp.task("lint", function() {
16+
return gulp.src("src/**/*.js")
17+
.pipe(jshint())
18+
.pipe(jshint.reporter())
19+
.pipe(jscs());
20+
});
21+
22+
gulp.task("make", ["lint"], function() {
23+
return gulp.src(paths)
24+
.pipe(plumber())
25+
.pipe(purescript.pscMake());
26+
});
27+
28+
var docTasks = [];
29+
30+
var docTask = function(name) {
31+
var taskName = "docs-" + name.toLowerCase();
32+
gulp.task(taskName, function () {
33+
return gulp.src("src/" + name.replace(/\./g, "/") + ".purs")
34+
.pipe(plumber())
35+
.pipe(purescript.pscDocs())
36+
.pipe(gulp.dest("docs/" + name + ".md"));
37+
});
38+
docTasks.push(taskName);
39+
};
40+
41+
["Control.Monad.Eff", "Control.Monad.Eff.Unsafe"].forEach(docTask);
42+
43+
gulp.task("docs", docTasks);
44+
45+
gulp.task("dotpsci", function () {
46+
return gulp.src(paths)
47+
.pipe(plumber())
48+
.pipe(purescript.dotPsci());
49+
});
50+
51+
gulp.task("default", ["make", "docs", "dotpsci"]);

package.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"private": true,
3+
"devDependencies": {
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.3.1"
9+
}
10+
}

src/Control/Monad/Eff.js

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
/* global exports */
2+
"use strict";
3+
4+
// module Control.Monad.Eff
5+
6+
exports.returnE = function(a) {
7+
return function() {
8+
return a;
9+
};
10+
};
11+
12+
exports.bindE = function(a) {
13+
return function(f) {
14+
return function() {
15+
return f(a())();
16+
};
17+
};
18+
};
19+
20+
exports.runPure = function(f) {
21+
return f();
22+
};
23+
24+
exports.untilE = function(f) {
25+
return function() {
26+
while (!f());
27+
return {};
28+
};
29+
};
30+
31+
exports.whileE = function(f) {
32+
return function(a) {
33+
return function() {
34+
while (f()) {
35+
a();
36+
}
37+
return {};
38+
};
39+
};
40+
};
41+
42+
exports.forE = function(lo) {
43+
return function(hi) {
44+
return function(f) {
45+
return function() {
46+
for (var i = lo; i < hi; i++) {
47+
f(i)();
48+
}
49+
};
50+
};
51+
};
52+
};
53+
54+
exports.foreachE = function(as) {
55+
return function(f) {
56+
return function() {
57+
for (var i = 0, l = as.length; i < l; i++) {
58+
f(as[i])();
59+
}
60+
};
61+
};
62+
};

src/Control/Monad/Eff/Unsafe.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/* global exports */
2+
"use strict";
3+
4+
// module Control.Monad.Eff.Unsafe where
5+
6+
exports.unsafeInterleaveEff = function(f) {
7+
return f;
8+
};

0 commit comments

Comments
 (0)