Copyright | (c) 2024 0y2k |
---|---|
License | Apache-2.0 |
Maintainer | 0y2k <0x0y2k@gmail.com> |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Data.Bytes.QuasiQuoter
Description
Offers QuasiQuoters for byte sequence.
Synopsis
- class FromBytes a where
- fromBytes :: ByteString -> a
- fromDigitWithBase :: Int -> Char -> Maybe Int
- strWithBase :: FromBytes a => Int -> String -> a
- bin :: QuasiQuoter
- hex :: QuasiQuoter
Documentation
class FromBytes a where Source #
Offers StrictByteString -> a
.
Methods
fromBytes :: ByteString -> a Source #
Instances
FromBytes ByteString Source # | |
Defined in Data.Bytes.QuasiQuoter Methods fromBytes :: ByteString -> ByteString Source # | |
FromBytes ByteString Source # | |
Defined in Data.Bytes.QuasiQuoter Methods fromBytes :: ByteString0 -> ByteString Source # |
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"