basement-0.0.7: Foundation scrap box of array & string

LicenseBSD-style
MaintainerFoundation
Safe HaskellNone
LanguageHaskell2010

Basement.Block.Builder

Contents

Description

Block builder

Synopsis

Documentation

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

run the given builder and return the generated block

Emit functions

emit :: Block a -> Builder Source #

add a Block in the builder

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

emitString :: String -> Builder Source #

add a string in the builder

emitUTF8Char :: Char -> Builder Source #

emit a UTF8 char in the builder

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

unsafe

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

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.