hpython-0.1: Syntax tree and DSL for Python

Copyright(C) CSIRO 2017-2018
LicenseBSD3
MaintainerIsaac Elliott <isaace71295@gmail.com>
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell2010

Language.Python.Syntax.Ident

Contents

Description

 
Synopsis

Documentation

data Ident (v :: [*]) a Source #

An identifier. Like many types in hpython, it has an optional annotation and tracks its trailing whitespace.

Raw Idents have an IsString instance.

See https://docs.python.org/3.5/reference/lexical_analysis.html#identifiers

Constructors

MkIdent 
Instances
Validated Ident Source # 
Instance details

Defined in Language.Python.Syntax.Ident

Methods

unvalidated :: Getter (Ident v a) (Ident [] a) Source #

DoubleStarSyntax Ident Param Source #

See def_

Instance details

Defined in Language.Python.DSL

Methods

ss_ :: Raw Ident -> Raw Param Source #

StarSyntax Ident Param Source #

See def_

Instance details

Defined in Language.Python.DSL

Methods

s_ :: Raw Ident -> Raw Param Source #

PositionalSyntax Param Ident Source #

See def_

Instance details

Defined in Language.Python.DSL

Methods

p_ :: Raw Ident -> Raw Param Source #

As Expr Ident ExceptAs Source #

See exceptAs_

Instance details

Defined in Language.Python.DSL

Methods

as_ :: Raw Expr -> Raw Ident -> Raw ExceptAs Source #

Functor (Ident v) Source # 
Instance details

Defined in Language.Python.Syntax.Ident

Methods

fmap :: (a -> b) -> Ident v a -> Ident v b #

(<$) :: a -> Ident v b -> Ident v a #

IsString (Raw Ident) Source # 
Instance details

Defined in Language.Python.Syntax.Ident

Methods

fromString :: String -> Raw Ident #

Foldable (Ident v) Source # 
Instance details

Defined in Language.Python.Syntax.Ident

Methods

fold :: Monoid m => Ident v m -> m #

foldMap :: Monoid m => (a -> m) -> Ident v a -> m #

foldr :: (a -> b -> b) -> b -> Ident v a -> b #

foldr' :: (a -> b -> b) -> b -> Ident v a -> b #

foldl :: (b -> a -> b) -> b -> Ident v a -> b #

foldl' :: (b -> a -> b) -> b -> Ident v a -> b #

foldr1 :: (a -> a -> a) -> Ident v a -> a #

foldl1 :: (a -> a -> a) -> Ident v a -> a #

toList :: Ident v a -> [a] #

null :: Ident v a -> Bool #

length :: Ident v a -> Int #

elem :: Eq a => a -> Ident v a -> Bool #

maximum :: Ord a => Ident v a -> a #

minimum :: Ord a => Ident v a -> a #

sum :: Num a => Ident v a -> a #

product :: Num a => Ident v a -> a #

Traversable (Ident v) Source # 
Instance details

Defined in Language.Python.Syntax.Ident

Methods

traverse :: Applicative f => (a -> f b) -> Ident v a -> f (Ident v b) #

sequenceA :: Applicative f => Ident v (f a) -> f (Ident v a) #

mapM :: Monad m => (a -> m b) -> Ident v a -> m (Ident v b) #

sequence :: Monad m => Ident v (m a) -> m (Ident v a) #

Eq a => Eq (Ident v a) Source # 
Instance details

Defined in Language.Python.Syntax.Ident

Methods

(==) :: Ident v a -> Ident v a -> Bool #

(/=) :: Ident v a -> Ident v a -> Bool #

Show a => Show (Ident v a) Source # 
Instance details

Defined in Language.Python.Syntax.Ident

Methods

showsPrec :: Int -> Ident v a -> ShowS #

show :: Ident v a -> String #

showList :: [Ident v a] -> ShowS #

HasTrailingWhitespace (Ident v a) Source # 
Instance details

Defined in Language.Python.Syntax.Ident

Methods

trailingWhitespace :: Lens' (Ident v a) [Whitespace] Source #

HasNewlines (Ident v a) Source # 
Instance details

Defined in Language.Python.Optics.Newlines

Methods

_Newlines :: Traversal' (Ident v a) Newline Source #

Lenses

identAnn :: Lens (Ident v a) (Ident v a) a a Source #

identValue :: Lens (Ident v a) (Ident '[] a) String String Source #

Extra functions

isIdentifierStart :: Char -> Bool Source #

Determine whether this character could start a valid identifier

isIdentifierChar :: Char -> Bool Source #

Determine whether this character could be part of a valid identifier