hpython-0.2: Python language tools

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

Language.Python.Syntax.Import

Contents

Description

Synopsis

Documentation

data ImportAs e v a Source #

Some data optionally followed by as ident

Used in:

import a as b
from a import b as c, d as e
from a import (b as c, d as e)

Constructors

ImportAs 
Instances
Validated e => Validated (ImportAs e) Source # 
Instance details

Defined in Language.Python.Syntax.Import

Methods

unvalidated :: Getter (ImportAs e v a) (ImportAs e [] a) Source #

HasIdents n => HasIdents (ImportAs n) Source # 
Instance details

Defined in Language.Python.Optics.Idents

Methods

_Idents :: Traversal (ImportAs n v a) (ImportAs n [] a) (Ident v a) (Ident [] a) Source #

Functor (e v) => Functor (ImportAs e v) Source # 
Instance details

Defined in Language.Python.Syntax.Import

Methods

fmap :: (a -> b) -> ImportAs e v a -> ImportAs e v b #

(<$) :: a -> ImportAs e v b -> ImportAs e v a #

Foldable (e v) => Foldable (ImportAs e v) Source # 
Instance details

Defined in Language.Python.Syntax.Import

Methods

fold :: Monoid m => ImportAs e v m -> m #

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

foldr :: (a -> b -> b) -> b -> ImportAs e v a -> b #

foldr' :: (a -> b -> b) -> b -> ImportAs e v a -> b #

foldl :: (b -> a -> b) -> b -> ImportAs e v a -> b #

foldl' :: (b -> a -> b) -> b -> ImportAs e v a -> b #

foldr1 :: (a -> a -> a) -> ImportAs e v a -> a #

foldl1 :: (a -> a -> a) -> ImportAs e v a -> a #

toList :: ImportAs e v a -> [a] #

null :: ImportAs e v a -> Bool #

length :: ImportAs e v a -> Int #

elem :: Eq a => a -> ImportAs e v a -> Bool #

maximum :: Ord a => ImportAs e v a -> a #

minimum :: Ord a => ImportAs e v a -> a #

sum :: Num a => ImportAs e v a -> a #

product :: Num a => ImportAs e v a -> a #

Traversable (e v) => Traversable (ImportAs e v) Source # 
Instance details

Defined in Language.Python.Syntax.Import

Methods

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

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

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

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

HasAnn (ImportAs e v) Source # 
Instance details

Defined in Language.Python.Syntax.Import

Methods

annot :: Lens' (ImportAs e v a) (Ann a) Source #

(Eq a, Eq (e v a)) => Eq (ImportAs e v a) Source # 
Instance details

Defined in Language.Python.Syntax.Import

Methods

(==) :: ImportAs e v a -> ImportAs e v a -> Bool #

(/=) :: ImportAs e v a -> ImportAs e v a -> Bool #

(Show a, Show (e v a)) => Show (ImportAs e v a) Source # 
Instance details

Defined in Language.Python.Syntax.Import

Methods

showsPrec :: Int -> ImportAs e v a -> ShowS #

show :: ImportAs e v a -> String #

showList :: [ImportAs e v a] -> ShowS #

Generic (ImportAs e v a) Source # 
Instance details

Defined in Language.Python.Syntax.Import

Associated Types

type Rep (ImportAs e v a) :: Type -> Type #

Methods

from :: ImportAs e v a -> Rep (ImportAs e v a) x #

to :: Rep (ImportAs e v a) x -> ImportAs e v a #

HasTrailingWhitespace (e v a) => HasTrailingWhitespace (ImportAs e v a) Source # 
Instance details

Defined in Language.Python.Syntax.Import

HasNewlines (e v a) => HasNewlines (ImportAs e v a) Source # 
Instance details

Defined in Language.Python.Optics.Newlines

type Rep (ImportAs e v a) Source # 
Instance details

Defined in Language.Python.Syntax.Import

type Rep (ImportAs e v a) = D1 (MetaData "ImportAs" "Language.Python.Syntax.Import" "hpython-0.2-7fNN6PEHntyHCqZaN2NGK0" False) (C1 (MetaCons "ImportAs" PrefixI True) (S1 (MetaSel (Just "_importAsAnn") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Ann a)) :*: (S1 (MetaSel (Just "_importAsName") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (e v a)) :*: S1 (MetaSel (Just "_importAsQual") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe (NonEmpty Whitespace, Ident v a))))))

data ImportTargets v a Source #

The targets of a from ... import ... statement

Constructors

ImportAll (Ann a) [Whitespace]
from x import *
ImportSome (Ann a) (CommaSep1 (ImportAs Ident v a))
from x import a, b, c
ImportSomeParens (Ann a) [Whitespace] (CommaSep1' (ImportAs Ident v a)) [Whitespace]
from x import (a, b, c)
Instances
HasIdents ImportTargets Source # 
Instance details

Defined in Language.Python.Optics.Idents

Methods

_Idents :: Traversal (ImportTargets v a) (ImportTargets [] a) (Ident v a) (Ident [] a) Source #

Functor (ImportTargets v) Source # 
Instance details

Defined in Language.Python.Syntax.Import

Methods

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

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

Foldable (ImportTargets v) Source # 
Instance details

Defined in Language.Python.Syntax.Import

Methods

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

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

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

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

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

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

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

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

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

null :: ImportTargets v a -> Bool #

length :: ImportTargets v a -> Int #

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

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

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

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

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

Traversable (ImportTargets v) Source # 
Instance details

Defined in Language.Python.Syntax.Import

Methods

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

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

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

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

HasAnn (ImportTargets v) Source # 
Instance details

Defined in Language.Python.Syntax.Import

Methods

annot :: Lens' (ImportTargets v a) (Ann a) Source #

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

Defined in Language.Python.Syntax.Import

Methods

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

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

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

Defined in Language.Python.Syntax.Import

Generic (ImportTargets v a) Source # 
Instance details

Defined in Language.Python.Syntax.Import

Associated Types

type Rep (ImportTargets v a) :: Type -> Type #

Methods

from :: ImportTargets v a -> Rep (ImportTargets v a) x #

to :: Rep (ImportTargets v a) x -> ImportTargets v a #

HasTrailingWhitespace (ImportTargets v a) Source # 
Instance details

Defined in Language.Python.Syntax.Import

HasNewlines (ImportTargets v a) Source # 
Instance details

Defined in Language.Python.Optics.Newlines

type Rep (ImportTargets v a) Source # 
Instance details

Defined in Language.Python.Syntax.Import

Lenses

importAsName :: Validated e => Lens (ImportAs e v a) (ImportAs e' '[] a) (e v a) (e' '[] a) Source #