Copyright | (C) CSIRO 2017-2019 |
---|---|
License | BSD3 |
Maintainer | Isaac Elliott <isaace71295@gmail.com> |
Stability | experimental |
Portability | non-portable |
Safe Haskell | None |
Language | Haskell2010 |
Synopsis
- module Data.Validation
- module Language.Python.Validate.Scope.Error
- data Scope
- type ValidateScope ann e = ValidateM (NonEmpty e) (ReaderT (Seq Level) (State (Map ByteString (Entry ann))))
- runValidateScope :: ValidateScope ann e a -> Validation (NonEmpty e) a
- validateModuleScope :: AsScopeError e a => Module v a -> ValidateScope a e (Module (Nub (Scope ': v)) a)
- validateStatementScope :: AsScopeError e a => Statement v a -> ValidateScope a e (Statement (Nub (Scope ': v)) a)
- validateExprScope :: AsScopeError e a => Expr v a -> ValidateScope a e (Expr (Nub (Scope ': v)) a)
- data Level
- data Entry a = Entry {
- _entryValue :: a
- _entryPath :: !(Seq Level)
- runValidateScope' :: Seq Level -> Map ByteString (Entry ann) -> ValidateScope ann e a -> Validation (NonEmpty e) a
- definitionScope :: ValidateScope ann e a -> ValidateScope ann e a
- controlScope :: ValidateScope ann e a -> ValidateScope ann e a
- inScope :: String -> ValidateScope ann e Bool
- lookupScope :: String -> ValidateScope ann e (Maybe (Entry ann))
- localScope :: (Map ByteString (Entry ann) -> Map ByteString (Entry ann)) -> ValidateScope ann e a -> ValidateScope ann e a
- extendScope :: [Ident v ann] -> ValidateScope ann e ()
- validateArgScope :: AsScopeError e a => Arg v a -> ValidateScope a e (Arg (Nub (Scope ': v)) a)
- validateAssignExprScope :: AsScopeError e a => Expr v a -> ValidateScope a e (Expr (Nub (Scope ': v)) a)
- validateBlockScope :: AsScopeError e a => Block v a -> ValidateScope a e (Block (Nub (Scope ': v)) a)
- validateCompoundStatementScope :: forall e v a. AsScopeError e a => CompoundStatement v a -> ValidateScope a e (CompoundStatement (Nub (Scope ': v)) a)
- 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)
- validateDecoratorScope :: AsScopeError e a => Decorator v a -> ValidateScope a e (Decorator (Nub (Scope ': v)) a)
- validateDictItemScope :: AsScopeError e a => DictItem v a -> ValidateScope a e (DictItem (Nub (Scope ': v)) a)
- validateExceptAsScope :: AsScopeError e a => ExceptAs v a -> ValidateScope a e (ExceptAs (Nub (Scope ': v)) a)
- validateIdentScope :: AsScopeError e a => Ident v a -> ValidateScope a e (Ident (Nub (Scope ': v)) a)
- validateListItemScope :: AsScopeError e a => ListItem v a -> ValidateScope a e (ListItem (Nub (Scope ': v)) a)
- validateParamScope :: AsScopeError e a => Param v a -> ValidateScope a e (Param (Nub (Scope ': v)) a)
- validateSetItemScope :: AsScopeError e a => SetItem v a -> ValidateScope a e (SetItem (Nub (Scope ': v)) a)
- validateSimpleStatementScope :: AsScopeError e a => SimpleStatement v a -> ValidateScope a e (SimpleStatement (Nub (Scope ': v)) a)
- validateSubscriptScope :: AsScopeError e a => Subscript v a -> ValidateScope a e (Subscript (Nub (Scope ': v)) a)
- validateSuiteScope :: AsScopeError e a => Suite v a -> ValidateScope a e (Suite (Nub (Scope ': v)) a)
- validateTupleItemScope :: AsScopeError e a => TupleItem v a -> ValidateScope a e (TupleItem (Nub (Scope ': v)) a)
Documentation
module Data.Validation
Main validation functions
type ValidateScope ann e = ValidateM (NonEmpty e) (ReaderT (Seq Level) (State (Map ByteString (Entry ann)))) Source #
runValidateScope :: ValidateScope ann e a -> Validation (NonEmpty e) a Source #
validateModuleScope :: AsScopeError e a => Module v a -> ValidateScope a e (Module (Nub (Scope ': v)) a) Source #
validateStatementScope :: AsScopeError e a => Statement v a -> ValidateScope a e (Statement (Nub (Scope ': v)) a) Source #
validateExprScope :: AsScopeError e a => Expr v a -> ValidateScope a e (Expr (Nub (Scope ': v)) a) Source #
Miscellany
Extra types
Entry | |
|
Extra functions
:: 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
lookupScope :: String -> ValidateScope ann e (Maybe (Entry ann)) Source #
localScope :: (Map ByteString (Entry ann) -> Map ByteString (Entry ann)) -> ValidateScope ann e a -> ValidateScope ann e a Source #
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 #
validateAssignExprScope :: AsScopeError e a => Expr v a -> ValidateScope a e (Expr (Nub (Scope ': v)) a) Source #
validateBlockScope :: AsScopeError e a => Block v a -> ValidateScope a e (Block (Nub (Scope ': v)) a) Source #
validateCompoundStatementScope :: forall e v a. AsScopeError e a => CompoundStatement v a -> ValidateScope a e (CompoundStatement (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 #
validateDecoratorScope :: AsScopeError e a => Decorator v a -> ValidateScope a e (Decorator (Nub (Scope ': v)) a) Source #
validateDictItemScope :: AsScopeError e a => DictItem v a -> ValidateScope a e (DictItem (Nub (Scope ': v)) a) Source #
validateExceptAsScope :: AsScopeError e a => ExceptAs v a -> ValidateScope a e (ExceptAs (Nub (Scope ': v)) a) Source #
validateIdentScope :: AsScopeError e a => Ident v a -> ValidateScope a e (Ident (Nub (Scope ': v)) a) Source #
validateListItemScope :: AsScopeError e a => ListItem v a -> ValidateScope a e (ListItem (Nub (Scope ': v)) a) Source #
validateParamScope :: AsScopeError e a => Param v a -> ValidateScope a e (Param (Nub (Scope ': v)) a) Source #
validateSetItemScope :: AsScopeError e a => SetItem v a -> ValidateScope a e (SetItem (Nub (Scope ': v)) a) Source #
validateSimpleStatementScope :: AsScopeError e a => SimpleStatement v a -> ValidateScope a e (SimpleStatement (Nub (Scope ': v)) a) Source #
validateSubscriptScope :: AsScopeError e a => Subscript v a -> ValidateScope a e (Subscript (Nub (Scope ': v)) a) Source #
validateSuiteScope :: AsScopeError e a => Suite v a -> ValidateScope a e (Suite (Nub (Scope ': v)) a) Source #
validateTupleItemScope :: AsScopeError e a => TupleItem v a -> ValidateScope a e (TupleItem (Nub (Scope ': v)) a) Source #