basement-0.0.12: Foundation scrap box of array & string
LicenseBSD-style
MaintainerFoundation
Safe HaskellNone
LanguageHaskell2010

Basement.Block.Builder

Description

Block builder

Synopsis

Documentation

data Builder #

Instances

Instances details
Semigroup Builder # 
Instance details

Defined in Basement.Block.Builder

Monoid Builder # 
Instance details

Defined in Basement.Block.Builder

run :: PrimMonad prim => Builder -> prim (Block Word8) #

run the given builder and return the generated block

Emit functions

emit :: Block a -> Builder #

add a Block in the builder

emitPrim :: (PrimType ty, ty ~ Word8) => ty -> Builder #

emitString :: String -> Builder #

add a string in the builder

emitUTF8Char :: Char -> Builder #

emit a UTF8 char in the builder

this function may be replaced by `emit :: Encoding -> Char -> Builder`

unsafe

unsafeRunString :: PrimMonad prim => Builder -> prim String #

run the given builder and return a UTF8String

this action is unsafe as there is no guarantee upon the validity of the content of the built block.