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

Methods

_Indents :: Traversal' (PyToken a) (Indents a) Source #

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

Defined in Language.Python.Optics.Indents

Methods

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

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

Defined in Language.Python.Optics.Indents

Methods

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

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

Methods

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

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

Defined in Language.Python.Optics.Indents

Methods

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

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

Methods

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

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

Defined in Language.Python.Optics.Indents

Methods

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

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

Defined in Language.Python.Optics.Indents

Methods

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

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

Defined in Language.Python.Optics.Indents

Methods

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