-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Space efficient set of Word8 and some pre-canned sets useful for parsing HTTP
--   
--   This package is intended to provide O(1) membership test on any subset
--   of ASCII and Latin-1 character set in order to write efficient HTTP
--   related parser.
@package bitset-word8
@version 0.1.1.0


-- | Space efficient set of <a>Word8</a> and some pre-canned sets useful
--   for parsing HTTP related <tt>ByteString</tt>. This file contains
--   additional useful character sets but they aren't evaluated at compile
--   time.
module Data.BitSetWord8.Internal

-- | Bitwise set of Word8. Space efficient backend and O(1) membership
--   test.
data BitSetWord8
BitSetWord8 :: {-# UNPACK #-} !Word64 -> {-# UNPACK #-} !Word64 -> {-# UNPACK #-} !Word64 -> {-# UNPACK #-} !Word64 -> BitSetWord8

-- | DIGIT of RFC5324 in <a>Char</a> list.
rfc5234Digit' :: [Char]

-- | UPALPHA of RFC2616 in <a>Char</a> list. Note that RFC2616 has been
--   obsoleted by RFC7230 and RFC7230 doesn't define UPALPHA.
rfc2616UpAlpha' :: [Char]

-- | LOALPHA of RFC2616 in <a>Char</a> list. Note that RFC2616 has been
--   obsoleted by RFC7230 and RFC7230 doesn't define LOALPHA.
rfc2616LoAlpha' :: [Char]

-- | ALPHA of RFC5324 in <a>Char</a> list.
rfc5234Alpha' :: [Char]

-- | HEXDIG of RFC5324 in <a>Char</a> list.
rfc5234HexDig' :: [Char]

-- | VCHAR of RFC5324 in <a>Char</a> list.
rfc5234VChar' :: [Char]

-- | WSP (aka white space) of RFC5324 in <a>Char</a> list.
rfc5324Wsp' :: [Char]

-- | sub-delim of RFC3986 in <a>Char</a> list.
rfc3986SubDelims' :: [Char]

-- | gen-delim of RFC3986 in <a>Char</a> list.
rfc3986GenDelims' :: [Char]

-- | reserved of RFC3986 in <a>Char</a> list.
rfc3986Reserved' :: [Char]

-- | unreserved of RFC3986 in <a>Char</a> list.
rfc3986Unreserved' :: [Char]

-- | pct-encoded of RFC3986 in <a>Char</a> list.
rfc3986PctEncodedChar' :: [Char]

-- | pchar of RFC3986 in <a>Char</a> list.
rfc3986PChar' :: [Char]

-- | URI-Reference of RFC3986 in <a>Char</a> list.
rfc3986UriReference' :: [Char]

-- | tchar of RFC7230 in <a>Char</a> list.
rfc7230TChar' :: [Char]

-- | obs-text of RFC7230 in <a>Char</a> list.
rfc7230ObsText' :: [Char]

-- | qdtext of RFC7230 in <a>Char</a> list.
rfc7230QDText' :: [Char]

-- | quoted-pair of RFC7230 in <a>Char</a> list.
rfc7230QuotedPair' :: [Char]

-- | O(1). Return <a>True</a> if given <a>Word8</a> is a member of given
--   <a>BitSetWord8</a>.
member :: BitSetWord8 -> Word8 -> Bool

-- | Convert given list of <a>Char</a> into <tt>Set</tt> of <a>Word8</a>.
--   Any <a>Char</a> having code point greater than 0xff is ignored.
toWord8Set :: [Char] -> Set Word8

-- | Convert <tt>Set</tt> of Word8 to full filled list of boolean existence
--   flag.
toBoolList :: Set Word8 -> [Bool]

-- | Pack 64 of boolean list into single <a>Word64</a> bitwise set.
toWord64 :: [Bool] -> Word64

-- | Convert full filled boolean list into 4 packed <a>Word64</a> list.
toWord64List :: [Bool] -> [Word64]

-- | Convert given List of <a>Char</a> into packed bitwise set of Word64.
--   Any <a>Char</a> having code point greater than 0xff is ignored.
fromList :: [Char] -> BitSetWord8
instance GHC.Show.Show Data.BitSetWord8.Internal.BitSetWord8
instance Language.Haskell.TH.Syntax.Lift Data.BitSetWord8.Internal.BitSetWord8
instance GHC.Classes.Eq Data.BitSetWord8.Internal.BitSetWord8


-- | Some pre-canned character sets useful for HTTP related parsing. All
--   sets provided by this module are evaluated at compile time using
--   Template Haskell.
module Data.BitSetWord8.CharSets

-- | URI-Reference of RFC3986 in BitSetWord8. Evaluated at compile time.
rfc3986UriReference :: BitSetWord8

-- | tcher of RFC7230 in BitSetWord8. Evaluated at compile time.
rfc7230TChar :: BitSetWord8

-- | qdtext of RFC7230 in BitSetWord8. Evaluated at compile time.
rfc7230QDText :: BitSetWord8

-- | quoted-string of RFC7230 in BitSetWord8. Evaluated at compile time.
rfc7230QuotedPair :: BitSetWord8


-- | Space efficient set of <tt>Word8</tt> and some pre-canned sets useful
--   for parsing HTTP related <tt>ByteString</tt>. This packaged is
--   intended to provide O(1) membership test on any subset of ASCII and
--   Latin-1 character set in order to write efficient HTTP related parser.
--   
--   <h3>Creating your own set</h3>
--   
--   You can create your own set by <a>fromList</a>.
--   
--   <pre>
--   myCharSet :: BitSetWord8
--   myCharSet = fromList [ <tt>Y</tt>, <tt>y</tt>, <tt>N</tt>, <tt>n</tt> ]
--   </pre>
--   
--   You can create pre-evaluated set using Template Haskell.
--   
--   <pre>
--   import Language.Haskell.TH.Syntax (Lift, lift)
--   
--   myPreEvaluatedCharSet :: BitSetWord8
--   myPreEvaluatedCharSet = $(lift myCharSet)
--   </pre>
--   
--   <h3>Example Usage</h3>
--   
--   <pre>
--   import Data.Attoparsec.ByteString
--   
--   -- | Parse RFC7230 token.
--   token :: Parser ByteString
--   token = takeWhile1 (member rfc7230TChar)
--   </pre>
module Data.BitSetWord8

-- | Bitwise set of Word8. Space efficient backend and O(1) membership
--   test.
data BitSetWord8

-- | URI-Reference of RFC3986 in BitSetWord8. Evaluated at compile time.
rfc3986UriReference :: BitSetWord8

-- | tcher of RFC7230 in BitSetWord8. Evaluated at compile time.
rfc7230TChar :: BitSetWord8

-- | qdtext of RFC7230 in BitSetWord8. Evaluated at compile time.
rfc7230QDText :: BitSetWord8

-- | quoted-string of RFC7230 in BitSetWord8. Evaluated at compile time.
rfc7230QuotedPair :: BitSetWord8

-- | URI-Reference of RFC3986 in <a>Char</a> list.
rfc3986UriReference' :: [Char]

-- | qdtext of RFC7230 in <a>Char</a> list.
rfc7230QDText' :: [Char]

-- | quoted-pair of RFC7230 in <a>Char</a> list.
rfc7230QuotedPair' :: [Char]

-- | DIGIT of RFC5324 in <a>Char</a> list.
rfc5234Digit' :: [Char]

-- | UPALPHA of RFC2616 in <a>Char</a> list. Note that RFC2616 has been
--   obsoleted by RFC7230 and RFC7230 doesn't define UPALPHA.
rfc2616UpAlpha' :: [Char]

-- | LOALPHA of RFC2616 in <a>Char</a> list. Note that RFC2616 has been
--   obsoleted by RFC7230 and RFC7230 doesn't define LOALPHA.
rfc2616LoAlpha' :: [Char]

-- | ALPHA of RFC5324 in <a>Char</a> list.
rfc5234Alpha' :: [Char]

-- | HEXDIG of RFC5324 in <a>Char</a> list.
rfc5234HexDig' :: [Char]

-- | VCHAR of RFC5324 in <a>Char</a> list.
rfc5234VChar' :: [Char]

-- | WSP (aka white space) of RFC5324 in <a>Char</a> list.
rfc5324Wsp' :: [Char]

-- | sub-delim of RFC3986 in <a>Char</a> list.
rfc3986SubDelims' :: [Char]

-- | gen-delim of RFC3986 in <a>Char</a> list.
rfc3986GenDelims' :: [Char]

-- | reserved of RFC3986 in <a>Char</a> list.
rfc3986Reserved' :: [Char]

-- | unreserved of RFC3986 in <a>Char</a> list.
rfc3986Unreserved' :: [Char]

-- | pct-encoded of RFC3986 in <a>Char</a> list.
rfc3986PctEncodedChar' :: [Char]

-- | pchar of RFC3986 in <a>Char</a> list.
rfc3986PChar' :: [Char]

-- | tchar of RFC7230 in <a>Char</a> list.
rfc7230TChar' :: [Char]

-- | obs-text of RFC7230 in <a>Char</a> list.
rfc7230ObsText' :: [Char]

-- | Convert given List of <a>Char</a> into packed bitwise set of Word64.
--   Any <a>Char</a> having code point greater than 0xff is ignored.
fromList :: [Char] -> BitSetWord8

-- | O(1). Return <a>True</a> if given <a>Word8</a> is a member of given
--   <a>BitSetWord8</a>.
member :: BitSetWord8 -> Word8 -> Bool
