Copyright | (c) Dong Han 2017-2018 |
---|---|
License | BSD |
Maintainer | winterland1989@gmail.com |
Stability | experimental |
Portability | non-portable |
Safe Haskell | None |
Language | Haskell2010 |
This module provides functions for writing PrimArray
related literals QuasiQuote
.
> :set -XQuasiQuotes > :t [arrASCII|asdfg|] [arrASCII|asdfg|] :: PrimArray GHC.Word.Word8 > [arrASCII|asdfg|] fromListN 5 [97,115,100,102,103] > :t [arrI16|1,2,3,4,5|] [arrI16|1,2,3,4,5|] :: PrimArray GHC.Int.Int16 > [arrI16|1,2,3,4,5|] fromListN 5 [1,2,3,4,5]
Synopsis
- arrASCII :: QuasiQuoter
- arrW8 :: QuasiQuoter
- arrW16 :: QuasiQuoter
- arrW32 :: QuasiQuoter
- arrW64 :: QuasiQuoter
- arrWord :: QuasiQuoter
- arrI8 :: QuasiQuoter
- arrI16 :: QuasiQuoter
- arrI32 :: QuasiQuoter
- arrI64 :: QuasiQuoter
- arrInt :: QuasiQuoter
- asciiLiteral :: (ExpQ -> ExpQ -> ExpQ) -> String -> ExpQ
- utf8Literal :: (ExpQ -> ExpQ -> ExpQ) -> String -> ExpQ
- arrayLiteral :: ([Integer] -> Q [Word8]) -> (ExpQ -> ExpQ -> ExpQ) -> String -> ExpQ
- word8Literal :: (ExpQ -> ExpQ -> ExpQ) -> String -> ExpQ
- word16Literal :: (ExpQ -> ExpQ -> ExpQ) -> String -> ExpQ
- word32Literal :: (ExpQ -> ExpQ -> ExpQ) -> String -> ExpQ
- word64Literal :: (ExpQ -> ExpQ -> ExpQ) -> String -> ExpQ
- wordLiteral :: (ExpQ -> ExpQ -> ExpQ) -> String -> ExpQ
- int8Literal :: (ExpQ -> ExpQ -> ExpQ) -> String -> ExpQ
- int16Literal :: (ExpQ -> ExpQ -> ExpQ) -> String -> ExpQ
- int32Literal :: (ExpQ -> ExpQ -> ExpQ) -> String -> ExpQ
- int64Literal :: (ExpQ -> ExpQ -> ExpQ) -> String -> ExpQ
- intLiteral :: (ExpQ -> ExpQ -> ExpQ) -> String -> ExpQ
- word8ArrayFromAddr :: Int -> Addr# -> PrimArray Word8
- word16ArrayFromAddr :: Int -> Addr# -> PrimArray Word16
- word32ArrayFromAddr :: Int -> Addr# -> PrimArray Word32
- word64ArrayFromAddr :: Int -> Addr# -> PrimArray Word64
- wordArrayFromAddr :: Int -> Addr# -> PrimArray Word
- int8ArrayFromAddr :: Int -> Addr# -> PrimArray Int8
- int16ArrayFromAddr :: Int -> Addr# -> PrimArray Int16
- int32ArrayFromAddr :: Int -> Addr# -> PrimArray Int32
- int64ArrayFromAddr :: Int -> Addr# -> PrimArray Int64
- intArrayFromAddr :: Int -> Addr# -> PrimArray Int
PrimArray literal quoters
arrASCII :: QuasiQuoter Source #
[arrASCII|asdfg|] :: PrimArray Word8
arrW8 :: QuasiQuoter Source #
[arrW8|1,2,3,4,5|] :: PrimArray Word8
arrW16 :: QuasiQuoter Source #
[arrW16|1,2,3,4,5|] :: PrimArray Word16
arrW32 :: QuasiQuoter Source #
[arrW32|1,2,3,4,5|] :: PrimArray Word32
arrW64 :: QuasiQuoter Source #
[arrW64|1,2,3,4,5|] :: PrimArray Word64
arrWord :: QuasiQuoter Source #
[arrWord|1,2,3,4,5|] :: PrimArray Word
arrI8 :: QuasiQuoter Source #
[arrW8|1,2,3,4,5|] :: PrimArray Int8
arrI16 :: QuasiQuoter Source #
[arrI16|1,2,3,4,5|] :: PrimArray Int16
arrI32 :: QuasiQuoter Source #
[arrI32|1,2,3,4,5|] :: PrimArray Int32
arrI64 :: QuasiQuoter Source #
[arrI64|1,2,3,4,5|] :: PrimArray Int64
arrInt :: QuasiQuoter Source #
[arrInt|1,2,3,4,5|] :: PrimArray Int
quoter helpers
utf8Literal :: (ExpQ -> ExpQ -> ExpQ) -> String -> ExpQ Source #
Construct data with UTF8 encoded literals.
See asciiLiteral
arrayLiteral :: ([Integer] -> Q [Word8]) -> (ExpQ -> ExpQ -> ExpQ) -> String -> ExpQ Source #
Construct data with array literals e.g. 1,2,3
.
word8Literal :: (ExpQ -> ExpQ -> ExpQ) -> String -> ExpQ Source #
Construct PrimArray
Word8
with array literals e.g. 1,2,3
. See asciiLiteral
word16Literal :: (ExpQ -> ExpQ -> ExpQ) -> String -> ExpQ Source #
Construct PrimArray
Word16
with array literals e.g. 1,2,3
. See asciiLiteral
word32Literal :: (ExpQ -> ExpQ -> ExpQ) -> String -> ExpQ Source #
Construct PrimArray
Word32
with array literals e.g. 1,2,3
. See asciiLiteral
word64Literal :: (ExpQ -> ExpQ -> ExpQ) -> String -> ExpQ Source #
Construct PrimArray
Word64
with array literals e.g. 1,2,3
. See asciiLiteral
wordLiteral :: (ExpQ -> ExpQ -> ExpQ) -> String -> ExpQ Source #
Construct PrimArray
Word
with array literals e.g. 1,2,3
. See asciiLiteral
int8Literal :: (ExpQ -> ExpQ -> ExpQ) -> String -> ExpQ Source #
Construct PrimArray
Int8
with array literals e.g. 1,2,3
. See asciiLiteral
int16Literal :: (ExpQ -> ExpQ -> ExpQ) -> String -> ExpQ Source #
Construct PrimArray
Int16
with array literals e.g. 1,2,3
. See asciiLiteral
int32Literal :: (ExpQ -> ExpQ -> ExpQ) -> String -> ExpQ Source #
Construct PrimArray
Int32
with array literals e.g. 1,2,3
. See asciiLiteral
int64Literal :: (ExpQ -> ExpQ -> ExpQ) -> String -> ExpQ Source #
Construct PrimArray
Int64
with array literals e.g. 1,2,3
. See asciiLiteral