unison-util-bytes-0.0.0
Safe HaskellSafe-Inferred
LanguageHaskell2010

Unison.Util.Bytes

Synopsis

Documentation

newtype Bytes Source #

Constructors

Bytes 

Fields

Instances

Instances details
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 #

NFData Bytes Source # 
Instance details

Defined in Unison.Util.Bytes

Methods

rnf :: Bytes -> () #

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 #

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.

Orphan instances

Drop Chunk Source # 
Instance details

Methods

drop :: Int -> Chunk -> Chunk #

Reverse Chunk Source # 
Instance details

Methods

reverse :: Chunk -> Chunk #

Sized Chunk Source # 
Instance details

Methods

size :: Chunk -> Int #

Take Chunk Source # 
Instance details

Methods

take :: Int -> Chunk -> Chunk #

Index Chunk Word8 Source # 
Instance details

Methods

unsafeIndex :: Int -> Chunk -> Word8 #