cryptol-3.0.0: Cryptol: The Language of Cryptography

Copyright | (c) 2022 Galois Inc.
License | BSD3
Maintainer | cryptol@galois.com
Stability | provisional
Portability | portable
Safe Haskell | Safe-Inferred
Language | Haskell2010

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

- type ExpandPropGuardsM a = Either Error a
- runExpandPropGuardsM :: ExpandPropGuardsM a -> Either Error a
- data Error = NoSignature (Located PName)
- expandPropGuards :: ModuleG mname PName -> ExpandPropGuardsM (ModuleG mname PName)
- expandModuleDef :: ModuleDefinition PName -> ExpandPropGuardsM (ModuleDefinition PName)
- expandTopDecl :: TopDecl PName -> ExpandPropGuardsM [TopDecl PName]
- expandDecl :: Decl PName -> ExpandPropGuardsM [Decl PName]
- expandBind :: Bind PName -> ExpandPropGuardsM [Bind PName]
- patternToExpr :: Pattern PName -> Expr PName
- newName :: Located PName -> [Prop PName] -> ExpandPropGuardsM (Located PName)

# Documentation

type ExpandPropGuardsM a = Either Error a Source #

Monad

runExpandPropGuardsM :: ExpandPropGuardsM a -> Either Error a Source #

data Error Source #

Error

Constructors

NoSignature (Located PName) |

#### Instances

Instances details

Generic Error Source # |
Instance details Defined in Cryptol.Parser.ExpandPropGuards Associated Types type Rep Error :: Type -> Type Source # Methods from :: Error -> Rep Error x Source # to :: Rep Error x -> Error Source #
Show Error Source # |
Instance details Defined in Cryptol.Parser.ExpandPropGuards Methods showsPrec :: Int -> Error -> ShowS Source # show :: Error -> String Source # showList :: [Error] -> ShowS Source #
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 -> () Source #
type Rep Error Source # |
Instance details Defined in Cryptol.Parser.ExpandPropGuards type Rep Error = D1 ('MetaData "Error" "Cryptol.Parser.ExpandPropGuards" "cryptol-3.0.0-DBVDUAjB1JeD0WzkHH4ckn" 'False) (C1 ('MetaCons "NoSignature" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Located PName))))

expandPropGuards :: ModuleG mname PName -> ExpandPropGuardsM (ModuleG mname PName) Source #

expandModuleDef :: ModuleDefinition PName -> ExpandPropGuardsM (ModuleDefinition PName) Source #

expandTopDecl :: TopDecl PName -> ExpandPropGuardsM [TopDecl PName] Source #

expandDecl :: Decl PName -> ExpandPropGuardsM [Decl PName] Source #

expandBind :: Bind PName -> ExpandPropGuardsM [Bind PName] Source #

patternToExpr :: Pattern PName -> Expr PName Source #

newName :: Located PName -> [Prop PName] -> ExpandPropGuardsM (Located PName) Source #