Safe Haskell | None |
---|---|
Language | GHC2021 |
Synopsis
- newtype RollingHashBuilder (b :: Nat) = RHB (Affine (RollingHash b))
- runRollingHashBuilder :: forall (b :: Nat). RollingHashBuilder b -> RollingHash b
- singletonRHB :: forall (b :: Nat). KnownNat b => Int -> RollingHashBuilder b
Documentation
newtype RollingHashBuilder (b :: Nat) 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}
RHB (Affine (RollingHash b)) |
Instances
runRollingHashBuilder :: forall (b :: Nat). RollingHashBuilder b -> RollingHash b Source #
singletonRHB :: forall (b :: Nat). KnownNat b => Int -> RollingHashBuilder b Source #
>>>
:set -XDataKinds
>>>
singletonRHB @2047 123
Affine {getAffine1 = 2047, getAffine0 = 123}