{-# LANGUAGE CPP #-}
module Data.Random.Internal.Fixed where
import Data.Fixed
import Unsafe.Coerce
#ifdef old_Fixed
resolutionOf :: HasResolution r => f r -> Integer
resolutionOf x = resolution (res x)
where
res :: HasResolution r => f r -> r
res = undefined
resolutionOf2 :: HasResolution r => f (g r) -> Integer
resolutionOf2 x = resolution (res x)
where
res :: HasResolution r => f (g r) -> r
res = undefined
#else
resolutionOf :: HasResolution r => f r -> Integer
resolutionOf :: forall r (f :: * -> *). HasResolution r => f r -> Integer
resolutionOf = forall k (a :: k) (p :: k -> *). HasResolution a => p a -> Integer
resolution
resolutionOf2 :: HasResolution r => f (g r) -> Integer
resolutionOf2 :: forall r (f :: * -> *) (g :: * -> *).
HasResolution r =>
f (g r) -> Integer
resolutionOf2 f (g r)
x = forall k (a :: k) (p :: k -> *). HasResolution a => p a -> Integer
resolution (forall r (f :: * -> *) (g :: * -> *).
HasResolution r =>
f (g r) -> g r
res f (g r)
x)
where
res :: HasResolution r => f (g r) -> g r
res :: forall r (f :: * -> *) (g :: * -> *).
HasResolution r =>
f (g r) -> g r
res = forall a. HasCallStack => a
undefined
#endif
mkFixed :: Integer -> Fixed r
mkFixed :: forall r. Integer -> Fixed r
mkFixed = forall a b. a -> b
unsafeCoerce
unMkFixed :: Fixed r -> Integer
unMkFixed :: forall r. Fixed r -> Integer
unMkFixed = forall a b. a -> b
unsafeCoerce