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.Optics.Indents

Description

 
Synopsis

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.

Instances
HasIndents (PyToken a) a Source # 
Instance details

Defined in Language.Python.Optics.Indents

HasIndents (CompoundStatement ([] :: [Type]) a) a Source # 
Instance details

Defined in Language.Python.Optics.Indents

HasIndents (Decorator ([] :: [Type]) a) a Source # 
Instance details

Defined in Language.Python.Optics.Indents

HasIndents (Suite ([] :: [Type]) a) a Source # 
Instance details

Defined in Language.Python.Optics.Indents

Methods

_Indents :: Traversal' (Suite [] a) (Indents a) Source #

HasIndents (Statement ([] :: [Type]) a) a Source # 
Instance details

Defined in Language.Python.Optics.Indents

HasIndents (SmallStatement ([] :: [Type]) a) a Source # 
Instance details

Defined in Language.Python.Optics.Indents

HasIndents (Block ([] :: [Type]) a) a Source # 
Instance details

Defined in Language.Python.Optics.Indents

Methods

_Indents :: Traversal' (Block [] a) (Indents a) Source #

HasIndents (Fundef ([] :: [Type]) a) a Source # 
Instance details

Defined in Language.Python.Optics.Indents

Methods

_Indents :: Traversal' (Fundef [] a) (Indents a) Source #

HasIndents (Else ([] :: [Type]) a) a Source # 
Instance details

Defined in Language.Python.Optics.Indents

Methods

_Indents :: Traversal' (Else [] a) (Indents a) Source #

HasIndents (While ([] :: [Type]) a) a Source # 
Instance details

Defined in Language.Python.Optics.Indents

Methods

_Indents :: Traversal' (While [] a) (Indents a) Source #

HasIndents (Elif ([] :: [Type]) a) a Source # 
Instance details

Defined in Language.Python.Optics.Indents

Methods

_Indents :: Traversal' (Elif [] a) (Indents a) Source #

HasIndents (If ([] :: [Type]) a) a Source # 
Instance details

Defined in Language.Python.Optics.Indents

Methods

_Indents :: Traversal' (If [] a) (Indents a) Source #

HasIndents (For ([] :: [Type]) a) a Source # 
Instance details

Defined in Language.Python.Optics.Indents

Methods

_Indents :: Traversal' (For [] a) (Indents a) Source #

HasIndents (Finally ([] :: [Type]) a) a Source # 
Instance details

Defined in Language.Python.Optics.Indents

Methods

_Indents :: Traversal' (Finally [] a) (Indents a) Source #

HasIndents (Except ([] :: [Type]) a) a Source # 
Instance details

Defined in Language.Python.Optics.Indents

Methods

_Indents :: Traversal' (Except [] a) (Indents a) Source #

HasIndents (TryExcept ([] :: [Type]) a) a Source # 
Instance details

Defined in Language.Python.Optics.Indents

HasIndents (TryFinally ([] :: [Type]) a) a Source # 
Instance details

Defined in Language.Python.Optics.Indents

HasIndents (ClassDef ([] :: [Type]) a) a Source # 
Instance details

Defined in Language.Python.Optics.Indents

HasIndents (With ([] :: [Type]) a) a Source # 
Instance details

Defined in Language.Python.Optics.Indents

Methods

_Indents :: Traversal' (With [] a) (Indents a) Source #