hpython-0.3: Python language tools

Copyright(C) CSIRO 2017-2019
LicenseBSD3
MaintainerIsaac Elliott <isaace71295@gmail.com>
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell2010

Language.Python.Validate.Scope

Contents

Description

 
Synopsis

Documentation

Main validation functions

Miscellany

Extra types

data Level Source #

Constructors

Toplevel 
Definition 
Control 
Instances
Eq Level Source # 
Instance details

Defined in Language.Python.Validate.Scope

Methods

(==) :: Level -> Level -> Bool #

(/=) :: Level -> Level -> Bool #

Show Level Source # 
Instance details

Defined in Language.Python.Validate.Scope

Methods

showsPrec :: Int -> Level -> ShowS #

show :: Level -> String #

showList :: [Level] -> ShowS #

data Entry a Source #

Constructors

Entry 

Fields

Instances
Functor Entry Source # 
Instance details

Defined in Language.Python.Validate.Scope

Methods

fmap :: (a -> b) -> Entry a -> Entry b #

(<$) :: a -> Entry b -> Entry a #

Eq a => Eq (Entry a) Source # 
Instance details

Defined in Language.Python.Validate.Scope

Methods

(==) :: Entry a -> Entry a -> Bool #

(/=) :: Entry a -> Entry a -> Bool #

Show a => Show (Entry a) Source # 
Instance details

Defined in Language.Python.Validate.Scope

Methods

showsPrec :: Int -> Entry a -> ShowS #

show :: Entry a -> String #

showList :: [Entry a] -> ShowS #

Extra functions

runValidateScope' Source #

Arguments

:: Seq Level

Path

-> Map ByteString (Entry ann)

Context

-> ValidateScope ann e a

Validation action

-> Validation (NonEmpty e) a 

definitionScope :: ValidateScope ann e a -> ValidateScope ann e a Source #

Run a validation action for a definition block

controlScope :: ValidateScope ann e a -> ValidateScope ann e a Source #

Run a validation action for a flow control block

extendScope :: [Ident v ann] -> ValidateScope ann e () Source #

Add some entries to the context, using the current depth and level

Validation functions

validateArgScope :: AsScopeError e a => Arg v a -> ValidateScope a e (Arg (Nub (Scope ': v)) a) Source #

validateComprehensionScope :: AsScopeError e a => (ex v a -> ValidateScope a e (ex (Nub (Scope ': v)) a)) -> Comprehension ex v a -> ValidateScope a e (Comprehension ex (Nub (Scope ': v)) a) Source #