render-utf8-0.1.0.0: Simple Utf8 wrapper for ByteString Builder with conversion classes

Safe HaskellNone
LanguageHaskell2010

Text.Utf8

Contents

Synopsis

Overview

This module provides a standalone package for a wrapped ByteString Builder for working with UTF-8 encode byte strings. It is adaped from the Utf8Builder type and Display clas from the rio package, and the FromBuilder class of the fmt package, while endeavouring to integrate the fmt types and clases to allow easy interoperation between both systems.

Utf8

newtype Utf8 Source #

a UTF-8 encoded ByteString Builder

Constructors

Utf8 

Fields

Instances
IsString Utf8 Source # 
Instance details

Defined in Text.Utf8

Methods

fromString :: String -> Utf8 #

Semigroup Utf8 Source # 
Instance details

Defined in Text.Utf8

Methods

(<>) :: Utf8 -> Utf8 -> Utf8 #

sconcat :: NonEmpty Utf8 -> Utf8 #

stimes :: Integral b => b -> Utf8 -> Utf8 #

Monoid Utf8 Source # 
Instance details

Defined in Text.Utf8

Methods

mempty :: Utf8 #

mappend :: Utf8 -> Utf8 -> Utf8 #

mconcat :: [Utf8] -> Utf8 #

FromBuilder Utf8 Source # 
Instance details

Defined in Text.Utf8

Methods

fromBuilder :: Builder -> Utf8 #

Buildable Utf8 Source # 
Instance details

Defined in Text.Utf8

Methods

build :: Utf8 -> Builder #

Renderable Utf8 Source # 
Instance details

Defined in Text.Utf8

FromUtf8 Utf8 Source # 
Instance details

Defined in Text.Utf8

Methods

cvt :: Utf8 -> Utf8 Source #

FromUtf8

class FromUtf8 a where Source #

for converting Utf8 into other text types

Methods

cvt :: Utf8 -> a Source #

make a Utf8 into whatever text type you need it to be

Instances
FromUtf8 ByteString Source # 
Instance details

Defined in Text.Utf8

Methods

cvt :: Utf8 -> ByteString Source #

FromUtf8 ByteString Source # 
Instance details

Defined in Text.Utf8

Methods

cvt :: Utf8 -> ByteString Source #

FromUtf8 Builder Source # 
Instance details

Defined in Text.Utf8

Methods

cvt :: Utf8 -> Builder Source #

FromUtf8 Text Source # 
Instance details

Defined in Text.Utf8

Methods

cvt :: Utf8 -> Text Source #

FromUtf8 Builder Source # 
Instance details

Defined in Text.Utf8

Methods

cvt :: Utf8 -> Builder Source #

FromUtf8 Text Source # 
Instance details

Defined in Text.Utf8

Methods

cvt :: Utf8 -> Text Source #

FromUtf8 Utf8 Source # 
Instance details

Defined in Text.Utf8

Methods

cvt :: Utf8 -> Utf8 Source #

a ~ Char => FromUtf8 [a] Source # 
Instance details

Defined in Text.Utf8

Methods

cvt :: Utf8 -> [a] Source #

a ~ () => FromUtf8 (IO a) Source # 
Instance details

Defined in Text.Utf8

Methods

cvt :: Utf8 -> IO a Source #

cvtLn :: FromUtf8 a => Utf8 -> a Source #

add a newline to the Utf8 before converting it

Renderable

class Renderable a where Source #

for rendering things into Utf8

Minimal complete definition

Nothing

Methods

render :: a -> Utf8 Source #

render a into a Utf8

renderText :: a -> Text Source #

render a into a Text

Instances
Renderable Char Source # 
Instance details

Defined in Text.Utf8

Renderable Double Source # 
Instance details

Defined in Text.Utf8

Renderable Float Source # 
Instance details

Defined in Text.Utf8

Renderable Int Source # 
Instance details

Defined in Text.Utf8

Renderable Int8 Source # 
Instance details

Defined in Text.Utf8

Renderable Int16 Source # 
Instance details

Defined in Text.Utf8

Renderable Int32 Source # 
Instance details

Defined in Text.Utf8

Renderable Int64 Source # 
Instance details

Defined in Text.Utf8

Renderable Integer Source # 
Instance details

Defined in Text.Utf8

Renderable Word Source # 
Instance details

Defined in Text.Utf8

Renderable Word8 Source # 
Instance details

Defined in Text.Utf8

Renderable Word16 Source # 
Instance details

Defined in Text.Utf8

Renderable Word32 Source # 
Instance details

Defined in Text.Utf8

Renderable Word64 Source # 
Instance details

Defined in Text.Utf8

Renderable IOException Source # 
Instance details

Defined in Text.Utf8

Renderable SomeException Source # 
Instance details

Defined in Text.Utf8

Renderable Text Source # 
Instance details

Defined in Text.Utf8

Renderable Builder Source # 
Instance details

Defined in Text.Utf8

Renderable Text Source # 
Instance details

Defined in Text.Utf8

Renderable Utf8 Source # 
Instance details

Defined in Text.Utf8

Toolkit Functions

renderShowable :: Show a => a -> Utf8 Source #

show into Utf8

unsafeInjectByteStringIntoUtf8 :: ByteString -> Utf8 Source #

Convert a ByteString into a Utf8; NB, if the ByteString contains text using a non-UTF-8 encoding then 'bad things' (TM) are liable to happen

utf8ToText :: Utf8 -> Text Source #

Convert a Utf8 value into a strict Text.

utf8ToLazyText :: Utf8 -> Text Source #

Convert a Utf8 value into a lazy Text.

writeFileUtf8 :: MonadIO m => FilePath -> Utf8 -> m () Source #

Write Utf8 to file.