| Copyright | (C) CSIRO 2017-2019 |
|---|---|
| License | BSD3 |
| Maintainer | Isaac Elliott <isaace71295@gmail.com> |
| Stability | experimental |
| Portability | non-portable |
| Safe Haskell | None |
| Language | Haskell2010 |
Language.Python.Optics.Indents
Description
Synopsis
- _Indent :: HasIndents s a => Traversal' s [Whitespace]
- class HasIndents s a | s -> a where
- _Indents :: Traversal' s (Indents a)
Documentation
_Indent :: HasIndents s a => Traversal' s [Whitespace] Source #
Traversal' targeting the indent-chunks in a structure
e.g.
This is one indent chunk:
def a():
pass
if b:
pass
^^^^
and this is another
def a():
pass
if b:
pass
^^^^
class HasIndents s a | s -> a where Source #
Methods
_Indents :: Traversal' s (Indents a) Source #
Traversal' targeting the indentation inside a structure
Note: whitespace inside 'enclosed forms' (such as lists or tuples) is not considered indentation.
e.g.
In the following code, there is only one chunk of indentation:
def a():
[ b
, c
, d
]
it's here:
def a():
[ b
^^^^
, c
, d
]
The rest is whitespace that is internal to the list.