Skip to content

Make a better story for split #97

Description

@treeowl

I think we should look to Data.Bits for inspiration here. Add a class

class RandomGen g => SplittableRandomGen g where
  safeSplit :: g -> (g, g)

safeSplit is the same as split, except it should only be defined for generators that are actually splittable.

Question: can we improve efficiency or flexibility for any mutable generators by offering something like this?

class StatefulGen g m => SplittableStatefulGen g m where
  splitStatefulGenM :: g -> m g

I imagine this might be able to avoid some unnecessary copying in some cases.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions