random-fu-0.3.0.1: Random number generation

Safe Haskell | None
Language | Haskell2010

Data.Random.Internal.Fixed

Synopsis

- resolutionOf :: HasResolution r => f r -> Integer
- resolutionOf2 :: HasResolution r => f (g r) -> Integer
- mkFixed :: Integer -> Fixed r
- unMkFixed :: Fixed r -> Integer

# Documentation

resolutionOf :: HasResolution r => f r -> Integer Source #

resolutionOf2 :: HasResolution r => f (g r) -> Integer Source #

mkFixed :: Integer -> Fixed r Source #

The `Fixed` type doesn't expose its constructors, but I need a way to convert them to and from their raw representation in order to sample them. As long as `Fixed` is a newtype wrapping `Integer`, `mkFixed` and `unMkFixed` as defined here will work. Both are implemented using `unsafeCoerce`.

unMkFixed :: Fixed r -> Integer Source #