Skip to content

mkStdGen should take a Word64 instead of an Int #141

@ramirez7

Description

@ramirez7

I want to deterministically seed with mkStdGen based on some unique bits I have (some UUID). I noticed that mkStdGen take Int and then fromIntegrals it to a Word64, which splitmix actually uses.

Why not just expose the Word64 seeding function directly? I'd like to very explicitly provide 64 bits.

For now, I can either just do my stuff in Word32/Word64 and fromIntegral myself. Or I can do bit stuff and do split binary search.

If backwards compat is the issue, I suggest mkStdGenW64 :: Word64 -> StdGen (maybe I'll provide a PR myself?)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions