Copyright | (C) CSIRO 2017-2018 |
---|---|
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 :: a
- _importAsName :: e a
- _importAsQual :: Maybe (NonEmpty Whitespace, Ident v a)
- data ImportTargets v a
- = ImportAll a [Whitespace]
- | ImportSome a (CommaSep1 (ImportAs (Ident v) v a))
- | ImportSomeParens a [Whitespace] (CommaSep1' (ImportAs (Ident v) v a)) [Whitespace]
- importAsAnn :: Lens' (ImportAs e v a) a
- importAsName :: Lens (ImportAs e v a) (ImportAs e' '[] a) (e a) (e' a)
- importAsQual :: 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 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
Lenses
importAsAnn :: Lens' (ImportAs e v a) a Source #
importAsName :: Lens (ImportAs e v a) (ImportAs e' '[] a) (e a) (e' a) Source #
importAsQual :: Lens (ImportAs e v a) (ImportAs e '[] a) (Maybe (NonEmpty Whitespace, Ident v a)) (Maybe (NonEmpty Whitespace, Ident '[] a)) Source #