Safe Haskell | Safe-Inferred |
---|
Definition for the type of indices.
I think index type can change over time, so I made that little file with type definition and class that allows one's code to work with different index types.
On the second thought it looks like overengineering. Let it be.
- type Index = Int64
- class Bits index => RandomIndex index where
- randomIndex :: RandomGen g => index -> g -> (index, g)
Documentation
class Bits index => RandomIndex index whereSource
randomIndex :: RandomGen g => index -> g -> (index, g)Source
Generate random index. Accepts max value and generator. Returns random index and updated generator. Max value should be power of 2 (valid for Graph500 generator).