add monoidal unit for Bounded Builders
This commit is contained in:
parent
9a14600a38
commit
2eb37dfb7c
1 changed files with 5 additions and 0 deletions
|
@ -22,6 +22,7 @@ module Data.ByteArray.Builder.Small.Bounded
|
||||||
, pasteGrowST
|
, pasteGrowST
|
||||||
, pasteIO
|
, pasteIO
|
||||||
-- * Combine
|
-- * Combine
|
||||||
|
, empty
|
||||||
, append
|
, append
|
||||||
-- * Bounds Manipulation
|
-- * Bounds Manipulation
|
||||||
, (<=)
|
, (<=)
|
||||||
|
@ -136,6 +137,10 @@ construct f = Builder
|
||||||
|
|
||||||
infixr 9 `append`
|
infixr 9 `append`
|
||||||
|
|
||||||
|
-- | The monoidal unit of `append`
|
||||||
|
empty :: Builder 0
|
||||||
|
empty = Builder $ \_ off0 s0 -> (# s0, off0 #)
|
||||||
|
|
||||||
-- | Concatenate two builders.
|
-- | Concatenate two builders.
|
||||||
append :: Builder n -> Builder m -> Builder (n + m)
|
append :: Builder n -> Builder m -> Builder (n + m)
|
||||||
append (Builder f) (Builder g) =
|
append (Builder f) (Builder g) =
|
||||||
|
|
Loading…
Reference in a new issue