cryptol-3.3.0: Cryptol: The Language of Cryptography
Copyright(c) 2022 Galois Inc.
LicenseBSD3
Maintainercryptol@galois.com
Stabilityprovisional
Portabilityportable
Safe HaskellSafe-Inferred
LanguageHaskell2010

Cryptol.Parser.ExpandPropGuards

Description

Expands PropGuards into a top-level definition for each case, and rewrites the body of each case to be an appropriate call to the respectively generated function.

Synopsis

Documentation

data Error Source #

Errors that can happen while expanding constraint guards.

Constructors

NoSignature (Located PName)

A declaration using constraints guard lacks an explicit type signature, which is a requirement.

NestedConstraintGuard (Located PName)

Constraint guards appear somewhere other than the top level, which is not allowed.

Instances

Instances details
Generic Error Source # 
Instance details

Defined in Cryptol.Parser.ExpandPropGuards

Associated Types

type Rep Error :: Type -> Type #

Methods

from :: Error -> Rep Error x #

to :: Rep Error x -> Error #

Show Error Source # 
Instance details

Defined in Cryptol.Parser.ExpandPropGuards

Methods

showsPrec :: Int -> Error -> ShowS #

show :: Error -> String #

showList :: [Error] -> ShowS #

PP Error Source # 
Instance details

Defined in Cryptol.Parser.ExpandPropGuards

Methods

ppPrec :: Int -> Error -> Doc Source #

NFData Error Source # 
Instance details

Defined in Cryptol.Parser.ExpandPropGuards

Methods

rnf :: Error -> () #

type Rep Error Source # 
Instance details

Defined in Cryptol.Parser.ExpandPropGuards

type Rep Error = D1 ('MetaData "Error" "Cryptol.Parser.ExpandPropGuards" "cryptol-3.3.0-7OIQa8lMv7L2xoAlM9JEI6" 'False) (C1 ('MetaCons "NoSignature" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Located PName))) :+: C1 ('MetaCons "NestedConstraintGuard" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Located PName))))

checkNestedGuardsInExpr :: Expr PName -> ExpandPropGuardsM () Source #

Check for nested uses of constraint guards in an expression (e.g., in a local definition bound with where).

checkNestedGuardsInDecl :: Decl PName -> ExpandPropGuardsM () Source #

Check for nested uses of constraint guards in a local declaration.

checkNestedGuardsInBind :: Bind PName -> ExpandPropGuardsM () Source #

Check for nested uses of constraint guards in a local bind.