Skip to content

Update build #15

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 24, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .jscsrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"preset": "grunt",
"disallowSpacesInFunctionExpression": null,
"requireSpacesInFunctionExpression": {
"beforeOpeningRoundBrace": true,
"beforeOpeningCurlyBrace": true
},
"disallowSpacesInAnonymousFunctionExpression": null,
"requireSpacesInAnonymousFunctionExpression": {
"beforeOpeningRoundBrace": true,
Expand Down
5 changes: 3 additions & 2 deletions .jshintrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"freeze": true,
"funcscope": true,
"futurehostile": true,
"globalstrict": true,
"strict": "global",
"latedef": true,
"maxparams": 1,
"noarg": true,
Expand All @@ -15,5 +15,6 @@
"singleGroups": true,
"undef": true,
"unused": true,
"eqnull": true
"eqnull": true,
"predef": ["exports"]
}
16 changes: 13 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,24 @@
language: node_js
sudo: false
node_js:
- 0.10
sudo: required
dist: trusty
node_js: 5
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 -g bower
- npm install
- bower install
script:
- npm run build
after_success:
- >-
test $TRAVIS_TAG &&
psc-publish > .pursuit.json &&
curl -X POST http://pursuit.purescript.org/packages \
-d @.pursuit.json \
-H 'Accept: application/json' \
-H "Authorization: token ${GITHUB_TOKEN}"
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ Random value generation.
bower install purescript-random
```

## Module documentation
## Documentation

- [Control.Monad.Eff.Random](docs/Control/Monad/Eff/Random.md)
Module documentation is [published on Pursuit](http://pursuit.purescript.org/packages/purescript-random).
9 changes: 3 additions & 6 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
"name": "purescript-random",
"homepage": "https://github.com/purescript/purescript-random",
"description": "Random value generation",
"keywords": [
"purescript"
],
"license": "MIT",
"repository": {
"type": "git",
Expand All @@ -20,8 +17,8 @@
"package.json"
],
"dependencies": {
"purescript-eff": "^0.1.0",
"purescript-integers": "^0.2.1",
"purescript-math": "^0.2.0"
"purescript-eff": "^1.0.0-rc.1",
"purescript-integers": "^1.0.0-rc.1",
"purescript-math": "^1.0.0-rc.1"
}
}
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"private": true,
"scripts": {
"postinstall": "pulp dep install",
"build": "jshint src && jscs src && pulp build && rimraf docs && pulp docs"
"clean": "rimraf output && rimraf .pulp-cache",
"build": "jshint src && jscs src && pulp build"
},
"devDependencies": {
"jscs": "^1.13.1",
"jshint": "^2.8.0",
"pulp": "^4.0.2",
"rimraf": "^2.4.1"
"jscs": "^2.8.0",
"jshint": "^2.9.1",
"pulp": "^8.1.0",
"rimraf": "^2.5.0"
}
}
9 changes: 5 additions & 4 deletions src/Control/Monad/Eff/Random.purs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
module Control.Monad.Eff.Random where

import Prelude ((<), (<$>), (-), (+), (*), return, bind, ($), one)
import Prelude

import Control.Monad.Eff (Eff)

import Control.Monad.Eff (Eff())
import Data.Int (toNumber, floor)

-- | The `RANDOM` effect indicates that an Eff action may access or modify the
Expand All @@ -27,7 +28,7 @@ randomInt :: forall e. Int -> Int -> Eff (random :: RANDOM | e) Int
randomInt low high = do
n <- random
let asNumber = (toNumber high - toNumber low + one) * n + toNumber low
return $ floor asNumber
pure $ floor asNumber

-- | Returns a random number between a minimum value (inclusive) and a maximum
-- | value (exclusive). It is unspecified what happens if `maximum < minimum`.
Expand All @@ -40,7 +41,7 @@ randomInt low high = do
randomRange :: forall e. Number -> Number -> Eff (random :: RANDOM | e) Number
randomRange min max = do
n <- random
return (n * (max - min) + min)
pure (n * (max - min) + min)

-- | Returns a random boolean value with an equal chance of being `true` or
-- | `false`.
Expand Down