bytepatch-0.4.0: Patch byte-representable data in a bytestream
Safe HaskellSafe-Inferred
LanguageHaskell2010

StreamPatch.Patch.Linearize.Insert

Synopsis

Documentation

linearize :: (Integral sf, Integral st) => (a -> sf) -> (st -> a -> b) -> [a] -> Either (a, a) (Maybe (a, [b])) Source #

Linearize some list of as.

For non-empty lists, the result is a tuple of the first a, followed by the linearized as (converted to b). Linearized values are non-negative, so natural-like types are safe to use for st.

linearize' :: (Integral sf, Integral st) => [sf] -> Either (sf, sf) (Maybe (sf, [st])) Source #