qq-bytes-1.0.0.0: QuasiQuoter for byte sequence
Copyright(c) 2024 0y2k
LicenseApache-2.0
Maintainer0y2k <0x0y2k@gmail.com>
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Bytes.QuasiQuoter

Description

Offers QuasiQuoters for byte sequence.

Synopsis

Documentation

class FromBytes a where Source #

Offers StrictByteString -> a.

Methods

fromBytes :: ByteString -> a Source #

Instances

Instances details
FromBytes ByteString Source # 
Instance details

Defined in Data.Bytes.QuasiQuoter

FromBytes ByteString Source # 
Instance details

Defined in Data.Bytes.QuasiQuoter

fromDigitWithBase :: Int -> Char -> Maybe Int Source #

Accepts '0'..'9', 'A'..'Z', 'a'..'z'. 1 <= base <= 36

strWithBase :: FromBytes a => Int -> String -> a Source #

Internal function for quasiquotes. 1 <= b <= 5

bin :: QuasiQuoter Source #

Binary string into byte sequence. Skips non-binary character. Internally means strWithBase 1.

>>> [bin|00100000|] :: BS.ByteString
" "

hex :: QuasiQuoter Source #

Hex string into byte sequence. Skips non-hex character. Internally means strWithBase 4.

>>> [hex|48 65 6c 6c 6f|] :: BS.ByteString
"Hello"