Open curiousleo opened 4 years ago
https://github.com/bos/mwc-random/compare/master...curiousleo:random-v1.2-compat?expand=1 fails to build with
mwc-random/System/Random/MWC.hs:414:28: error:
Multiple declarations of ‘Seed’
Declared at: System/Random/MWC.hs:389:16
System/Random/MWC.hs:414:28
|
414 | newtype Frozen (Gen s) = Seed
| ^^^^
I don't know how to fix that.
@curiousleo It is a newtype
, so you need to wrap with a constructor.
@curiousleo It is a
newtype
, so you need to wrap with a constructor.
Fixed. Thanks!
Should we close this or use it to track
Alright gentleman, I implemented some benchmarks for all pure RNGs available in Haskell and results are pretty impressive. Here is a PR and a branch that you can use to run benchmarks for both random-1.1 and random-1.2: lehins/haskell-benchmarks#7
Here are also all the repo's with fixed RandomGen
instances:
It is pretty cool that changes were incredibly minimal and all of them are backwards compatible.
To run benchmarks:
$ cd haskell-benchmarks/new-random-benchmarks/
$ stack bench --ba '--output old-random-word16.html --match prefix Pure/Word16' --stack-yaml stack-old-random.yaml
$ stack bench --ba '--output new-random-word16.html --match prefix Pure/Word16'
And so on for other types. (It's possible to run them all at once, but I find the plots bit noisy that way)
Next in line are stateful RNGs, but those I think I'll do some time later.
Alright gentleman, I implemented some benchmarks for all pure RNGs available in Haskell and results are pretty impressive. Here is a PR and a branch that you can use to run benchmarks for both random-1.1 and random-1.2: lehins/haskell-benchmarks#7
Here are also all the repo's with fixed
RandomGen
instances:* [lehins/Xorshift#1](https://github.com/lehins/Xorshift/pull/1) * [lehins/mersenne-random-pure64#1](https://github.com/lehins/mersenne-random-pure64/pull/1) * [lehins/tf-random#1](https://github.com/lehins/tf-random/pull/1) * [lehins/pcg-random#1](https://github.com/lehins/pcg-random/pull/1) * [lehins/pcgen#1](https://github.com/lehins/pcgen/pull/1)
It is pretty cool that changes were incredibly minimal and all of them are backwards compatible.
This is fantastic!
Next in line are stateful RNGs, but those I think I'll do some time later.
I would also be interested in benchmarks for uniformRM
since we put a lot of effort into optimising the range algorithms.
To avoid duplication of work, let's track work we've done to make PRNG libraries compatible with the
interface-to-performance
branch here.Feel free to edit this description directly.
splitmix
: https://github.com/lehins/splitmix/tree/new-random (diff)RandomGen
Prim
pcgen
: https://github.com/curiousleo/pcgen/tree/new-random (diff)RandomGen
Prim
mwc-random
: WIP https://github.com/curiousleo/mwc-random/tree/random-v1.2-compat (diff)MonadRandom
random-fu
: does not depend onrandom
; usesrandom-source
to abstract over concrete PRNGsQuickCheck
: builds withStdGen
fromrandom v1.1
on non-GHC platforms. That won't work withrandom v1.2
.hedgehog
: requiresinstance UniformRange Integer
which is currently missing.random v1.2
random v1.2
: missinginstance UniformRange Integer