This repository has been archived by the owner on Dec 18, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
249 additions
and
105 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
/.* | ||
!/.gitignore | ||
!/.jscsrc | ||
!/.jshintrc | ||
!/.travis.yml | ||
/bower_components/ | ||
/node_modules/ | ||
/output/ | ||
/tmp/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"preset": "grunt", | ||
"disallowSpacesInAnonymousFunctionExpression": null, | ||
"requireSpacesInAnonymousFunctionExpression": { | ||
"beforeOpeningRoundBrace": true, | ||
"beforeOpeningCurlyBrace": true | ||
}, | ||
"disallowSpacesInsideObjectBrackets": null, | ||
"requireSpacesInsideObjectBrackets": "all", | ||
"validateQuoteMarks": "\"", | ||
"requireCurlyBraces": null | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"bitwise": true, | ||
"eqeqeq": true, | ||
"forin": true, | ||
"freeze": true, | ||
"funcscope": true, | ||
"futurehostile": true, | ||
"globalstrict": true, | ||
"latedef": true, | ||
"maxparams": 1, | ||
"noarg": true, | ||
"nocomma": true, | ||
"nonew": true, | ||
"notypeof": true, | ||
"singleGroups": true, | ||
"undef": true, | ||
"unused": true, | ||
"eqnull": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
language: node_js | ||
node_js: | ||
- 0.10 | ||
env: | ||
- PATH=$HOME/purescript:$PATH | ||
install: | ||
- 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') | ||
- wget -O $HOME/purescript.tar.gz https://github.com/purescript/purescript/releases/download/$TAG/linux64.tar.gz | ||
- tar -xvf $HOME/purescript.tar.gz -C $HOME/ | ||
- chmod a+x $HOME/purescript | ||
- npm install bower gulp -g | ||
- npm install && bower install | ||
script: | ||
- gulp |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,15 @@ | ||
# Module Documentation | ||
# purescript-globals | ||
|
||
## Module Global | ||
[![Build Status](https://travis-ci.org/purescript/purescript-globals.svg?branch=master)](https://travis-ci.org/purescript/purescript-globals) | ||
|
||
Typed definitions for standard Javascript globals. | ||
|
||
This module defines types for some global Javascript functions | ||
and values. | ||
## Installation | ||
|
||
#### `nan` | ||
|
||
``` purescript | ||
nan :: Number | ||
``` | ||
|
||
Not a number (NaN) | ||
|
||
#### `isNaN` | ||
|
||
``` purescript | ||
isNaN :: Number -> Boolean | ||
``` | ||
|
||
Test whether a number is NaN | ||
|
||
#### `infinity` | ||
|
||
``` purescript | ||
infinity :: Number | ||
bower install purescript-globals | ||
``` | ||
|
||
Positive infinity | ||
|
||
#### `isFinite` | ||
|
||
``` purescript | ||
isFinite :: Number -> Boolean | ||
``` | ||
|
||
Test whether a number is finite | ||
|
||
#### `readInt` | ||
|
||
``` purescript | ||
readInt :: Number -> String -> Number | ||
``` | ||
|
||
Parse an integer from a `String` in the specified base | ||
|
||
#### `readFloat` | ||
|
||
``` purescript | ||
readFloat :: String -> Number | ||
``` | ||
## Module documentation | ||
|
||
Parse a floating point value from a `String` | ||
- [Global](docs/Global.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
## Module Global | ||
|
||
This module defines types for some global Javascript functions | ||
and values. | ||
|
||
#### `nan` | ||
|
||
``` purescript | ||
nan :: Number | ||
``` | ||
|
||
Not a number (NaN) | ||
|
||
#### `isNaN` | ||
|
||
``` purescript | ||
isNaN :: Number -> Boolean | ||
``` | ||
|
||
Test whether a number is NaN | ||
|
||
#### `infinity` | ||
|
||
``` purescript | ||
infinity :: Number | ||
``` | ||
|
||
Positive infinity | ||
|
||
#### `isFinite` | ||
|
||
``` purescript | ||
isFinite :: Number -> Boolean | ||
``` | ||
|
||
Test whether a number is finite | ||
|
||
#### `readInt` | ||
|
||
``` purescript | ||
readInt :: Int -> String -> Number | ||
``` | ||
|
||
Parse an integer from a `String` in the specified base | ||
|
||
#### `readFloat` | ||
|
||
``` purescript | ||
readFloat :: String -> Number | ||
``` | ||
|
||
Parse a floating point value from a `String` | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
/* jshint node: true */ | ||
"use strict"; | ||
|
||
var gulp = require("gulp"); | ||
var jshint = require("gulp-jshint"); | ||
var jscs = require("gulp-jscs"); | ||
var plumber = require("gulp-plumber"); | ||
var purescript = require("gulp-purescript"); | ||
var rimraf = require("rimraf"); | ||
var run = require("gulp-run"); | ||
|
||
var sources = [ | ||
"src/**/*.purs", | ||
"test/**/*.purs", | ||
"bower_components/purescript-*/src/**/*.purs" | ||
]; | ||
|
||
var foreigns = [ | ||
"src/**/*.js", | ||
"test/**/*.js", | ||
"bower_components/purescript-*/src/**/*.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()) | ||
.pipe(jshint.reporter()) | ||
.pipe(jscs()); | ||
}); | ||
|
||
gulp.task("make", ["lint"], function() { | ||
return gulp.src(sources) | ||
.pipe(plumber()) | ||
.pipe(purescript.pscMake({ ffi: foreigns })); | ||
}); | ||
|
||
gulp.task("docs", ["clean-docs"], function () { | ||
return gulp.src(sources) | ||
.pipe(plumber()) | ||
.pipe(purescript.pscDocs({ | ||
docgen: { | ||
"Global": "docs/Global.md" | ||
} | ||
})); | ||
}); | ||
|
||
gulp.task("dotpsci", function () { | ||
return gulp.src(sources) | ||
.pipe(plumber()) | ||
.pipe(purescript.dotPsci()); | ||
}); | ||
|
||
gulp.task("test", ["make"], function() { | ||
return gulp.src(sources.concat(["test/**/*.purs"])) | ||
.pipe(plumber()) | ||
.pipe(purescript.psc({ main: "Test.Main", ffi: foreigns })) | ||
.pipe(run("node")); | ||
}); | ||
|
||
gulp.task("default", ["make", "docs", "dotpsci", "test"]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,12 @@ | ||
{ | ||
"private": true, | ||
"dependencies": { | ||
"grunt": "~0.4.4", | ||
"grunt-purescript": "~0.6.0", | ||
"grunt-contrib-clean": "~0.5.0" | ||
"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-rc.1", | ||
"gulp-run": "~1.6.7", | ||
"rimraf": "^2.3.3" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,20 @@ | ||
/* globals exports */ | ||
"use strict"; | ||
|
||
// module Global | ||
|
||
exports.nan = NaN; | ||
|
||
exports.isNaN = isNaN; | ||
|
||
exports.infinity = Infinity; | ||
|
||
exports.readInt = function(radix) { | ||
return function(n) { | ||
exports.isFinite = isFinite; | ||
|
||
exports.readInt = function (radix) { | ||
return function (n) { | ||
return parseInt(n, radix); | ||
}; | ||
}; | ||
|
||
exports.readFloat = parseFloat; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.