tree-sitter-0.5.0.0: Unstable bindings for the tree-sitter parsing library.

Safe HaskellSafe
LanguageHaskell2010

TreeSitter.Token

Synopsis

Documentation

newtype Token (symName :: Symbol) (symVal :: Nat) a Source #

An AST node representing a token, indexed by its name and numeric value.

For convenience, token types are typically used via type synonyms, e.g.:

type AnonymousPlus = Token "+" 123

Constructors

Token 

Fields

Instances
Generic1 (Token symName symVal :: Type -> Type) Source # 
Instance details

Defined in TreeSitter.Token

Associated Types

type Rep1 (Token symName symVal) :: k -> Type #

Methods

from1 :: Token symName symVal a -> Rep1 (Token symName symVal) a #

to1 :: Rep1 (Token symName symVal) a -> Token symName symVal a #

Functor (Token symName symVal) Source # 
Instance details

Defined in TreeSitter.Token

Methods

fmap :: (a -> b) -> Token symName symVal a -> Token symName symVal b #

(<$) :: a -> Token symName symVal b -> Token symName symVal a #

Foldable (Token symName symVal) Source # 
Instance details

Defined in TreeSitter.Token

Methods

fold :: Monoid m => Token symName symVal m -> m #

foldMap :: Monoid m => (a -> m) -> Token symName symVal a -> m #

foldr :: (a -> b -> b) -> b -> Token symName symVal a -> b #

foldr' :: (a -> b -> b) -> b -> Token symName symVal a -> b #

foldl :: (b -> a -> b) -> b -> Token symName symVal a -> b #

foldl' :: (b -> a -> b) -> b -> Token symName symVal a -> b #

foldr1 :: (a -> a -> a) -> Token symName symVal a -> a #

foldl1 :: (a -> a -> a) -> Token symName symVal a -> a #

toList :: Token symName symVal a -> [a] #

null :: Token symName symVal a -> Bool #

length :: Token symName symVal a -> Int #

elem :: Eq a => a -> Token symName symVal a -> Bool #

maximum :: Ord a => Token symName symVal a -> a #

minimum :: Ord a => Token symName symVal a -> a #

sum :: Num a => Token symName symVal a -> a #

product :: Num a => Token symName symVal a -> a #

Traversable (Token symName symVal) Source # 
Instance details

Defined in TreeSitter.Token

Methods

traverse :: Applicative f => (a -> f b) -> Token symName symVal a -> f (Token symName symVal b) #

sequenceA :: Applicative f => Token symName symVal (f a) -> f (Token symName symVal a) #

mapM :: Monad m => (a -> m b) -> Token symName symVal a -> m (Token symName symVal b) #

sequence :: Monad m => Token symName symVal (m a) -> m (Token symName symVal a) #

(KnownNat n, KnownSymbol sym) => SymbolMatching (Token sym n) Source # 
Instance details

Defined in TreeSitter.Unmarshal

Methods

symbolMatch :: Proxy (Token sym n) -> Node -> Bool Source #

showFailure :: Proxy (Token sym n) -> Node -> String Source #

Unmarshal (Token sym n) Source # 
Instance details

Defined in TreeSitter.Unmarshal

Methods

unmarshalNode :: (Carrier sig m, Member (Reader ByteString) sig, Member (Reader (Ptr Cursor)) sig, MonadFail m, MonadIO m, UnmarshalAnn a) => Node -> m (Token sym n a) Source #

Eq a => Eq (Token symName symVal a) Source # 
Instance details

Defined in TreeSitter.Token

Methods

(==) :: Token symName symVal a -> Token symName symVal a -> Bool #

(/=) :: Token symName symVal a -> Token symName symVal a -> Bool #

Ord a => Ord (Token symName symVal a) Source # 
Instance details

Defined in TreeSitter.Token

Methods

compare :: Token symName symVal a -> Token symName symVal a -> Ordering #

(<) :: Token symName symVal a -> Token symName symVal a -> Bool #

(<=) :: Token symName symVal a -> Token symName symVal a -> Bool #

(>) :: Token symName symVal a -> Token symName symVal a -> Bool #

(>=) :: Token symName symVal a -> Token symName symVal a -> Bool #

max :: Token symName symVal a -> Token symName symVal a -> Token symName symVal a #

min :: Token symName symVal a -> Token symName symVal a -> Token symName symVal a #

Show a => Show (Token symName symVal a) Source # 
Instance details

Defined in TreeSitter.Token

Methods

showsPrec :: Int -> Token symName symVal a -> ShowS #

show :: Token symName symVal a -> String #

showList :: [Token symName symVal a] -> ShowS #

Generic (Token symName symVal a) Source # 
Instance details

Defined in TreeSitter.Token

Associated Types

type Rep (Token symName symVal a) :: Type -> Type #

Methods

from :: Token symName symVal a -> Rep (Token symName symVal a) x #

to :: Rep (Token symName symVal a) x -> Token symName symVal a #

type Rep1 (Token symName symVal :: Type -> Type) Source # 
Instance details

Defined in TreeSitter.Token

type Rep1 (Token symName symVal :: Type -> Type) = D1 (MetaData "Token" "TreeSitter.Token" "tree-sitter-0.5.0.0-inplace" True) (C1 (MetaCons "Token" PrefixI True) (S1 (MetaSel (Just "ann") NoSourceUnpackedness NoSourceStrictness DecidedLazy) Par1))
type Rep (Token symName symVal a) Source # 
Instance details

Defined in TreeSitter.Token

type Rep (Token symName symVal a) = D1 (MetaData "Token" "TreeSitter.Token" "tree-sitter-0.5.0.0-inplace" True) (C1 (MetaCons "Token" PrefixI True) (S1 (MetaSel (Just "ann") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 a)))