-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | A staged lexer generator -- -- Like alex, sasha is lexer/scanner generator; but it -- is using Typed Template Haskell. . The generated scanners are -- comparable in speed to alex generated ones. @package sasha @version 0.2 module Sasha.Internal.ERE -- | Extended regular expression data ERE -- | Concatenation EREAppend :: [ERE] -> ERE -- | Union EREUnion :: Word8Set -> Set ERE -> ERE -- | Kleene star EREStar :: ERE -> ERE -- | Complement ERENot :: ERE -> ERE -- | Empty regex. Doesn't accept anything. -- --
--   match empty s === False
--   
empty :: ERE -- | Empty string. Note: different than empty. -- --
--   match eps s === null s
--   
eps :: ERE -- | Character. char :: Word8 -> ERE -- | Character range. charRange :: Word8 -> Word8 -> ERE -- | Character set. charSet :: Word8Set -> ERE -- | UTF8 character, i.e. may match multiple bytes. utf8Char :: Char -> ERE -- | Any character. anyChar :: ERE anyUtf8Char :: ERE -- | Concatenate regular expressions. -- --
--   r <> empty === empty
--   
-- --
--   empty <>  r === empty
--   
-- --
--   ( r <> s) <> t === r <> (s <> t)
--   
-- --
--   r <> eps === r
--   
-- --
--   eps <>  r === r
--   
appends :: [ERE] -> ERE -- | Union of regular expressions. -- --
--   r \/ r === r
--   
-- --
--   r \/ s === s \/ r
--   
-- --
--   ( r \/ s) \/ t === r \/ (s \/ t)
--   
-- --
--   empty \/  r === r
--   
-- --
--   r \/ empty === r
--   
-- --
--   everything \/  r === everything
--   
-- --
--   r \/ everything === everything
--   
unions :: [ERE] -> ERE -- | Intersection of regular expressions. -- --
--   r /\ r === r
--   
-- --
--   r /\ s === s /\ r
--   
-- --
--   ( r /\ s) /\ t === r /\ (s /\ t)
--   
-- --
--   empty /\  r === empty
--   
-- --
--   r /\ empty === empty
--   
-- --
--   everything /\  r === r
--   
-- --
--   r /\ everything === r
--   
intersections :: [ERE] -> ERE -- | Kleene star. -- --
--   star (star r) === star ( r)
--   
-- --
--   star eps     ===  eps
--   
-- --
--   star empty   ===  eps
--   
-- --
--   star anyChar ===  everything
--   
-- --
--   star (r \/ eps) === star r
--   
-- --
--   star (char c \/ eps) === star (char c)
--   
-- --
--   star (empty \/ eps) === eps
--   
star :: ERE -> ERE -- | Kleene plus -- --
--   plus r = r <> star r
--   
plus :: ERE -> ERE -- | Literal string. string :: [Word8] -> ERE -- | UTF8 string utf8String :: String -> ERE -- | Complement. -- --
--   complement (complement r) ===  r
--   
complement :: ERE -> ERE -- | Everything. -- --
--   match everything s === True
--   
everything :: ERE satisfy :: (Word8 -> Bool) -> ERE digit :: ERE equivalent :: ERE -> ERE -> Bool -- | We say that a regular expression r is nullable if the language it -- defines contains the empty string. -- --
--   >>> nullable eps
--   True
--   
-- --
--   >>> nullable (star "x")
--   True
--   
-- --
--   >>> nullable "foo"
--   False
--   
-- --
--   >>> nullable (complement eps)
--   False
--   
nullable :: ERE -> Bool -- | Intuitively, the derivative of a language <math> with respect to -- a symbol <math> is the language that includes only those -- suffixes of strings with a leading symbol <math> in -- <math>. derivative :: Word8 -> ERE -> ERE match :: ERE -> [Word8] -> Bool -- | Whether ERE is (structurally) equal to empty. isEmpty :: ERE -> Bool -- | Whether ERE is (structurally) equal to everything. isEverything :: ERE -> Bool instance GHC.Show.Show Sasha.Internal.ERE.ERE instance GHC.Classes.Ord Sasha.Internal.ERE.ERE instance GHC.Classes.Eq Sasha.Internal.ERE.ERE instance GHC.Base.Semigroup Sasha.Internal.ERE.ERE instance GHC.Base.Monoid Sasha.Internal.ERE.ERE instance Algebra.Lattice.Lattice Sasha.Internal.ERE.ERE instance Algebra.Lattice.BoundedJoinSemiLattice Sasha.Internal.ERE.ERE instance Algebra.Lattice.BoundedMeetSemiLattice Sasha.Internal.ERE.ERE instance Data.String.IsString Sasha.Internal.ERE.ERE instance Test.QuickCheck.Arbitrary.Arbitrary Sasha.Internal.ERE.ERE module Sasha -- | Lexer grammar specification: regular expression and result builder -- function which takes a prefix (the matching part) and a suffix (the -- rest of input). type Sasha r = [(ERE, ByteString -> ByteString -> r)] -- | Scan for a single token. sasha :: forall r. r -> Sasha r -> ByteString -> r -- | Extended regular expression data ERE -- | Empty regex. Doesn't accept anything. -- --
--   match empty s === False
--   
empty :: ERE -- | Empty string. Note: different than empty. -- --
--   match eps s === null s
--   
eps :: ERE -- | Character. char :: Word8 -> ERE -- | Character range. charRange :: Word8 -> Word8 -> ERE -- | Character set. charSet :: Word8Set -> ERE -- | UTF8 character, i.e. may match multiple bytes. utf8Char :: Char -> ERE -- | Any character. anyChar :: ERE anyUtf8Char :: ERE -- | Concatenate regular expressions. -- --
--   r <> empty === empty
--   
-- --
--   empty <>  r === empty
--   
-- --
--   ( r <> s) <> t === r <> (s <> t)
--   
-- --
--   r <> eps === r
--   
-- --
--   eps <>  r === r
--   
appends :: [ERE] -> ERE -- | Union of regular expressions. -- --
--   r \/ r === r
--   
-- --
--   r \/ s === s \/ r
--   
-- --
--   ( r \/ s) \/ t === r \/ (s \/ t)
--   
-- --
--   empty \/  r === r
--   
-- --
--   r \/ empty === r
--   
-- --
--   everything \/  r === everything
--   
-- --
--   r \/ everything === everything
--   
unions :: [ERE] -> ERE -- | Intersection of regular expressions. -- --
--   r /\ r === r
--   
-- --
--   r /\ s === s /\ r
--   
-- --
--   ( r /\ s) /\ t === r /\ (s /\ t)
--   
-- --
--   empty /\  r === empty
--   
-- --
--   r /\ empty === empty
--   
-- --
--   everything /\  r === r
--   
-- --
--   r /\ everything === r
--   
intersections :: [ERE] -> ERE -- | Kleene star. -- --
--   star (star r) === star ( r)
--   
-- --
--   star eps     ===  eps
--   
-- --
--   star empty   ===  eps
--   
-- --
--   star anyChar ===  everything
--   
-- --
--   star (r \/ eps) === star r
--   
-- --
--   star (char c \/ eps) === star (char c)
--   
-- --
--   star (empty \/ eps) === eps
--   
star :: ERE -> ERE -- | Kleene plus -- --
--   plus r = r <> star r
--   
plus :: ERE -> ERE -- | Literal string. string :: [Word8] -> ERE -- | UTF8 string utf8String :: String -> ERE -- | Complement. -- --
--   complement (complement r) ===  r
--   
complement :: ERE -> ERE satisfy :: (Word8 -> Bool) -> ERE digit :: ERE module Sasha.Internal.Word8Set -- | Optimized routing to check membership when Word8Set is -- statically known. -- --
--   memberCode c ws = [||member $$c $$(liftTyped ws) ||]
--   
memberCode :: Code Q Word8 -> Word8Set -> Code Q Bool module Sasha.TTH -- | Lexer grammar specification: regular expression and result builder -- function which takes a prefix (the matching part) and a suffix (the -- rest of input). type SaTTH r = [(ERE, Code Q ByteString -> Code Q ByteString -> Code Q r)] -- | Scan for a single token. satth :: forall r. Code Q r -> SaTTH r -> Code Q (ByteString -> r) -- | Extended regular expression data ERE -- | Empty regex. Doesn't accept anything. -- --
--   match empty s === False
--   
empty :: ERE -- | Empty string. Note: different than empty. -- --
--   match eps s === null s
--   
eps :: ERE -- | Character. char :: Word8 -> ERE -- | Character range. charRange :: Word8 -> Word8 -> ERE -- | Character set. charSet :: Word8Set -> ERE -- | UTF8 character, i.e. may match multiple bytes. utf8Char :: Char -> ERE -- | Any character. anyChar :: ERE anyUtf8Char :: ERE -- | Concatenate regular expressions. -- --
--   r <> empty === empty
--   
-- --
--   empty <>  r === empty
--   
-- --
--   ( r <> s) <> t === r <> (s <> t)
--   
-- --
--   r <> eps === r
--   
-- --
--   eps <>  r === r
--   
appends :: [ERE] -> ERE -- | Union of regular expressions. -- --
--   r \/ r === r
--   
-- --
--   r \/ s === s \/ r
--   
-- --
--   ( r \/ s) \/ t === r \/ (s \/ t)
--   
-- --
--   empty \/  r === r
--   
-- --
--   r \/ empty === r
--   
-- --
--   everything \/  r === everything
--   
-- --
--   r \/ everything === everything
--   
unions :: [ERE] -> ERE -- | Intersection of regular expressions. -- --
--   r /\ r === r
--   
-- --
--   r /\ s === s /\ r
--   
-- --
--   ( r /\ s) /\ t === r /\ (s /\ t)
--   
-- --
--   empty /\  r === empty
--   
-- --
--   r /\ empty === empty
--   
-- --
--   everything /\  r === r
--   
-- --
--   r /\ everything === r
--   
intersections :: [ERE] -> ERE -- | Kleene star. -- --
--   star (star r) === star ( r)
--   
-- --
--   star eps     ===  eps
--   
-- --
--   star empty   ===  eps
--   
-- --
--   star anyChar ===  everything
--   
-- --
--   star (r \/ eps) === star r
--   
-- --
--   star (char c \/ eps) === star (char c)
--   
-- --
--   star (empty \/ eps) === eps
--   
star :: ERE -> ERE -- | Kleene plus -- --
--   plus r = r <> star r
--   
plus :: ERE -> ERE -- | Literal string. string :: [Word8] -> ERE -- | UTF8 string utf8String :: String -> ERE -- | Complement. -- --
--   complement (complement r) ===  r
--   
complement :: ERE -> ERE satisfy :: (Word8 -> Bool) -> ERE digit :: ERE instance GHC.Classes.Ord Sasha.TTH.Meas instance GHC.Classes.Eq Sasha.TTH.Meas instance GHC.Show.Show (Sasha.TTH.S tag) instance GHC.Classes.Eq (Sasha.TTH.S tag) instance GHC.Classes.Ord (Sasha.TTH.S tag)