iota-0.1.0.0
Safe HaskellSafe-Inferred
LanguageGHC2021

Data.Monoid.RollingHash

Synopsis

Documentation

newtype RollingHashBuilder b Source #

b should be a primitive root of 2^61-1

>>> :set -XDataKinds -XOverloadedStrings
>>> runRollingHashBuilder @2047 $ "abc" <> "def"
1182147938584434692
>>> runRollingHashBuilder @2047 "abcdef"
1182147938584434692
>>> mempty @(RollingHashBuilder 2047)
Affine {getAffine1 = 1, getAffine0 = 0}

Constructors

RHB (Affine (RollingHash b)) 

Instances

Instances details
Vector Vector (RollingHashBuilder b) Source # 
Instance details

Defined in Data.Monoid.RollingHash

Methods

basicUnsafeFreeze :: Mutable Vector s (RollingHashBuilder b) -> ST s (Vector (RollingHashBuilder b))

basicUnsafeThaw :: Vector (RollingHashBuilder b) -> ST s (Mutable Vector s (RollingHashBuilder b))

basicLength :: Vector (RollingHashBuilder b) -> Int

basicUnsafeSlice :: Int -> Int -> Vector (RollingHashBuilder b) -> Vector (RollingHashBuilder b)

basicUnsafeIndexM :: Vector (RollingHashBuilder b) -> Int -> Box (RollingHashBuilder b)

basicUnsafeCopy :: Mutable Vector s (RollingHashBuilder b) -> Vector (RollingHashBuilder b) -> ST s ()

elemseq :: Vector (RollingHashBuilder b) -> RollingHashBuilder b -> b0 -> b0

MVector MVector (RollingHashBuilder b) Source # 
Instance details

Defined in Data.Monoid.RollingHash

Methods

basicLength :: MVector s (RollingHashBuilder b) -> Int

basicUnsafeSlice :: Int -> Int -> MVector s (RollingHashBuilder b) -> MVector s (RollingHashBuilder b)

basicOverlaps :: MVector s (RollingHashBuilder b) -> MVector s (RollingHashBuilder b) -> Bool

basicUnsafeNew :: Int -> ST s (MVector s (RollingHashBuilder b))

basicInitialize :: MVector s (RollingHashBuilder b) -> ST s ()

basicUnsafeReplicate :: Int -> RollingHashBuilder b -> ST s (MVector s (RollingHashBuilder b))

basicUnsafeRead :: MVector s (RollingHashBuilder b) -> Int -> ST s (RollingHashBuilder b)

basicUnsafeWrite :: MVector s (RollingHashBuilder b) -> Int -> RollingHashBuilder b -> ST s ()

basicClear :: MVector s (RollingHashBuilder b) -> ST s ()

basicSet :: MVector s (RollingHashBuilder b) -> RollingHashBuilder b -> ST s ()

basicUnsafeCopy :: MVector s (RollingHashBuilder b) -> MVector s (RollingHashBuilder b) -> ST s ()

basicUnsafeMove :: MVector s (RollingHashBuilder b) -> MVector s (RollingHashBuilder b) -> ST s ()

basicUnsafeGrow :: MVector s (RollingHashBuilder b) -> Int -> ST s (MVector s (RollingHashBuilder b))

KnownNat b => IsString (RollingHashBuilder b) Source # 
Instance details

Defined in Data.Monoid.RollingHash

Monoid (RollingHashBuilder b) Source # 
Instance details

Defined in Data.Monoid.RollingHash

Semigroup (RollingHashBuilder b) Source # 
Instance details

Defined in Data.Monoid.RollingHash

Show (RollingHashBuilder b) Source # 
Instance details

Defined in Data.Monoid.RollingHash

Eq (RollingHashBuilder b) Source # 
Instance details

Defined in Data.Monoid.RollingHash

Unbox (RollingHashBuilder b) Source # 
Instance details

Defined in Data.Monoid.RollingHash

newtype MVector s (RollingHashBuilder b) Source # 
Instance details

Defined in Data.Monoid.RollingHash

newtype MVector s (RollingHashBuilder b) = MV_RollingHashBuilder (MVector s (Affine (RollingHash b)))
newtype Vector (RollingHashBuilder b) Source # 
Instance details

Defined in Data.Monoid.RollingHash

newtype Vector (RollingHashBuilder b) = V_RollingHashBuilder (Vector (Affine (RollingHash b)))

singletonRHB :: forall b. KnownNat b => Int -> RollingHashBuilder b Source #

>>> :set -XDataKinds
>>> singletonRHB @2047 123
Affine {getAffine1 = 2047, getAffine0 = 123}