unison-util-bytes-0.0.0
Safe HaskellNone
LanguageHaskell2010

Unison.Util.Bytes

Synopsis

Documentation

newtype Bytes Source #

Constructors

Bytes 

Fields

Instances

Instances details
NFData Bytes Source # 
Instance details

Defined in Unison.Util.Bytes

Methods

rnf :: Bytes -> () #

Monoid Bytes Source # 
Instance details

Defined in Unison.Util.Bytes

Methods

mempty :: Bytes #

mappend :: Bytes -> Bytes -> Bytes #

mconcat :: [Bytes] -> Bytes #

Semigroup Bytes Source # 
Instance details

Defined in Unison.Util.Bytes

Methods

(<>) :: Bytes -> Bytes -> Bytes #

sconcat :: NonEmpty Bytes -> Bytes #

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

Show Bytes Source # 
Instance details

Defined in Unison.Util.Bytes

Methods

showsPrec :: Int -> Bytes -> ShowS #

show :: Bytes -> String #

showList :: [Bytes] -> ShowS #

Eq Bytes Source # 
Instance details

Defined in Unison.Util.Bytes

Methods

(==) :: Bytes -> Bytes -> Bool #

(/=) :: Bytes -> Bytes -> Bool #

Ord Bytes Source # 
Instance details

Defined in Unison.Util.Bytes

Methods

compare :: Bytes -> Bytes -> Ordering #

(<) :: Bytes -> Bytes -> Bool #

(<=) :: Bytes -> Bytes -> Bool #

(>) :: Bytes -> Bytes -> Bool #

(>=) :: Bytes -> Bytes -> Bool #

max :: Bytes -> Bytes -> Bytes #

min :: Bytes -> Bytes -> Bytes #

data Chunk Source #

Constructors

Chunk 

Fields

Instances

Instances details
Monoid Chunk Source # 
Instance details

Defined in Unison.Util.Bytes

Methods

mempty :: Chunk #

mappend :: Chunk -> Chunk -> Chunk #

mconcat :: [Chunk] -> Chunk #

Semigroup Chunk Source # 
Instance details

Defined in Unison.Util.Bytes

Methods

(<>) :: Chunk -> Chunk -> Chunk #

sconcat :: NonEmpty Chunk -> Chunk #

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

Eq Chunk Source # 
Instance details

Defined in Unison.Util.Bytes

Methods

(==) :: Chunk -> Chunk -> Bool #

(/=) :: Chunk -> Chunk -> Bool #

Ord Chunk Source # 
Instance details

Defined in Unison.Util.Bytes

Methods

compare :: Chunk -> Chunk -> Ordering #

(<) :: Chunk -> Chunk -> Bool #

(<=) :: Chunk -> Chunk -> Bool #

(>) :: Chunk -> Chunk -> Bool #

(>=) :: Chunk -> Chunk -> Bool #

max :: Chunk -> Chunk -> Chunk #

min :: Chunk -> Chunk -> Chunk #

Drop Chunk Source # 
Instance details

Defined in Unison.Util.Bytes

Methods

drop :: Int -> Chunk -> Chunk #

Reverse Chunk Source # 
Instance details

Defined in Unison.Util.Bytes

Methods

reverse :: Chunk -> Chunk #

Sized Chunk Source # 
Instance details

Defined in Unison.Util.Bytes

Methods

size :: Chunk -> Int #

Take Chunk Source # 
Instance details

Defined in Unison.Util.Bytes

Methods

take :: Int -> Chunk -> Chunk #

Index Chunk Word8 Source # 
Instance details

Defined in Unison.Util.Bytes

Methods

unsafeIndex :: Int -> Chunk -> Word8 #

decodeUtf8 :: ByteString -> Text #

Decode a ByteString containing UTF-8 encoded text that is known to be valid.

If the input contains any invalid UTF-8 data, an exception will be thrown that cannot be caught in pure code. For more control over the handling of invalid data, use decodeUtf8' or decodeUtf8With.

This is a partial function: it checks that input is a well-formed UTF-8 sequence and copies buffer or throws an error otherwise.

encodeUtf8 :: Text -> ByteString #

Encode text using UTF-8 encoding.