Portability | portable |
---|---|
Stability | Provisional |
Maintainer | Daniel Fischer <daniel.is.fischer@googlemail.com> |
Safe Haskell | None |
Class for values to be substituted into strict and lazy ByteString
s
by the replace
functions defined in this package.
- class Substitution a where
- substitution :: a -> [ByteString] -> [ByteString]
- prependCycle :: a -> ByteString -> ByteString
Documentation
class Substitution a whereSource
Type class of meaningful substitutions for replace functions on ByteStrings. Instances for strict and lazy ByteStrings are provided here.
substitution :: a -> [ByteString] -> [ByteString]Source
transforms a value to a substitution function.
substitution
prependCycle :: a -> ByteString -> ByteStringSource
shall prepend infinitely many copies
of prependCycle
sub lazyBSsub
to lazyBS
without entering an infinite loop in case
of an empty sub
, so e.g.
prependCycle
"" "ab" == "ab"
shall (quickly) evaluate to True
.
For non-empty sub
, the cycle shall be constructed efficiently.