Copyright | (C) CSIRO 2017-2019 |
---|---|
License | BSD3 |
Maintainer | Isaac Elliott <isaace71295@gmail.com> |
Stability | experimental |
Portability | non-portable |
Safe Haskell | None |
Language | Haskell2010 |
Syntax used in import statements
https://docs.python.org/3.5/reference/simple_stmts.html#the-import-statement
Synopsis
- data ImportAs e v a = ImportAs {
- _importAsAnn :: Ann a
- _importAsName :: e v a
- _importAsQual :: Maybe (NonEmpty Whitespace, Ident v a)
- data ImportTargets v a
- = ImportAll (Ann a) [Whitespace]
- | ImportSome (Ann a) (CommaSep1 (ImportAs Ident v a))
- | ImportSomeParens (Ann a) [Whitespace] (CommaSep1' (ImportAs Ident v a)) [Whitespace]
- importAsAnn :: Lens' (ImportAs e v a) a
- importAsName :: Validated e => Lens (ImportAs e v a) (ImportAs e' '[] a) (e v a) (e' '[] a)
- importAsQual :: Validated e => Lens (ImportAs e v a) (ImportAs e '[] a) (Maybe (NonEmpty Whitespace, Ident v a)) (Maybe (NonEmpty Whitespace, Ident '[] a))
Documentation
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)
ImportAs | |
|
Instances
data ImportTargets v a Source #
The targets of a from ... import ...
statement
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
Lenses
importAsAnn :: Lens' (ImportAs e v a) a Source #
importAsName :: Validated e => Lens (ImportAs e v a) (ImportAs e' '[] a) (e v a) (e' '[] a) Source #
importAsQual :: Validated e => Lens (ImportAs e v a) (ImportAs e '[] a) (Maybe (NonEmpty Whitespace, Ident v a)) (Maybe (NonEmpty Whitespace, Ident '[] a)) Source #