https://github.com/tlewowski/purescript-prng
Pseudo-random number generators for PureScript
https://github.com/tlewowski/purescript-prng
Last synced: 4 months ago
JSON representation
Pseudo-random number generators for PureScript
- Host: GitHub
- URL: https://github.com/tlewowski/purescript-prng
- Owner: tlewowski
- License: mit
- Created: 2016-12-01T22:04:45.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-07-18T00:13:32.000Z (almost 9 years ago)
- Last Synced: 2026-02-20T19:00:13.619Z (4 months ago)
- Language: PureScript
- Homepage:
- Size: 15.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# purescript-prng
## Introduction
Pseudo-random numbers are deterministic functions, used to simulate random
number generation. Decades of statistical research was done to create reasonable
tests for randomness, and more details about the idea can be found at https://en.wikipedia.org/wiki/Pseudorandom_number_generator
This library provides a type class for pseudo-random number generators (PRNGs) similar to
Haskell's `System.Random.RandomGen` class, but simplified (range is always full `Int` range,
no `split` function provided for multiplicating number of PRNGs).
None of the implemented generators is a cryptographically-secure PRNG. If you need one,
you can either roll out your own, bind to JS via FFI or at least let me know that you
need it via GitHub issues.
It is probable that this implementation is not very efficient - it uses bitwise operations
bound to JavaScript via FFI, which may cause a lot of overheard (for creating unary functions etc.).
## Installation
```
bower install purescript-prng
```
## Documentation
Module API documentation is [published on Pursuit](http://pursuit.purescript.org/packages/purescript-prng).