| Copyright | Copyright © 2019-2021 Lars Kuhtz <lakuhtz@gmail.com> |
|---|---|
| License | BSD3 |
| Maintainer | Lars Kuhtz <lakuhtz@gmail.com> |
| Stability | experimental |
| Safe Haskell | None |
| Language | Haskell2010 |
Data.Cuckoo.Internal
Description
Internal Utilities. No guarantee is made about the stability of these functions. Changes to these function won't be announced in the CHANGELOG and are not reflected in the package version.
Synopsis
- w :: forall (n :: Nat). KnownNat n => Int
- int :: Integral a => Num b => a -> b
- fit :: Real a => Real b => Integral c => a -> b -> c
- intFit :: Integral a => Integral b => a -> b -> a
- nextPowerOfTwo :: Real a => Integral b => a -> b
- intNextPowerOfTwo :: Int -> Int
- set :: PrimMonad m => MutableByteArray (PrimState m) -> Int -> Word64 -> m ()
- get :: PrimMonad m => MutableByteArray (PrimState m) -> Int -> m Word64
Documentation
fit :: Real a => Real b => Integral c => a -> b -> c Source #
fit a b computes how many bs are needed to fit a, i.e.
\(\left\lceil\frac{a}{b}\right\rceil\).
For instance,
>>>fit 7 33
>>>fit 6 32
intFit :: Integral a => Integral b => a -> b -> a Source #
fit a b computes how many bs are needed to fit a, i.e.
\(\left\lceil\frac{a}{b}\right\rceil\).
For instance,
>>>intFit 7 33
>>>intFit 6 32
nextPowerOfTwo :: Real a => Integral b => a -> b Source #
nextPowerOfTwo a computes the smallest power of two that is larger or
equal than a.
intNextPowerOfTwo :: Int -> Int Source #
nextPowerOfTwo a computes the smallest power of two that is larger or
equal than a.
Arguments
| :: PrimMonad m | |
| => MutableByteArray (PrimState m) | |
| -> Int | index in terms of |
| -> Word64 |
|
| -> m () |
Write a Word64 value into a Word32 aligned MutableByteArray