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