Copyright | (c) Lev Dvorkin 2022 |
---|---|
License | MIT |
Maintainer | [email protected] |
Stability | Experimental |
Safe Haskell | None |
Language | Haskell2010 |
Text.Tokenizer.Types
Description
This module contains common types used by uniqueness checking and tokenizing algorithms
Synopsis
- newtype Alt a = Alt [a]
- data Count
- data Repeatable c = Repeatable {
- getCnt :: Count
- getBWS :: BlackWhiteSet c
- type TokId = Int
- data Token k c = Token {
- name :: k
- behind, ahead :: [BlackWhiteSet c]
- body :: [Repeatable c]
- data RToken c = RToken {
- tokId :: TokId
- rbehind, ahead :: [Repeatable c]
- body :: [Repeatable c]
- makeRToken :: TokId -> Token k c -> RToken c
Documentation
Type synonym for list monad used as a collection of alternatives
Constructors
Alt [a] |
Instances
Monad Alt Source # | |
Functor Alt Source # | |
Applicative Alt Source # | |
Foldable Alt Source # | |
Defined in Text.Tokenizer.Types Methods fold :: Monoid m => Alt m -> m # foldMap :: Monoid m => (a -> m) -> Alt a -> m # foldMap' :: Monoid m => (a -> m) -> Alt a -> m # foldr :: (a -> b -> b) -> b -> Alt a -> b # foldr' :: (a -> b -> b) -> b -> Alt a -> b # foldl :: (b -> a -> b) -> b -> Alt a -> b # foldl' :: (b -> a -> b) -> b -> Alt a -> b # foldr1 :: (a -> a -> a) -> Alt a -> a # foldl1 :: (a -> a -> a) -> Alt a -> a # elem :: Eq a => a -> Alt a -> Bool # maximum :: Ord a => Alt a -> a # | |
Traversable Alt Source # | |
Alternative Alt Source # | |
Eq a => Eq (Alt a) Source # | |
Ord a => Ord (Alt a) Source # | |
Show a => Show (Alt a) Source # | |
Number of symbols acceptable by Repeatable
data Repeatable c Source #
BlackWhiteSet
that can be repeated.
Constructors
Repeatable | |
Fields
|
Instances
Eq c => Eq (Repeatable c) Source # | |
Defined in Text.Tokenizer.Types | |
Ord c => Ord (Repeatable c) Source # | |
Defined in Text.Tokenizer.Types Methods compare :: Repeatable c -> Repeatable c -> Ordering # (<) :: Repeatable c -> Repeatable c -> Bool # (<=) :: Repeatable c -> Repeatable c -> Bool # (>) :: Repeatable c -> Repeatable c -> Bool # (>=) :: Repeatable c -> Repeatable c -> Bool # max :: Repeatable c -> Repeatable c -> Repeatable c # min :: Repeatable c -> Repeatable c -> Repeatable c # | |
Show c => Show (Repeatable c) Source # | |
Defined in Text.Tokenizer.Types Methods showsPrec :: Int -> Repeatable c -> ShowS # show :: Repeatable c -> String # showList :: [Repeatable c] -> ShowS # |
Token with name of type k
(used for uniqueness error messages and
tokenizing output) over char type c
.
Constructors
Token | |
Fields
|
Type for internal needs. Contains autogenerated $sel:tokId:RToken
and restrictions
behind token are reversed
Constructors
RToken | |
Fields
|