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.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 (ImportAs e) Source # 
Instance details

Defined in Language.Python.Syntax.Import

Methods

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

Functor e => 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 => 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 => 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) #

(Eq a, Eq (e 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 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 #

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

Defined in Language.Python.Syntax.Import

Methods

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

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

Defined in Language.Python.Optics.Newlines

Methods

_Newlines :: Traversal' (ImportAs e v a) Newline Source #

data ImportTargets v a Source #

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

Constructors

ImportAll a [Whitespace]
from x import *
ImportSome a (CommaSep1 (ImportAs (Ident v) v a))
from x import a, b, c
ImportSomeParens a [Whitespace] (CommaSep1' (ImportAs (Ident v) v a)) [Whitespace]
from x import (a, b, c)
Instances
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) #

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

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

Methods

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

Lenses

importAsAnn :: Lens' (ImportAs e v a) a Source #

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