Z-Data-0.8.3.0: Array, vector and text
Copyright(c) Dong Han 2017-2018
LicenseBSD
Maintainerwinterland1989@gmail.com
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell2010

Z.Data.Array.QQ

Description

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

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

asciiLiteral Source #

Arguments

:: (ExpQ -> ExpQ -> ExpQ)

Construction function which receive a byte length Int and a Addr# LitE expression.

-> String

Quoter input

-> ExpQ

Final Quoter

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

intLiteral :: (ExpQ -> ExpQ -> ExpQ) -> String -> ExpQ Source #

Construct PrimArray Int with array literals e.g. 1,2,3. See asciiLiteral