cuckoo-0.3.1: Haskell Implementation of Cuckoo Filters
CopyrightCopyright © 2019-2021 Lars Kuhtz <lakuhtz@gmail.com>
LicenseBSD3
MaintainerLars Kuhtz <lakuhtz@gmail.com>
Stabilityexperimental
Safe HaskellNone
LanguageHaskell2010

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

Documentation

w :: forall (n :: Nat). KnownNat n => Int Source #

Reify type level Nat into Int value.

int :: Integral a => Num b => a -> b Source #

An shorter alias for fromIntegral.

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 3
3
>>> fit 6 3
2

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 3
3
>>> intFit 6 3
2

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.

set Source #

Arguments

:: PrimMonad m 
=> MutableByteArray (PrimState m) 
-> Int

index in terms of Word32

-> Word64

Word64 value that is written

-> m () 

Write a Word64 value into a Word32 aligned MutableByteArray

get Source #

Arguments

:: PrimMonad m 
=> MutableByteArray (PrimState m)

byte array

-> Int

index in terms of Word32

-> m Word64

Word64 value that contains the result bits

Get a Word64 from a Word32 aligned MutableByteArray.