Skip to content

Commit

Permalink
Add Uniform instance for Seed
Browse files Browse the repository at this point in the history
  • Loading branch information
lehins committed Feb 4, 2024
1 parent 6da645b commit 8aea80e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/System/Random/Seed.hs
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,8 @@ instance SeedGen SM32.SMGen where
writeWord64LE mba 0 w64
freezeMutableByteArray mba

instance SeedGen g => Uniform (Seed g) where
uniformM = fmap Seed . uniformByteArrayM False (seedSize @g)

-- | Get the expected size of the `Seed` in number bytes
--
Expand Down

0 comments on commit 8aea80e

Please sign in to comment.