You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
read :: StdGen fails for strings longer than 6 #59
The documentation in read or in random. ?
I do strongly recommend using the pcg package for Rng engineering today.
The next major release of random will have pcg as one of the default
options.
I’m not sure what you’re trying to do with reading here? It doesn’t look
like a deserialize to me ?
On Tue, Mar 10, 2020 at 11:11 AM Joey Hess ***@***.***> wrote:
ghci> read "abcdef" :: StdGen
36217 1
ghci> read "abcdefg" :: StdGen
** * Exception: Prelude.read: no parse
This is contrary to the documentation: "It guarantees to succeed on any
string. "
random-1.1
ghc-8.6.5
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#59?email_source=notifications&email_token=AAABBQRKBWU3ALRGQMBFVTDRGZKDHA5CNFSM4LFBHSFKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4IT5RK4Q>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAABBQVSK57MZW4LJT2ILG3RGZKDHANCNFSM4LFBHSFA>
.
What’s the intent or goal you want to achieve here ? That can help inform
some of the planned new library work
On Tue, Mar 10, 2020 at 11:51 AM Carter Schonwald <
[email protected]> wrote:
The documentation in read or in random. ?
I do strongly recommend using the pcg package for Rng engineering today.
The next major release of random will have pcg as one of the default
options.
I’m not sure what you’re trying to do with reading here? It doesn’t look
like a deserialize to me ?
On Tue, Mar 10, 2020 at 11:11 AM Joey Hess ***@***.***>
wrote:
> ghci> read "abcdef" :: StdGen
> 36217 1
> ghci> read "abcdefg" :: StdGen
> ** * Exception: Prelude.read: no parse
>
> This is contrary to the documentation: "It guarantees to succeed on any
> string. "
>
> random-1.1
> ghc-8.6.5
>
> —
> You are receiving this because you are subscribed to this thread.
> Reply to this email directly, view it on GitHub
> <#59?email_source=notifications&email_token=AAABBQRKBWU3ALRGQMBFVTDRGZKDHA5CNFSM4LFBHSFKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4IT5RK4Q>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AAABBQVSK57MZW4LJT2ILG3RGZKDHANCNFSM4LFBHSFA>
> .
>
In addition, 'reads' may be used to map an arbitrary string (not necessarily one produced by 'show') onto a value of type 'StdGen'. In general, the 'Read' instance of 'StdGen' has the following properties:
It guarantees to succeed on any string.
It guarantees to consume only a finite portion of the string.
Different argument strings are likely to result in different results.
This is a weird thing to do with reads. Removing the broken Read instance for StdGen is a reasonable solution and deleting the associated documentation would be a reasonable fix.
Activity
cartazio commentedon Mar 10, 2020
cartazio commentedon Mar 10, 2020
andrewthad commentedon Mar 10, 2020
It's a guarantee provided in the docs for random:
This is a weird thing to do with
reads. Removing the brokenReadinstance forStdGenis a reasonable solution and deleting the associated documentation would be a reasonable fix.cartazio commentedon Mar 10, 2020
idontgetoutmuch commentedon Mar 11, 2020
I'd recommend using splitmix as
splitfunctionSee here for the details on speed and quality (which you can run yourself ):
cartazio commentedon Mar 11, 2020
curiousleo commentedon Mar 11, 2020
SplitMix passes all BigCrush tests: https://github.com/tweag/random-quality/blob/master/results/splitmix-word32-testu01-bigcrush#L3775-L3782
StdGen: constructor accessible via Internal only
StdGen: constructor accessible via Internal only
StdGen: constructor accessible via Internal only
StdGen: constructor accessible via Internal only
StdGen: constructor accessible via Internal only (#123)
StdGen: constructor accessible via Internal only (#123)
StdGen: constructor accessible via Internal only (#123)
StdGen: constructor accessible via Internal only (#123)
1 remaining item
parent cfdfe6f
parent cfdfe6f
Fix quality and performance issues, add monadic API
Fix quality and performance issues, add monadic API
Fix quality and performance issues, add monadic API
Fix quality and performance issues, add monadic API
Fix quality and performance issues, add monadic API
Fix quality and performance issues, add monadic API
Fix quality and performance issues, add monadic API
Fix quality and performance issues, add monadic API
Fix quality and performance issues, add monadic API
Fix quality and performance issues, add monadic API
lehins commentedon Jun 23, 2020
Fixed.
Readinstance was removed inrandom-1.2. See #62