| Copyright | (c) 2013-2016 Galois Inc. |
|---|---|
| License | BSD3 |
| Maintainer | cryptol@galois.com |
| Stability | provisional |
| Portability | portable |
| Safe Haskell | Safe |
| Language | Haskell2010 |
Cryptol.Parser.AST
Description
Synopsis
- data Ident
- mkIdent :: Text -> Ident
- mkInfix :: Text -> Ident
- isInfixIdent :: Ident -> Bool
- nullIdent :: Ident -> Bool
- identText :: Ident -> Text
- data ModName
- modRange :: Module name -> Range
- data PName
- getModName :: PName -> Maybe ModName
- getIdent :: PName -> Ident
- mkUnqual :: Ident -> PName
- mkQual :: ModName -> Ident -> PName
- data Named a = Named {}
- data Pass
- data Assoc
- data Schema n = Forall [TParam n] [Prop n] (Type n) (Maybe Range)
- data TParam n = TParam {}
- data Kind
- data Type n
- newtype Prop n = CType (Type n)
- tsName :: TySyn name -> Located name
- psName :: PropSyn name -> Located name
- tsFixity :: TySyn name -> Maybe Fixity
- psFixity :: PropSyn name -> Maybe Fixity
- type Module = ModuleG ModName
- data ModuleG mname name = Module {}
- mDecls :: ModuleG mname name -> [TopDecl name]
- mImports :: ModuleG mname name -> [Located Import]
- mModParams :: ModuleG mname name -> [ModParam name]
- mIsFunctor :: ModuleG mname nmae -> Bool
- isParamDecl :: TopDecl a -> Bool
- data ModuleDefinition name
- = NormalModule [TopDecl name]
- | FunctorInstance (Located (ImpName name)) (ModuleInstanceArgs name) (ModuleInstance name)
- | InterfaceModule (Signature name)
- data ModuleInstanceArgs name
- = DefaultInstArg (Located (ModuleInstanceArg name))
- | DefaultInstAnonArg [TopDecl name]
- | NamedInstArgs [ModuleInstanceNamedArg name]
- data ModuleInstanceNamedArg name = ModuleInstanceNamedArg (Located Ident) (Located (ModuleInstanceArg name))
- data ModuleInstanceArg name
- = ModuleArg (ImpName name)
- | ParameterArg Ident
- | AddParams
- type ModuleInstance name = Map name name
- emptyModuleInstance :: Ord name => ModuleInstance name
- newtype Program name = Program [TopDecl name]
- data TopDecl name
- = Decl (TopLevel (Decl name))
- | DPrimType (TopLevel (PrimType name))
- | TDNewtype (TopLevel (Newtype name))
- | TDEnum (TopLevel (EnumDecl name))
- | Include (Located FilePath)
- | DParamDecl Range (Signature name)
- | DModule (TopLevel (NestedModule name))
- | DImport (Located (ImportG (ImpName name)))
- | DModParam (ModParam name)
- | DInterfaceConstraint (Maybe (Located Text)) (Located [Prop name])
- data Decl name
- data Fixity = Fixity {}
- defaultFixity :: Fixity
- data FixityCmp
- compareFixity :: Fixity -> Fixity -> FixityCmp
- data TySyn n = TySyn (Located n) (Maybe Fixity) [TParam n] (Type n)
- data PropSyn n = PropSyn (Located n) (Maybe Fixity) [TParam n] [Prop n]
- data Bind name = Bind {}
- bindParams :: Bind name -> [Pattern name]
- bindHeaderLoc :: Bind name -> Maybe Range
- data BindParams name
- = PatternParams [Pattern name]
- | DroppedParams (Maybe Range) Int
- dropParams :: BindParams name -> BindParams name
- noParams :: BindParams name
- data BindDef name
- type LBindDef = Located (BindDef PName)
- data BindImpl name
- = DExpr (Expr name)
- | DPropGuards [PropGuardCase name]
- bindImpl :: Bind name -> Maybe (BindImpl name)
- exprDef :: Expr name -> BindDef name
- data Pragma
- data ExportType
- data TopLevel a = TopLevel {}
- type Import = ImportG ModName
- data ImportG mname = Import {}
- data ImportSpec
- data ImpName name
- impNameModPath :: ImpName Name -> ModPath
- data Newtype name = Newtype {}
- data EnumDecl name = EnumDecl {}
- data EnumCon name = EnumCon {}
- data PrimType name = PrimType {}
- data ParameterType name = ParameterType {}
- data ParameterFun name = ParameterFun {}
- data ParameterConstraint name = ParameterConstraint {}
- newtype NestedModule name = NestedModule (ModuleG name name)
- data Signature name = Signature {
- sigImports :: ![Located (ImportG (ImpName name))]
- sigTypeParams :: [ParameterType name]
- sigConstraints :: [Located (Prop name)]
- sigDecls :: [SigDecl name]
- sigFunParams :: [ParameterFun name]
- data SigDecl name
- data ModParam name = ModParam {}
- data ParamDecl name
- = DParameterType (ParameterType name)
- | DParameterFun (ParameterFun name)
- | DParameterDecl (SigDecl name)
- | DParameterConstraint (ParameterConstraint name)
- data PropGuardCase name = PropGuardCase {}
- data ForeignMode
- data ReplInput name
- = ExprInput (Expr name)
- | LetInput [Decl name]
- | EmptyInput
- data Expr n
- = EVar n
- | ELit Literal
- | EGenerate (Expr n)
- | ETuple [Expr n]
- | ERecord (Rec (Expr n))
- | ESel (Expr n) Selector
- | EUpd (Maybe (Expr n)) [UpdField n]
- | EList [Expr n]
- | EFromTo (Type n) (Maybe (Type n)) (Type n) (Maybe (Type n))
- | EFromToBy Bool (Type n) (Type n) (Type n) (Maybe (Type n))
- | EFromToDownBy Bool (Type n) (Type n) (Type n) (Maybe (Type n))
- | EFromToLessThan (Type n) (Type n) (Maybe (Type n))
- | EInfFrom (Expr n) (Maybe (Expr n))
- | EComp (Expr n) [[Match n]]
- | EApp (Expr n) (Expr n)
- | EAppT (Expr n) [TypeInst n]
- | EIf (Expr n) (Expr n) (Expr n)
- | ECase (Expr n) [CaseAlt n]
- | EWhere (Expr n) [Decl n]
- | ETyped (Expr n) (Type n)
- | ETypeVal (Type n)
- | EFun (FunDesc n) [Pattern n] (Expr n)
- | ELocated (Expr n) Range
- | ESplit (Expr n)
- | EParens (Expr n)
- | EInfix (Expr n) (Located n) Fixity (Expr n)
- | EPrefix PrefixOp (Expr n)
- data Literal
- data NumInfo
- data FracInfo
- data Match name
- data Pattern n
- data Selector
- data CaseAlt n = CaseAlt (Pattern n) (Expr n)
- data TypeInst name
- data UpdField n = UpdField UpdHow [Located Selector] (Expr n)
- data UpdHow
- data FunDesc n = FunDesc {
- funDescrName :: Maybe n
- funDescrArgOffset :: Int
- emptyFunDesc :: FunDesc n
- data PrefixOp
- prefixFixity :: PrefixOp -> Fixity
- asEApps :: Expr n -> (Expr n, [Expr n])
- data Located a = Located {}
- type LPName = Located PName
- type LString = Located String
- type LIdent = Located Ident
- class NoPos t where
- noPos :: t -> t
- cppKind :: Kind -> Doc
- ppSelector :: Selector -> Doc
Names
The type of identifiers. * The boolean flag indicates whether or not they're infix operators. The boolean is present just as cached information from the lexer, and never used during comparisons. * The MaybeAnon indicates if this is an anonymous name
Instances
| IsString Ident Source # | |
Defined in Cryptol.Utils.Ident Methods fromString :: String -> Ident # | |
| Generic Ident Source # | |
| Show Ident Source # | |
| ShowParseable Ident Source # | |
Defined in Cryptol.TypeCheck.Parseable | |
| PP Ident Source # | |
| NFData Ident Source # | |
Defined in Cryptol.Utils.Ident | |
| Eq Ident Source # | |
| Ord Ident Source # | |
| type Rep Ident Source # | |
Defined in Cryptol.Utils.Ident | |
isInfixIdent :: Ident -> Bool Source #
Top-level Module names are just text.
Names that originate in the parser. Note here that other kinds of PName do not need this kind of flag because: (1) NewName are generated by the system, so these should never be user visible. (2) Qual names are user names use to refer to imported modules. Should these names names ever be used to refer to system names, then there make be a bug in the renamer that needs to be fixed.
Constructors
| UnQual' !Ident !NameSource | Unqualified names like |
| Qual !ModName !Ident | Qualified names like |
| NewName !Pass !Int | Fresh names generated by a pass. |
Instances
Instances
| Foldable Named Source # | |||||
Defined in Cryptol.Parser.AST Methods fold :: Monoid m => Named m -> m # foldMap :: Monoid m => (a -> m) -> Named a -> m # foldMap' :: Monoid m => (a -> m) -> Named a -> m # foldr :: (a -> b -> b) -> b -> Named a -> b # foldr' :: (a -> b -> b) -> b -> Named a -> b # foldl :: (b -> a -> b) -> b -> Named a -> b # foldl' :: (b -> a -> b) -> b -> Named a -> b # foldr1 :: (a -> a -> a) -> Named a -> a # foldl1 :: (a -> a -> a) -> Named a -> a # elem :: Eq a => a -> Named a -> Bool # maximum :: Ord a => Named a -> a # minimum :: Ord a => Named a -> a # | |||||
| Traversable Named Source # | |||||
| Functor Named Source # | |||||
| Generic (Named a) Source # | |||||
Defined in Cryptol.Parser.AST Associated Types
| |||||
| Show a => Show (Named a) Source # | |||||
| NoPos t => NoPos (Named t) Source # | |||||
| HasLoc a => HasLoc (Named a) Source # | |||||
| NFData a => NFData (Named a) Source # | |||||
Defined in Cryptol.Parser.AST | |||||
| Eq a => Eq (Named a) Source # | |||||
| type Rep (Named a) Source # | |||||
Defined in Cryptol.Parser.AST type Rep (Named a) = D1 ('MetaData "Named" "Cryptol.Parser.AST" "cryptol-3.5.0-HoSGjqdyafy4TMoEJgOBMg" 'False) (C1 ('MetaCons "Named" 'PrefixI 'True) (S1 ('MetaSel ('Just "name") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Located Ident)) :*: S1 ('MetaSel ('Just "value") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a))) | |||||
Passes that can generate fresh names.
Constructors
| NoPat | |
| MonoValues | |
| ExpandPropGuards String |
Instances
| Generic Pass Source # | |||||
Defined in Cryptol.Parser.Name Associated Types
| |||||
| Show Pass Source # | |||||
| NFData Pass Source # | |||||
Defined in Cryptol.Parser.Name | |||||
| Eq Pass Source # | |||||
| Ord Pass Source # | |||||
| type Rep Pass Source # | |||||
Defined in Cryptol.Parser.Name type Rep Pass = D1 ('MetaData "Pass" "Cryptol.Parser.Name" "cryptol-3.5.0-HoSGjqdyafy4TMoEJgOBMg" 'False) (C1 ('MetaCons "NoPat" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "MonoValues" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ExpandPropGuards" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String)))) | |||||
Information about associativity.
Constructors
| LeftAssoc | |
| RightAssoc | |
| NonAssoc |
Instances
| Generic Assoc Source # | |||||
Defined in Cryptol.Utils.Fixity Associated Types
| |||||
| Show Assoc Source # | |||||
| PP Assoc Source # | |||||
| NFData Assoc Source # | |||||
Defined in Cryptol.Utils.Fixity | |||||
| Eq Assoc Source # | |||||
| Ord Assoc Source # | |||||
| type Rep Assoc Source # | |||||
Defined in Cryptol.Utils.Fixity type Rep Assoc = D1 ('MetaData "Assoc" "Cryptol.Utils.Fixity" "cryptol-3.5.0-HoSGjqdyafy4TMoEJgOBMg" 'False) (C1 ('MetaCons "LeftAssoc" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "RightAssoc" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "NonAssoc" 'PrefixI 'False) (U1 :: Type -> Type))) | |||||
Types
Instances
| Functor Schema Source # | |||||
| Rename Schema Source # | Rename a schema, assuming that none of its type variables are already in scope. | ||||
| Generic (Schema n) Source # | |||||
Defined in Cryptol.Parser.AST Associated Types
| |||||
| Show n => Show (Schema n) Source # | |||||
| BindsNames (Schema PName) Source # | Generate a type renaming environment from the parameters that are bound by this schema. | ||||
Defined in Cryptol.ModuleSystem.Binds | |||||
| NoPos (Schema name) Source # | |||||
| AddLoc (Schema name) Source # | |||||
| HasLoc (Schema name) Source # | |||||
| PPName name => PP (Schema name) Source # | |||||
| NFData n => NFData (Schema n) Source # | |||||
Defined in Cryptol.Parser.AST | |||||
| Eq n => Eq (Schema n) Source # | |||||
| type Rep (Schema n) Source # | |||||
Defined in Cryptol.Parser.AST type Rep (Schema n) = D1 ('MetaData "Schema" "Cryptol.Parser.AST" "cryptol-3.5.0-HoSGjqdyafy4TMoEJgOBMg" 'False) (C1 ('MetaCons "Forall" 'PrefixI 'False) ((S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [TParam n]) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Prop n])) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Type n)) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Range))))) | |||||
Instances
| Functor TParam Source # | |||||
| Rename TParam Source # | |||||
| Generic (TParam n) Source # | |||||
Defined in Cryptol.Parser.AST Associated Types
| |||||
| Show n => Show (TParam n) Source # | |||||
| BindsNames (TParam PName) Source # | Generate the naming environment for a type parameter. | ||||
Defined in Cryptol.ModuleSystem.Binds | |||||
| NoPos (TParam name) Source # | |||||
| AddLoc (TParam name) Source # | |||||
| HasLoc (TParam name) Source # | |||||
| PPName name => PP (TParam name) Source # | |||||
| NFData n => NFData (TParam n) Source # | |||||
Defined in Cryptol.Parser.AST | |||||
| Eq n => Eq (TParam n) Source # | |||||
| type Rep (TParam n) Source # | |||||
Defined in Cryptol.Parser.AST type Rep (TParam n) = D1 ('MetaData "TParam" "Cryptol.Parser.AST" "cryptol-3.5.0-HoSGjqdyafy4TMoEJgOBMg" 'False) (C1 ('MetaCons "TParam" 'PrefixI 'True) (S1 ('MetaSel ('Just "tpName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 n) :*: (S1 ('MetaSel ('Just "tpKind") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Kind)) :*: S1 ('MetaSel ('Just "tpRange") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Range))))) | |||||
Instances
| Generic Kind Source # | |||||
Defined in Cryptol.Parser.AST Associated Types
| |||||
| Show Kind Source # | |||||
| PP Kind Source # | |||||
| NFData Kind Source # | |||||
Defined in Cryptol.Parser.AST | |||||
| Eq Kind Source # | |||||
| type Rep Kind Source # | |||||
Defined in Cryptol.Parser.AST type Rep Kind = D1 ('MetaData "Kind" "Cryptol.Parser.AST" "cryptol-3.5.0-HoSGjqdyafy4TMoEJgOBMg" 'False) ((C1 ('MetaCons "KProp" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "KNum" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "KType" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "KFun" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Kind) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Kind)))) | |||||
Constructors
| TFun (Type n) (Type n) | [8] -> [8] |
| TSeq (Type n) (Type n) | [8] a |
| TBit | Bit |
| TNum Integer | 10 |
| TChar Char | |
| TUser (Located n) [Type n] | A type variable or synonym |
| TTyApp [Named (Type n)] | `{ x = [8], y = Integer } |
| TRecord (Rec (Type n)) | { x : [8], y : [32] } |
| TTuple [Type n] | ([8], [32]) |
| TWild |
|
| TLocated (Type n) Range | Location information |
| TParens (Type n) (Maybe Kind) | (ty) |
| TInfix (Type n) (Located n) Fixity (Type n) | ty + ty |
Instances
| Functor Type Source # | |
| Rename Type Source # | |
| Generic (Type n) Source # | |
| Show n => Show (Type n) Source # | |
| NoPos (Type name) Source # | |
| AddLoc (Type name) Source # | |
| HasLoc (Type name) Source # | |
| PPName name => PP (Type name) Source # | |
| NFData n => NFData (Type n) Source # | |
Defined in Cryptol.Parser.AST | |
| Eq n => Eq (Type n) Source # | |
| type Rep (Type n) Source # | |
Defined in Cryptol.Parser.AST | |
Instances
| Functor Prop Source # | |||||
| Rename Prop Source # | |||||
| Generic (Prop n) Source # | |||||
Defined in Cryptol.Parser.AST Associated Types
| |||||
| Show n => Show (Prop n) Source # | |||||
| NoPos (Prop name) Source # | |||||
| PPName name => PP (Prop name) Source # | |||||
| PPName name => PP [Prop name] Source # | |||||
| NFData n => NFData (Prop n) Source # | |||||
Defined in Cryptol.Parser.AST | |||||
| Eq n => Eq (Prop n) Source # | |||||
| type Rep (Prop n) Source # | |||||
Defined in Cryptol.Parser.AST | |||||
Declarations
data ModuleG mname name Source #
A module for the pre-typechecker phases. The two parameters are:
Constructors
| Module | |
Fields
| |
Instances
| Generic (ModuleG mname name) Source # | |||||
Defined in Cryptol.Parser.AST Associated Types
| |||||
| (Show mname, Show name) => Show (ModuleG mname name) Source # | |||||
| NoPos (ModuleG mname name) Source # | |||||
| RemovePatterns (ModuleG mname PName) Source # | |||||
Defined in Cryptol.Parser.NoPat | |||||
| HasLoc (ModuleG mname name) Source # | |||||
| (Show name, PPName mname, PPName name) => PP (ModuleG mname name) Source # | |||||
| (NFData mname, NFData name) => NFData (ModuleG mname name) Source # | |||||
Defined in Cryptol.Parser.AST | |||||
| type Rep (ModuleG mname name) Source # | |||||
Defined in Cryptol.Parser.AST type Rep (ModuleG mname name) = D1 ('MetaData "ModuleG" "Cryptol.Parser.AST" "cryptol-3.5.0-HoSGjqdyafy4TMoEJgOBMg" 'False) (C1 ('MetaCons "Module" 'PrefixI 'True) ((S1 ('MetaSel ('Just "mName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Located mname)) :*: S1 ('MetaSel ('Just "mDef") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (ModuleDefinition name))) :*: (S1 ('MetaSel ('Just "mInScope") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 NamingEnv) :*: S1 ('MetaSel ('Just "mDocTop") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe (Located Text)))))) | |||||
mImports :: ModuleG mname name -> [Located Import] Source #
Imports of top-level (i.e. "file" based) modules.
mModParams :: ModuleG mname name -> [ModParam name] Source #
Get the module parameters of a module (new module system)
mIsFunctor :: ModuleG mname nmae -> Bool Source #
isParamDecl :: TopDecl a -> Bool Source #
data ModuleDefinition name Source #
Different flavours of modules we have.
Constructors
| NormalModule [TopDecl name] | |
| FunctorInstance (Located (ImpName name)) (ModuleInstanceArgs name) (ModuleInstance name) | The instance is filled in by the renamer |
| InterfaceModule (Signature name) |
Instances
| Generic (ModuleDefinition name) Source # | |||||
Defined in Cryptol.Parser.AST Associated Types
Methods from :: ModuleDefinition name -> Rep (ModuleDefinition name) x # to :: Rep (ModuleDefinition name) x -> ModuleDefinition name # | |||||
| Show name => Show (ModuleDefinition name) Source # | |||||
Defined in Cryptol.Parser.AST Methods showsPrec :: Int -> ModuleDefinition name -> ShowS # show :: ModuleDefinition name -> String # showList :: [ModuleDefinition name] -> ShowS # | |||||
| NoPos (ModuleDefinition name) Source # | |||||
Defined in Cryptol.Parser.AST Methods noPos :: ModuleDefinition name -> ModuleDefinition name Source # | |||||
| (Show name, PPName name) => PP (ModuleDefinition name) Source # | |||||
Defined in Cryptol.Parser.AST Methods ppPrec :: Int -> ModuleDefinition name -> Doc Source # ppPrecWithAnnot :: [([Int], PPAnnot)] -> Int -> ModuleDefinition name -> Doc Source # | |||||
| NFData name => NFData (ModuleDefinition name) Source # | |||||
Defined in Cryptol.Parser.AST Methods rnf :: ModuleDefinition name -> () # | |||||
| type Rep (ModuleDefinition name) Source # | |||||
Defined in Cryptol.Parser.AST type Rep (ModuleDefinition name) = D1 ('MetaData "ModuleDefinition" "Cryptol.Parser.AST" "cryptol-3.5.0-HoSGjqdyafy4TMoEJgOBMg" 'False) (C1 ('MetaCons "NormalModule" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [TopDecl name])) :+: (C1 ('MetaCons "FunctorInstance" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Located (ImpName name))) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (ModuleInstanceArgs name)) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (ModuleInstance name)))) :+: C1 ('MetaCons "InterfaceModule" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Signature name))))) | |||||
data ModuleInstanceArgs name Source #
All arguments in a functor instantiation
Constructors
| DefaultInstArg (Located (ModuleInstanceArg name)) | Single parameter instantitaion |
| DefaultInstAnonArg [TopDecl name] | Single parameter instantitaion using this anonymous module. (parser only) |
| NamedInstArgs [ModuleInstanceNamedArg name] |
Instances
| Rename ModuleInstanceArgs Source # | |||||
Defined in Cryptol.ModuleSystem.Renamer Methods rename :: ModuleInstanceArgs PName -> RenameM (ModuleInstanceArgs Name) Source # | |||||
| Generic (ModuleInstanceArgs name) Source # | |||||
Defined in Cryptol.Parser.AST Associated Types
Methods from :: ModuleInstanceArgs name -> Rep (ModuleInstanceArgs name) x # to :: Rep (ModuleInstanceArgs name) x -> ModuleInstanceArgs name # | |||||
| Show name => Show (ModuleInstanceArgs name) Source # | |||||
Defined in Cryptol.Parser.AST Methods showsPrec :: Int -> ModuleInstanceArgs name -> ShowS # show :: ModuleInstanceArgs name -> String # showList :: [ModuleInstanceArgs name] -> ShowS # | |||||
| NoPos (ModuleInstanceArgs name) Source # | |||||
Defined in Cryptol.Parser.AST Methods noPos :: ModuleInstanceArgs name -> ModuleInstanceArgs name Source # | |||||
| (Show name, PPName name) => PP (ModuleInstanceArgs name) Source # | |||||
Defined in Cryptol.Parser.AST Methods ppPrec :: Int -> ModuleInstanceArgs name -> Doc Source # ppPrecWithAnnot :: [([Int], PPAnnot)] -> Int -> ModuleInstanceArgs name -> Doc Source # | |||||
| NFData name => NFData (ModuleInstanceArgs name) Source # | |||||
Defined in Cryptol.Parser.AST Methods rnf :: ModuleInstanceArgs name -> () # | |||||
| type Rep (ModuleInstanceArgs name) Source # | |||||
Defined in Cryptol.Parser.AST type Rep (ModuleInstanceArgs name) = D1 ('MetaData "ModuleInstanceArgs" "Cryptol.Parser.AST" "cryptol-3.5.0-HoSGjqdyafy4TMoEJgOBMg" 'False) (C1 ('MetaCons "DefaultInstArg" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Located (ModuleInstanceArg name)))) :+: (C1 ('MetaCons "DefaultInstAnonArg" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [TopDecl name])) :+: C1 ('MetaCons "NamedInstArgs" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [ModuleInstanceNamedArg name])))) | |||||
data ModuleInstanceNamedArg name Source #
A named argument in a functor instantiation
Constructors
| ModuleInstanceNamedArg (Located Ident) (Located (ModuleInstanceArg name)) |
Instances
| Rename ModuleInstanceNamedArg Source # | |||||
Defined in Cryptol.ModuleSystem.Renamer Methods rename :: ModuleInstanceNamedArg PName -> RenameM (ModuleInstanceNamedArg Name) Source # | |||||
| Generic (ModuleInstanceNamedArg name) Source # | |||||
Defined in Cryptol.Parser.AST Associated Types
Methods from :: ModuleInstanceNamedArg name -> Rep (ModuleInstanceNamedArg name) x # to :: Rep (ModuleInstanceNamedArg name) x -> ModuleInstanceNamedArg name # | |||||
| Show name => Show (ModuleInstanceNamedArg name) Source # | |||||
Defined in Cryptol.Parser.AST Methods showsPrec :: Int -> ModuleInstanceNamedArg name -> ShowS # show :: ModuleInstanceNamedArg name -> String # showList :: [ModuleInstanceNamedArg name] -> ShowS # | |||||
| NoPos (ModuleInstanceNamedArg name) Source # | |||||
Defined in Cryptol.Parser.AST Methods noPos :: ModuleInstanceNamedArg name -> ModuleInstanceNamedArg name Source # | |||||
| (Show name, PPName name) => PP (ModuleInstanceNamedArg name) Source # | |||||
Defined in Cryptol.Parser.AST Methods ppPrec :: Int -> ModuleInstanceNamedArg name -> Doc Source # ppPrecWithAnnot :: [([Int], PPAnnot)] -> Int -> ModuleInstanceNamedArg name -> Doc Source # | |||||
| NFData name => NFData (ModuleInstanceNamedArg name) Source # | |||||
Defined in Cryptol.Parser.AST Methods rnf :: ModuleInstanceNamedArg name -> () # | |||||
| type Rep (ModuleInstanceNamedArg name) Source # | |||||
Defined in Cryptol.Parser.AST type Rep (ModuleInstanceNamedArg name) = D1 ('MetaData "ModuleInstanceNamedArg" "Cryptol.Parser.AST" "cryptol-3.5.0-HoSGjqdyafy4TMoEJgOBMg" 'False) (C1 ('MetaCons "ModuleInstanceNamedArg" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Located Ident)) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Located (ModuleInstanceArg name))))) | |||||
data ModuleInstanceArg name Source #
An argument in a functor instantiation
Constructors
| ModuleArg (ImpName name) | An argument that is a module |
| ParameterArg Ident | An argument that is a parameter |
| AddParams | Arguments adds extra parameters to decls. ("backtick" import) |
Instances
| Rename ModuleInstanceArg Source # | |||||
Defined in Cryptol.ModuleSystem.Renamer Methods rename :: ModuleInstanceArg PName -> RenameM (ModuleInstanceArg Name) Source # | |||||
| Generic (ModuleInstanceArg name) Source # | |||||
Defined in Cryptol.Parser.AST Associated Types
Methods from :: ModuleInstanceArg name -> Rep (ModuleInstanceArg name) x # to :: Rep (ModuleInstanceArg name) x -> ModuleInstanceArg name # | |||||
| Show name => Show (ModuleInstanceArg name) Source # | |||||
Defined in Cryptol.Parser.AST Methods showsPrec :: Int -> ModuleInstanceArg name -> ShowS # show :: ModuleInstanceArg name -> String # showList :: [ModuleInstanceArg name] -> ShowS # | |||||
| (Show name, PPName name) => PP (ModuleInstanceArg name) Source # | |||||
Defined in Cryptol.Parser.AST Methods ppPrec :: Int -> ModuleInstanceArg name -> Doc Source # ppPrecWithAnnot :: [([Int], PPAnnot)] -> Int -> ModuleInstanceArg name -> Doc Source # | |||||
| NFData name => NFData (ModuleInstanceArg name) Source # | |||||
Defined in Cryptol.Parser.AST Methods rnf :: ModuleInstanceArg name -> () # | |||||
| type Rep (ModuleInstanceArg name) Source # | |||||
Defined in Cryptol.Parser.AST type Rep (ModuleInstanceArg name) = D1 ('MetaData "ModuleInstanceArg" "Cryptol.Parser.AST" "cryptol-3.5.0-HoSGjqdyafy4TMoEJgOBMg" 'False) (C1 ('MetaCons "ModuleArg" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (ImpName name))) :+: (C1 ('MetaCons "ParameterArg" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Ident)) :+: C1 ('MetaCons "AddParams" 'PrefixI 'False) (U1 :: Type -> Type))) | |||||
type ModuleInstance name = Map name name Source #
Maps names in the original functor with names in the instnace. Does *NOT* include the parameters, just names for the definitions. This *DOES* include entries for all the name in the instantiated functor, including names in modules nested inside the functor.
emptyModuleInstance :: Ord name => ModuleInstance name Source #
A declaration that may only appear at the top level of a module. The module may be nested, however.
Constructors
| Decl (TopLevel (Decl name)) | |
| DPrimType (TopLevel (PrimType name)) | |
| TDNewtype (TopLevel (Newtype name)) | @newtype T as = t |
| TDEnum (TopLevel (EnumDecl name)) | enum T as = cons |
| Include (Located FilePath) |
|
| DParamDecl Range (Signature name) |
|
| DModule (TopLevel (NestedModule name)) | submodule M where ... |
| DImport (Located (ImportG (ImpName name))) | import X |
| DModParam (ModParam name) | import interface X ... |
| DInterfaceConstraint (Maybe (Located Text)) (Located [Prop name]) | interface constraint |
Instances
| Rename TopDecl Source # | |||||
| Generic (TopDecl name) Source # | |||||
Defined in Cryptol.Parser.AST Associated Types
| |||||
| Show name => Show (TopDecl name) Source # | |||||
| BindsNames (InModule (TopDecl PName)) Source # | |||||
Defined in Cryptol.ModuleSystem.Binds | |||||
| NoPos (TopDecl name) Source # | |||||
| HasLoc (TopDecl name) Source # | |||||
| (Show name, PPName name) => PP (TopDecl name) Source # | |||||
| NFData name => NFData (TopDecl name) Source # | |||||
Defined in Cryptol.Parser.AST | |||||
| type Rep (TopDecl name) Source # | |||||
Defined in Cryptol.Parser.AST type Rep (TopDecl name) = D1 ('MetaData "TopDecl" "Cryptol.Parser.AST" "cryptol-3.5.0-HoSGjqdyafy4TMoEJgOBMg" 'False) (((C1 ('MetaCons "Decl" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (TopLevel (Decl name)))) :+: C1 ('MetaCons "DPrimType" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (TopLevel (PrimType name))))) :+: (C1 ('MetaCons "TDNewtype" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (TopLevel (Newtype name)))) :+: (C1 ('MetaCons "TDEnum" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (TopLevel (EnumDecl name)))) :+: C1 ('MetaCons "Include" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Located FilePath)))))) :+: ((C1 ('MetaCons "DParamDecl" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Range) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Signature name))) :+: C1 ('MetaCons "DModule" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (TopLevel (NestedModule name))))) :+: (C1 ('MetaCons "DImport" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Located (ImportG (ImpName name))))) :+: (C1 ('MetaCons "DModParam" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (ModParam name))) :+: C1 ('MetaCons "DInterfaceConstraint" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe (Located Text))) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Located [Prop name]))))))) | |||||
A simple declaration. Generally these are things that can appear both at the top-level of a module and in `where` clauses.
Constructors
| DSignature [Located name] (Schema name) | A type signature. Eliminated in NoPat--after NoPat signatures are in their associated Bind |
| DFixity !Fixity [Located name] | A fixity declaration. Eliminated in NoPat---after NoPat fixities are in their associated Bind |
| DPragma [Located name] Pragma | A pragma declaration. Eliminated in NoPat---after NoPat fixities are in their associated Bind |
| DBind (Bind name) | A non-recursive binding. |
| DRec [Bind name] | A group of recursive bindings. Introduced by the renamer. |
| DPatBind (Pattern name) (Expr name) | A pattern binding. Eliminated in NoPat---after NoPat fixities are in their associated Bind |
| DType (TySyn name) | A type synonym. |
| DProp (PropSyn name) | A constraint synonym. |
| DLocated (Decl name) Range | Keeps track of the location of a declaration. |
Instances
| Functor Decl Source # | |||||
| Rename Decl Source # | |||||
| Generic (Decl name) Source # | |||||
Defined in Cryptol.Parser.AST Associated Types
| |||||
| Show name => Show (Decl name) Source # | |||||
| BindsNames (InModule (Decl PName)) Source # | The naming environment for a single declaration. | ||||
Defined in Cryptol.ModuleSystem.Binds | |||||
| NoPos (Decl name) Source # | |||||
| RemovePatterns [Decl PName] Source # | |||||
Defined in Cryptol.Parser.NoPat | |||||
| AddLoc (Decl name) Source # | |||||
| HasLoc (Decl name) Source # | |||||
| (Show name, PPName name) => PP (Decl name) Source # | |||||
| NFData name => NFData (Decl name) Source # | |||||
Defined in Cryptol.Parser.AST | |||||
| Eq name => Eq (Decl name) Source # | |||||
| type Rep (Decl name) Source # | |||||
Defined in Cryptol.Parser.AST type Rep (Decl name) = D1 ('MetaData "Decl" "Cryptol.Parser.AST" "cryptol-3.5.0-HoSGjqdyafy4TMoEJgOBMg" 'False) (((C1 ('MetaCons "DSignature" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Located name]) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Schema name))) :+: C1 ('MetaCons "DFixity" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Fixity) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Located name]))) :+: (C1 ('MetaCons "DPragma" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Located name]) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Pragma)) :+: C1 ('MetaCons "DBind" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Bind name))))) :+: ((C1 ('MetaCons "DRec" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Bind name])) :+: C1 ('MetaCons "DPatBind" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Pattern name)) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Expr name)))) :+: (C1 ('MetaCons "DType" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (TySyn name))) :+: (C1 ('MetaCons "DProp" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (PropSyn name))) :+: C1 ('MetaCons "DLocated" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Decl name)) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Range)))))) | |||||
Instances
| Generic Fixity Source # | |||||
Defined in Cryptol.Utils.Fixity Associated Types
| |||||
| Show Fixity Source # | |||||
| PP Fixity Source # | |||||
| NFData Fixity Source # | |||||
Defined in Cryptol.Utils.Fixity | |||||
| Eq Fixity Source # | |||||
| Ord Fixity Source # | |||||
| type Rep Fixity Source # | |||||
Defined in Cryptol.Utils.Fixity type Rep Fixity = D1 ('MetaData "Fixity" "Cryptol.Utils.Fixity" "cryptol-3.5.0-HoSGjqdyafy4TMoEJgOBMg" 'False) (C1 ('MetaCons "Fixity" 'PrefixI 'True) (S1 ('MetaSel ('Just "fAssoc") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Assoc) :*: S1 ('MetaSel ('Just "fLevel") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int))) | |||||
defaultFixity :: Fixity Source #
The fixity used when none is provided.
compareFixity :: Fixity -> Fixity -> FixityCmp Source #
Let op1 have fixity f1 and op2 have fixity f2. Then
compareFixity f1 f2 determines how to parse the infix expression
x op1 y op2 z@.
FCLeft:(x op1 y) op2 zFCRight:x op1 (y op2 z)FCError: no parse
Instances
| Functor TySyn Source # | |||||
| Rename TySyn Source # | |||||
| Generic (TySyn n) Source # | |||||
Defined in Cryptol.Parser.AST Associated Types
| |||||
| Show n => Show (TySyn n) Source # | |||||
| NoPos (TySyn name) Source # | |||||
| HasLoc (TySyn name) Source # | |||||
| PPName name => PP (TySyn name) Source # | |||||
| NFData n => NFData (TySyn n) Source # | |||||
Defined in Cryptol.Parser.AST | |||||
| Eq n => Eq (TySyn n) Source # | |||||
| type Rep (TySyn n) Source # | |||||
Defined in Cryptol.Parser.AST type Rep (TySyn n) = D1 ('MetaData "TySyn" "Cryptol.Parser.AST" "cryptol-3.5.0-HoSGjqdyafy4TMoEJgOBMg" 'False) (C1 ('MetaCons "TySyn" 'PrefixI 'False) ((S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Located n)) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Fixity))) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [TParam n]) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Type n))))) | |||||
Instances
| Functor PropSyn Source # | |||||
| Rename PropSyn Source # | |||||
| Generic (PropSyn n) Source # | |||||
Defined in Cryptol.Parser.AST Associated Types
| |||||
| Show n => Show (PropSyn n) Source # | |||||
| NoPos (PropSyn name) Source # | |||||
| HasLoc (PropSyn name) Source # | |||||
| PPName name => PP (PropSyn name) Source # | |||||
| NFData n => NFData (PropSyn n) Source # | |||||
Defined in Cryptol.Parser.AST | |||||
| Eq n => Eq (PropSyn n) Source # | |||||
| type Rep (PropSyn n) Source # | |||||
Defined in Cryptol.Parser.AST type Rep (PropSyn n) = D1 ('MetaData "PropSyn" "Cryptol.Parser.AST" "cryptol-3.5.0-HoSGjqdyafy4TMoEJgOBMg" 'False) (C1 ('MetaCons "PropSyn" 'PrefixI 'False) ((S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Located n)) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Fixity))) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [TParam n]) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Prop n])))) | |||||
Bindings. Notes:
- The parser does not associate type signatures and pragmas with their bindings: this is done in a separate pass, after de-sugaring pattern bindings. In this way we can associate pragmas and type signatures with the variables defined by pattern bindings as well.
- Currently, there is no surface syntax for defining monomorphic bindings (i.e., bindings that will not be automatically generalized by the type checker. However, they are useful when de-sugaring patterns.
Constructors
| Bind | |
Fields
| |
Instances
| Functor Bind Source # | |||||
| Rename Bind Source # | Rename a binding. | ||||
| Generic (Bind name) Source # | |||||
Defined in Cryptol.Parser.AST Associated Types
| |||||
| Show name => Show (Bind name) Source # | |||||
| BindsNames (InModule (Bind PName)) Source # | Introduce the name | ||||
Defined in Cryptol.ModuleSystem.Binds | |||||
| NoPos (Bind name) Source # | |||||
| HasLoc (Bind name) Source # | |||||
| (Show name, PPName name) => PP (Bind name) Source # | |||||
| NFData name => NFData (Bind name) Source # | |||||
Defined in Cryptol.Parser.AST | |||||
| Eq name => Eq (Bind name) Source # | |||||
| type Rep (Bind name) Source # | |||||
Defined in Cryptol.Parser.AST type Rep (Bind name) = D1 ('MetaData "Bind" "Cryptol.Parser.AST" "cryptol-3.5.0-HoSGjqdyafy4TMoEJgOBMg" 'False) (C1 ('MetaCons "Bind" 'PrefixI 'True) (((S1 ('MetaSel ('Just "bName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Located name)) :*: S1 ('MetaSel ('Just "bParams") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (BindParams name))) :*: (S1 ('MetaSel ('Just "bDef") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Located (BindDef name))) :*: (S1 ('MetaSel ('Just "bSignature") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe (Located (Schema name)))) :*: S1 ('MetaSel ('Just "bInfix") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool)))) :*: ((S1 ('MetaSel ('Just "bFixity") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Fixity)) :*: S1 ('MetaSel ('Just "bPragmas") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Pragma])) :*: (S1 ('MetaSel ('Just "bMono") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool) :*: (S1 ('MetaSel ('Just "bDoc") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe (Located Text))) :*: S1 ('MetaSel ('Just "bExport") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ExportType)))))) | |||||
bindParams :: Bind name -> [Pattern name] Source #
bindHeaderLoc :: Bind name -> Maybe Range Source #
Range encompassing the LHS of a binder, its signature, but not its definition.
data BindParams name Source #
A list of patterns used as parameters to a Bind.
This is only used to improve error messages, by retaining
information about the original shape of a Bind when
rewriting (see dropParams).
Constructors
| PatternParams [Pattern name] | Parameters that appear in the LHS of a binding equation
as patterns.
e.g. |
| DroppedParams (Maybe Range) Int | Represents zero parameters to a binding equation that
originally had parameters, but was rewritten to have none
(see |
Instances
| Functor BindParams Source # | |||||
Defined in Cryptol.Parser.AST Methods fmap :: (a -> b) -> BindParams a -> BindParams b # (<$) :: a -> BindParams b -> BindParams a # | |||||
| Generic (BindParams name) Source # | |||||
Defined in Cryptol.Parser.AST Associated Types
Methods from :: BindParams name -> Rep (BindParams name) x # to :: Rep (BindParams name) x -> BindParams name # | |||||
| Show name => Show (BindParams name) Source # | |||||
Defined in Cryptol.Parser.AST Methods showsPrec :: Int -> BindParams name -> ShowS # show :: BindParams name -> String # showList :: [BindParams name] -> ShowS # | |||||
| NoPos (BindParams name) Source # | |||||
Defined in Cryptol.Parser.AST Methods noPos :: BindParams name -> BindParams name Source # | |||||
| HasLoc (BindParams name) Source # | |||||
Defined in Cryptol.Parser.AST | |||||
| NFData name => NFData (BindParams name) Source # | |||||
Defined in Cryptol.Parser.AST Methods rnf :: BindParams name -> () # | |||||
| Eq name => Eq (BindParams name) Source # | |||||
Defined in Cryptol.Parser.AST Methods (==) :: BindParams name -> BindParams name -> Bool # (/=) :: BindParams name -> BindParams name -> Bool # | |||||
| type Rep (BindParams name) Source # | |||||
Defined in Cryptol.Parser.AST type Rep (BindParams name) = D1 ('MetaData "BindParams" "Cryptol.Parser.AST" "cryptol-3.5.0-HoSGjqdyafy4TMoEJgOBMg" 'False) (C1 ('MetaCons "PatternParams" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Pattern name])) :+: C1 ('MetaCons "DroppedParams" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Range)) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int))) | |||||
dropParams :: BindParams name -> BindParams name Source #
Sets the number of parameters for a binding to zero, noting
the original number and source location of the patterns.
e.g. when rewriting let f a b c = x -> ..., into
let f = \a b c x -> ... the parameters for f change from
PatternParams [a,b,c] to DroppedParams (getLoc [a,b,c]) 3
noParams :: BindParams name Source #
An empty BindParams (i.e. zero parameters).
Note that dropParams should be used instead of this
when rewriting an existing Bind to have no parameters.
Constructors
| DPrim | |
| DForeign ForeignMode (Maybe (BindImpl name)) | Foreign functions can have an optional cryptol implementation |
| DImpl (BindImpl name) |
Instances
| Functor BindDef Source # | |||||
| Rename BindDef Source # | |||||
| Generic (BindDef name) Source # | |||||
Defined in Cryptol.Parser.AST Associated Types
| |||||
| Show name => Show (BindDef name) Source # | |||||
| (Show name, PPName name) => PP (BindDef name) Source # | |||||
| NFData name => NFData (BindDef name) Source # | |||||
Defined in Cryptol.Parser.AST | |||||
| Eq name => Eq (BindDef name) Source # | |||||
| type Rep (BindDef name) Source # | |||||
Defined in Cryptol.Parser.AST type Rep (BindDef name) = D1 ('MetaData "BindDef" "Cryptol.Parser.AST" "cryptol-3.5.0-HoSGjqdyafy4TMoEJgOBMg" 'False) (C1 ('MetaCons "DPrim" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "DForeign" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ForeignMode) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe (BindImpl name)))) :+: C1 ('MetaCons "DImpl" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (BindImpl name))))) | |||||
Constructors
| DExpr (Expr name) | |
| DPropGuards [PropGuardCase name] |
Instances
| Functor BindImpl Source # | |||||
| Rename BindImpl Source # | |||||
| Generic (BindImpl name) Source # | |||||
Defined in Cryptol.Parser.AST Associated Types
| |||||
| Show name => Show (BindImpl name) Source # | |||||
| (Show name, PPName name) => PP (BindImpl name) Source # | |||||
| NFData name => NFData (BindImpl name) Source # | |||||
Defined in Cryptol.Parser.AST | |||||
| Eq name => Eq (BindImpl name) Source # | |||||
| type Rep (BindImpl name) Source # | |||||
Defined in Cryptol.Parser.AST type Rep (BindImpl name) = D1 ('MetaData "BindImpl" "Cryptol.Parser.AST" "cryptol-3.5.0-HoSGjqdyafy4TMoEJgOBMg" 'False) (C1 ('MetaCons "DExpr" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Expr name))) :+: C1 ('MetaCons "DPropGuards" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [PropGuardCase name]))) | |||||
Constructors
| PragmaNote String | |
| PragmaProperty |
Instances
| Generic Pragma Source # | |||||
Defined in Cryptol.Parser.AST Associated Types
| |||||
| Show Pragma Source # | |||||
| NoPos Pragma Source # | |||||
| PP Pragma Source # | |||||
| NFData Pragma Source # | |||||
Defined in Cryptol.Parser.AST | |||||
| Eq Pragma Source # | |||||
| type Rep Pragma Source # | |||||
Defined in Cryptol.Parser.AST type Rep Pragma = D1 ('MetaData "Pragma" "Cryptol.Parser.AST" "cryptol-3.5.0-HoSGjqdyafy4TMoEJgOBMg" 'False) (C1 ('MetaCons "PragmaNote" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String)) :+: C1 ('MetaCons "PragmaProperty" 'PrefixI 'False) (U1 :: Type -> Type)) | |||||
data ExportType Source #
Export information for a declaration.
Instances
| Generic ExportType Source # | |||||
Defined in Cryptol.Parser.AST Associated Types
| |||||
| Show ExportType Source # | |||||
Defined in Cryptol.Parser.AST Methods showsPrec :: Int -> ExportType -> ShowS # show :: ExportType -> String # showList :: [ExportType] -> ShowS # | |||||
| NFData ExportType Source # | |||||
Defined in Cryptol.Parser.AST Methods rnf :: ExportType -> () # | |||||
| Eq ExportType Source # | |||||
Defined in Cryptol.Parser.AST | |||||
| Ord ExportType Source # | |||||
Defined in Cryptol.Parser.AST Methods compare :: ExportType -> ExportType -> Ordering # (<) :: ExportType -> ExportType -> Bool # (<=) :: ExportType -> ExportType -> Bool # (>) :: ExportType -> ExportType -> Bool # (>=) :: ExportType -> ExportType -> Bool # max :: ExportType -> ExportType -> ExportType # min :: ExportType -> ExportType -> ExportType # | |||||
| type Rep ExportType Source # | |||||
A top-level module declaration.
Instances
| Foldable TopLevel Source # | |||||
Defined in Cryptol.Parser.AST Methods fold :: Monoid m => TopLevel m -> m # foldMap :: Monoid m => (a -> m) -> TopLevel a -> m # foldMap' :: Monoid m => (a -> m) -> TopLevel a -> m # foldr :: (a -> b -> b) -> b -> TopLevel a -> b # foldr' :: (a -> b -> b) -> b -> TopLevel a -> b # foldl :: (b -> a -> b) -> b -> TopLevel a -> b # foldl' :: (b -> a -> b) -> b -> TopLevel a -> b # foldr1 :: (a -> a -> a) -> TopLevel a -> a # foldl1 :: (a -> a -> a) -> TopLevel a -> a # elem :: Eq a => a -> TopLevel a -> Bool # maximum :: Ord a => TopLevel a -> a # minimum :: Ord a => TopLevel a -> a # | |||||
| Traversable TopLevel Source # | |||||
| Functor TopLevel Source # | |||||
| Generic (TopLevel a) Source # | |||||
Defined in Cryptol.Parser.AST Associated Types
| |||||
| Show a => Show (TopLevel a) Source # | |||||
| NoPos a => NoPos (TopLevel a) Source # | |||||
| HasLoc a => HasLoc (TopLevel a) Source # | |||||
| PP a => PP (TopLevel a) Source # | |||||
| NFData a => NFData (TopLevel a) Source # | |||||
Defined in Cryptol.Parser.AST | |||||
| type Rep (TopLevel a) Source # | |||||
Defined in Cryptol.Parser.AST type Rep (TopLevel a) = D1 ('MetaData "TopLevel" "Cryptol.Parser.AST" "cryptol-3.5.0-HoSGjqdyafy4TMoEJgOBMg" 'False) (C1 ('MetaCons "TopLevel" 'PrefixI 'True) (S1 ('MetaSel ('Just "tlExport") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ExportType) :*: (S1 ('MetaSel ('Just "tlDoc") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe (Located Text))) :*: S1 ('MetaSel ('Just "tlValue") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)))) | |||||
An import declaration.
Constructors
| Import | |
Instances
| Generic (ImportG mname) Source # | |||||
Defined in Cryptol.Parser.AST Associated Types
| |||||
| Show mname => Show (ImportG mname) Source # | |||||
| PP mname => PP (ImportG mname) Source # | |||||
| NFData mname => NFData (ImportG mname) Source # | |||||
Defined in Cryptol.Parser.AST | |||||
| type Rep (ImportG mname) Source # | |||||
Defined in Cryptol.Parser.AST type Rep (ImportG mname) = D1 ('MetaData "ImportG" "Cryptol.Parser.AST" "cryptol-3.5.0-HoSGjqdyafy4TMoEJgOBMg" 'False) (C1 ('MetaCons "Import" 'PrefixI 'True) ((S1 ('MetaSel ('Just "iModule") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Located mname)) :*: S1 ('MetaSel ('Just "iAs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe ModName))) :*: (S1 ('MetaSel ('Just "iSpec") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe ImportSpec)) :*: (S1 ('MetaSel ('Just "iInst") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe (ModuleInstanceArgs PName))) :*: S1 ('MetaSel ('Just "iDoc") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe (Located Text))))))) | |||||
data ImportSpec Source #
The list of names following an import.
Instances
| Generic ImportSpec Source # | |||||
Defined in Cryptol.Parser.AST Associated Types
| |||||
| Show ImportSpec Source # | |||||
Defined in Cryptol.Parser.AST Methods showsPrec :: Int -> ImportSpec -> ShowS # show :: ImportSpec -> String # showList :: [ImportSpec] -> ShowS # | |||||
| PP ImportSpec Source # | |||||
Defined in Cryptol.Parser.AST Methods ppPrec :: Int -> ImportSpec -> Doc Source # ppPrecWithAnnot :: [([Int], PPAnnot)] -> Int -> ImportSpec -> Doc Source # | |||||
| NFData ImportSpec Source # | |||||
Defined in Cryptol.Parser.AST Methods rnf :: ImportSpec -> () # | |||||
| Eq ImportSpec Source # | |||||
Defined in Cryptol.Parser.AST | |||||
| type Rep ImportSpec Source # | |||||
Defined in Cryptol.Parser.AST type Rep ImportSpec = D1 ('MetaData "ImportSpec" "Cryptol.Parser.AST" "cryptol-3.5.0-HoSGjqdyafy4TMoEJgOBMg" 'False) (C1 ('MetaCons "Hiding" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Ident])) :+: C1 ('MetaCons "Only" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Ident]))) | |||||
The name of an imported module
Instances
| Rename ImpName Source # | |||||
| Generic (ImpName name) Source # | |||||
Defined in Cryptol.Parser.AST Associated Types
| |||||
| Show name => Show (ImpName name) Source # | |||||
| ModuleInstance name => ModuleInstance (ImpName name) Source # | |||||
Defined in Cryptol.TypeCheck.ModuleInstance Methods moduleInstance :: ImpName name -> ImpName name Source # | |||||
| PP name => PP (ImpName name) Source # | |||||
| NFData name => NFData (ImpName name) Source # | |||||
Defined in Cryptol.Parser.AST | |||||
| Eq name => Eq (ImpName name) Source # | |||||
| Ord name => Ord (ImpName name) Source # | |||||
Defined in Cryptol.Parser.AST | |||||
| type Rep (ImpName name) Source # | |||||
Defined in Cryptol.Parser.AST type Rep (ImpName name) = D1 ('MetaData "ImpName" "Cryptol.Parser.AST" "cryptol-3.5.0-HoSGjqdyafy4TMoEJgOBMg" 'False) (C1 ('MetaCons "ImpTop" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ModName)) :+: C1 ('MetaCons "ImpNested" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 name))) | |||||
Constructors
| Newtype | |
Instances
| Rename Newtype Source # | |
| Generic (Newtype name) Source # | |
| Show name => Show (Newtype name) Source # | |
| BindsNames (InModule (Newtype PName)) Source # | |
Defined in Cryptol.ModuleSystem.Binds | |
| NoPos (Newtype name) Source # | |
| HasLoc (Newtype name) Source # | |
| PPName name => PP (Newtype name) Source # | |
| NFData name => NFData (Newtype name) Source # | |
Defined in Cryptol.Parser.AST | |
| Eq name => Eq (Newtype name) Source # | |
| type Rep (Newtype name) Source # | |
Defined in Cryptol.Parser.AST | |
Constructors
| EnumDecl | |
Instances
| Rename EnumDecl Source # | |||||
| Generic (EnumDecl name) Source # | |||||
Defined in Cryptol.Parser.AST Associated Types
| |||||
| Show name => Show (EnumDecl name) Source # | |||||
| BindsNames (InModule (EnumDecl PName)) Source # | |||||
Defined in Cryptol.ModuleSystem.Binds | |||||
| NoPos (EnumDecl name) Source # | |||||
| HasLoc (EnumDecl name) Source # | |||||
| (Show name, PPName name) => PP (EnumDecl name) Source # | |||||
| NFData name => NFData (EnumDecl name) Source # | |||||
Defined in Cryptol.Parser.AST | |||||
| type Rep (EnumDecl name) Source # | |||||
Defined in Cryptol.Parser.AST type Rep (EnumDecl name) = D1 ('MetaData "EnumDecl" "Cryptol.Parser.AST" "cryptol-3.5.0-HoSGjqdyafy4TMoEJgOBMg" 'False) (C1 ('MetaCons "EnumDecl" 'PrefixI 'True) ((S1 ('MetaSel ('Just "eName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Located name)) :*: S1 ('MetaSel ('Just "eParams") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [TParam name])) :*: (S1 ('MetaSel ('Just "eCons") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [TopLevel (EnumCon name)]) :*: S1 ('MetaSel ('Just "eDeriving") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Located name])))) | |||||
Instances
| Generic (EnumCon name) Source # | |||||
Defined in Cryptol.Parser.AST Associated Types
| |||||
| Show name => Show (EnumCon name) Source # | |||||
| NoPos (EnumCon name) Source # | |||||
| HasLoc (EnumCon name) Source # | |||||
| (Show name, PPName name) => PP (EnumCon name) Source # | |||||
| NFData name => NFData (EnumCon name) Source # | |||||
Defined in Cryptol.Parser.AST | |||||
| type Rep (EnumCon name) Source # | |||||
Defined in Cryptol.Parser.AST type Rep (EnumCon name) = D1 ('MetaData "EnumCon" "Cryptol.Parser.AST" "cryptol-3.5.0-HoSGjqdyafy4TMoEJgOBMg" 'False) (C1 ('MetaCons "EnumCon" 'PrefixI 'True) (S1 ('MetaSel ('Just "ecName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Located name)) :*: S1 ('MetaSel ('Just "ecFields") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Type name]))) | |||||
A declaration for a type with no implementation.
Constructors
| PrimType | |
Instances
| Rename PrimType Source # | |||||
| Generic (PrimType name) Source # | |||||
Defined in Cryptol.Parser.AST Associated Types
| |||||
| Show name => Show (PrimType name) Source # | |||||
| BindsNames (InModule (PrimType PName)) Source # | |||||
Defined in Cryptol.ModuleSystem.Binds | |||||
| NoPos (PrimType name) Source # | |||||
| HasLoc (PrimType name) Source # | |||||
| (Show name, PPName name) => PP (PrimType name) Source # | |||||
| NFData name => NFData (PrimType name) Source # | |||||
Defined in Cryptol.Parser.AST | |||||
| type Rep (PrimType name) Source # | |||||
Defined in Cryptol.Parser.AST type Rep (PrimType name) = D1 ('MetaData "PrimType" "Cryptol.Parser.AST" "cryptol-3.5.0-HoSGjqdyafy4TMoEJgOBMg" 'False) (C1 ('MetaCons "PrimType" 'PrefixI 'True) ((S1 ('MetaSel ('Just "primTName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Located name)) :*: S1 ('MetaSel ('Just "primTKind") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Located Kind))) :*: (S1 ('MetaSel ('Just "primTCts") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ([TParam name], [Prop name])) :*: S1 ('MetaSel ('Just "primTFixity") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Fixity))))) | |||||
data ParameterType name Source #
A type parameter for a module.
Constructors
| ParameterType | |
Instances
| Rename ParameterType Source # | |||||
Defined in Cryptol.ModuleSystem.Renamer Methods rename :: ParameterType PName -> RenameM (ParameterType Name) Source # | |||||
| Generic (ParameterType name) Source # | |||||
Defined in Cryptol.Parser.AST Associated Types
Methods from :: ParameterType name -> Rep (ParameterType name) x # to :: Rep (ParameterType name) x -> ParameterType name # | |||||
| Show name => Show (ParameterType name) Source # | |||||
Defined in Cryptol.Parser.AST Methods showsPrec :: Int -> ParameterType name -> ShowS # show :: ParameterType name -> String # showList :: [ParameterType name] -> ShowS # | |||||
| BindsNames (InModule (ParameterType PName)) Source # | |||||
Defined in Cryptol.ModuleSystem.Binds Methods namingEnv :: InModule (ParameterType PName) -> BuildNamingEnv | |||||
| NoPos (ParameterType name) Source # | |||||
Defined in Cryptol.Parser.AST Methods noPos :: ParameterType name -> ParameterType name Source # | |||||
| HasLoc (ParameterType name) Source # | |||||
Defined in Cryptol.Parser.AST | |||||
| (Show name, PPName name) => PP (ParameterType name) Source # | |||||
Defined in Cryptol.Parser.AST Methods ppPrec :: Int -> ParameterType name -> Doc Source # ppPrecWithAnnot :: [([Int], PPAnnot)] -> Int -> ParameterType name -> Doc Source # | |||||
| NFData name => NFData (ParameterType name) Source # | |||||
Defined in Cryptol.Parser.AST Methods rnf :: ParameterType name -> () # | |||||
| Eq name => Eq (ParameterType name) Source # | |||||
Defined in Cryptol.Parser.AST Methods (==) :: ParameterType name -> ParameterType name -> Bool # (/=) :: ParameterType name -> ParameterType name -> Bool # | |||||
| type Rep (ParameterType name) Source # | |||||
Defined in Cryptol.Parser.AST type Rep (ParameterType name) = D1 ('MetaData "ParameterType" "Cryptol.Parser.AST" "cryptol-3.5.0-HoSGjqdyafy4TMoEJgOBMg" 'False) (C1 ('MetaCons "ParameterType" 'PrefixI 'True) ((S1 ('MetaSel ('Just "ptName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Located name)) :*: S1 ('MetaSel ('Just "ptKind") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Kind)) :*: (S1 ('MetaSel ('Just "ptDoc") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe (Located Text))) :*: (S1 ('MetaSel ('Just "ptFixity") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Fixity)) :*: S1 ('MetaSel ('Just "ptNumber") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int))))) | |||||
data ParameterFun name Source #
A value parameter for a module.
Constructors
| ParameterFun | |
Instances
| Rename ParameterFun Source # | |||||
Defined in Cryptol.ModuleSystem.Renamer Methods rename :: ParameterFun PName -> RenameM (ParameterFun Name) Source # | |||||
| Generic (ParameterFun name) Source # | |||||
Defined in Cryptol.Parser.AST Associated Types
Methods from :: ParameterFun name -> Rep (ParameterFun name) x # to :: Rep (ParameterFun name) x -> ParameterFun name # | |||||
| Show name => Show (ParameterFun name) Source # | |||||
Defined in Cryptol.Parser.AST Methods showsPrec :: Int -> ParameterFun name -> ShowS # show :: ParameterFun name -> String # showList :: [ParameterFun name] -> ShowS # | |||||
| BindsNames (InModule (ParameterFun PName)) Source # | |||||
Defined in Cryptol.ModuleSystem.Binds Methods namingEnv :: InModule (ParameterFun PName) -> BuildNamingEnv | |||||
| NoPos (ParameterFun x) Source # | |||||
Defined in Cryptol.Parser.AST Methods noPos :: ParameterFun x -> ParameterFun x Source # | |||||
| HasLoc (ParameterFun name) Source # | |||||
Defined in Cryptol.Parser.AST | |||||
| (Show name, PPName name) => PP (ParameterFun name) Source # | |||||
Defined in Cryptol.Parser.AST Methods ppPrec :: Int -> ParameterFun name -> Doc Source # ppPrecWithAnnot :: [([Int], PPAnnot)] -> Int -> ParameterFun name -> Doc Source # | |||||
| NFData name => NFData (ParameterFun name) Source # | |||||
Defined in Cryptol.Parser.AST Methods rnf :: ParameterFun name -> () # | |||||
| Eq name => Eq (ParameterFun name) Source # | |||||
Defined in Cryptol.Parser.AST Methods (==) :: ParameterFun name -> ParameterFun name -> Bool # (/=) :: ParameterFun name -> ParameterFun name -> Bool # | |||||
| type Rep (ParameterFun name) Source # | |||||
Defined in Cryptol.Parser.AST type Rep (ParameterFun name) = D1 ('MetaData "ParameterFun" "Cryptol.Parser.AST" "cryptol-3.5.0-HoSGjqdyafy4TMoEJgOBMg" 'False) (C1 ('MetaCons "ParameterFun" 'PrefixI 'True) ((S1 ('MetaSel ('Just "pfName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Located name)) :*: S1 ('MetaSel ('Just "pfSchema") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Schema name))) :*: (S1 ('MetaSel ('Just "pfDoc") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe (Located Text))) :*: S1 ('MetaSel ('Just "pfFixity") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Fixity))))) | |||||
data ParameterConstraint name Source #
Constructors
| ParameterConstraint | |
Instances
| Generic (ParameterConstraint name) Source # | |||||
Defined in Cryptol.Parser.AST Associated Types
Methods from :: ParameterConstraint name -> Rep (ParameterConstraint name) x # to :: Rep (ParameterConstraint name) x -> ParameterConstraint name # | |||||
| Show name => Show (ParameterConstraint name) Source # | |||||
Defined in Cryptol.Parser.AST Methods showsPrec :: Int -> ParameterConstraint name -> ShowS # show :: ParameterConstraint name -> String # showList :: [ParameterConstraint name] -> ShowS # | |||||
| NoPos (ParameterConstraint x) Source # | |||||
Defined in Cryptol.Parser.AST Methods noPos :: ParameterConstraint x -> ParameterConstraint x Source # | |||||
| HasLoc (ParameterConstraint name) Source # | |||||
Defined in Cryptol.Parser.AST | |||||
| (Show name, PPName name) => PP (ParameterConstraint name) Source # | |||||
Defined in Cryptol.Parser.AST Methods ppPrec :: Int -> ParameterConstraint name -> Doc Source # ppPrecWithAnnot :: [([Int], PPAnnot)] -> Int -> ParameterConstraint name -> Doc Source # | |||||
| NFData name => NFData (ParameterConstraint name) Source # | |||||
Defined in Cryptol.Parser.AST Methods rnf :: ParameterConstraint name -> () # | |||||
| Eq name => Eq (ParameterConstraint name) Source # | |||||
Defined in Cryptol.Parser.AST Methods (==) :: ParameterConstraint name -> ParameterConstraint name -> Bool # (/=) :: ParameterConstraint name -> ParameterConstraint name -> Bool # | |||||
| type Rep (ParameterConstraint name) Source # | |||||
Defined in Cryptol.Parser.AST type Rep (ParameterConstraint name) = D1 ('MetaData "ParameterConstraint" "Cryptol.Parser.AST" "cryptol-3.5.0-HoSGjqdyafy4TMoEJgOBMg" 'False) (C1 ('MetaCons "ParameterConstraint" 'PrefixI 'True) (S1 ('MetaSel ('Just "pcProps") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Located (Prop name)]) :*: S1 ('MetaSel ('Just "pcDoc") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe (Located Text))))) | |||||
newtype NestedModule name Source #
A nested module.
Constructors
| NestedModule (ModuleG name name) |
Instances
| Rename NestedModule Source # | |||||
Defined in Cryptol.ModuleSystem.Renamer Methods rename :: NestedModule PName -> RenameM (NestedModule Name) Source # | |||||
| Generic (NestedModule name) Source # | |||||
Defined in Cryptol.Parser.AST Associated Types
Methods from :: NestedModule name -> Rep (NestedModule name) x # to :: Rep (NestedModule name) x -> NestedModule name # | |||||
| Show name => Show (NestedModule name) Source # | |||||
Defined in Cryptol.Parser.AST Methods showsPrec :: Int -> NestedModule name -> ShowS # show :: NestedModule name -> String # showList :: [NestedModule name] -> ShowS # | |||||
| BindsNames (InModule (NestedModule PName)) Source # | |||||
Defined in Cryptol.ModuleSystem.Binds Methods namingEnv :: InModule (NestedModule PName) -> BuildNamingEnv | |||||
| NoPos (NestedModule name) Source # | |||||
Defined in Cryptol.Parser.AST Methods noPos :: NestedModule name -> NestedModule name Source # | |||||
| RemovePatterns (NestedModule PName) Source # | |||||
Defined in Cryptol.Parser.NoPat Methods removePatterns :: NestedModule PName -> (NestedModule PName, [Error]) Source # | |||||
| HasLoc (NestedModule name) Source # | |||||
Defined in Cryptol.Parser.AST | |||||
| (Show name, PPName name) => PP (NestedModule name) Source # | |||||
Defined in Cryptol.Parser.AST Methods ppPrec :: Int -> NestedModule name -> Doc Source # ppPrecWithAnnot :: [([Int], PPAnnot)] -> Int -> NestedModule name -> Doc Source # | |||||
| NFData name => NFData (NestedModule name) Source # | |||||
Defined in Cryptol.Parser.AST Methods rnf :: NestedModule name -> () # | |||||
| type Rep (NestedModule name) Source # | |||||
Defined in Cryptol.Parser.AST type Rep (NestedModule name) = D1 ('MetaData "NestedModule" "Cryptol.Parser.AST" "cryptol-3.5.0-HoSGjqdyafy4TMoEJgOBMg" 'True) (C1 ('MetaCons "NestedModule" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (ModuleG name name)))) | |||||
Interface Modules (aka types of functor arguments)
IMPORTANT: Interface Modules are a language construct and are different from the notion of "interface" in the Cryptol implementation.
Note that the names *defined* in an interface module are only really used in the other members of the interface module. When an interface module is "imported" as a functor parameter these names are instantiated to new names, because there could be multiple paramers using the same interface.
Constructors
| Signature | |
Fields
| |
Instances
| Generic (Signature name) Source # | |||||
Defined in Cryptol.Parser.AST Associated Types
| |||||
| Show name => Show (Signature name) Source # | |||||
| NoPos (Signature name) Source # | |||||
| NFData name => NFData (Signature name) Source # | |||||
Defined in Cryptol.Parser.AST | |||||
| type Rep (Signature name) Source # | |||||
Defined in Cryptol.Parser.AST type Rep (Signature name) = D1 ('MetaData "Signature" "Cryptol.Parser.AST" "cryptol-3.5.0-HoSGjqdyafy4TMoEJgOBMg" 'False) (C1 ('MetaCons "Signature" 'PrefixI 'True) ((S1 ('MetaSel ('Just "sigImports") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 [Located (ImportG (ImpName name))]) :*: S1 ('MetaSel ('Just "sigTypeParams") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [ParameterType name])) :*: (S1 ('MetaSel ('Just "sigConstraints") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Located (Prop name)]) :*: (S1 ('MetaSel ('Just "sigDecls") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [SigDecl name]) :*: S1 ('MetaSel ('Just "sigFunParams") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [ParameterFun name]))))) | |||||
A constraint or type synonym declared in an interface.
Instances
| Rename SigDecl Source # | |||||
| Generic (SigDecl name) Source # | |||||
Defined in Cryptol.Parser.AST Associated Types
| |||||
| Show name => Show (SigDecl name) Source # | |||||
| BindsNames (InModule (SigDecl PName)) Source # | |||||
Defined in Cryptol.ModuleSystem.Binds | |||||
| NoPos (SigDecl name) Source # | |||||
| HasLoc (SigDecl name) Source # | |||||
| (Show name, PPName name) => PP (SigDecl name) Source # | |||||
| NFData name => NFData (SigDecl name) Source # | |||||
Defined in Cryptol.Parser.AST | |||||
| type Rep (SigDecl name) Source # | |||||
Defined in Cryptol.Parser.AST type Rep (SigDecl name) = D1 ('MetaData "SigDecl" "Cryptol.Parser.AST" "cryptol-3.5.0-HoSGjqdyafy4TMoEJgOBMg" 'False) (C1 ('MetaCons "SigTySyn" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (TySyn name)) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Text))) :+: C1 ('MetaCons "SigPropSyn" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (PropSyn name)) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Text)))) | |||||
A module parameter declaration.
import interface A import interface A as B
The name of the parameter is derived from the as clause. If there
is no as clause then it is derived from the name of the interface module.
If there is no as clause, then the type/value parameters are unqualified,
and otherwise they are qualified.
Constructors
| ModParam | |
Fields
| |
Instances
| Rename ModParam Source # | |||||
| Generic (ModParam name) Source # | |||||
Defined in Cryptol.Parser.AST Associated Types
| |||||
| Show name => Show (ModParam name) Source # | |||||
| NoPos (ModParam name) Source # | |||||
| HasLoc (ModParam name) Source # | |||||
| (Show name, PPName name) => PP (ModParam name) Source # | |||||
| NFData name => NFData (ModParam name) Source # | |||||
Defined in Cryptol.Parser.AST | |||||
| Eq name => Eq (ModParam name) Source # | |||||
| type Rep (ModParam name) Source # | |||||
Defined in Cryptol.Parser.AST type Rep (ModParam name) = D1 ('MetaData "ModParam" "Cryptol.Parser.AST" "cryptol-3.5.0-HoSGjqdyafy4TMoEJgOBMg" 'False) (C1 ('MetaCons "ModParam" 'PrefixI 'True) ((S1 ('MetaSel ('Just "mpSignature") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Located (ImpName name))) :*: S1 ('MetaSel ('Just "mpAs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe ModName))) :*: (S1 ('MetaSel ('Just "mpName") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Ident) :*: (S1 ('MetaSel ('Just "mpDoc") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe (Located Text))) :*: S1 ('MetaSel ('Just "mpRenaming") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map name name)))))) | |||||
Things that maybe appear in an interface/parameter block. These only exist during parsering.
Constructors
| DParameterType (ParameterType name) |
|
| DParameterFun (ParameterFun name) |
|
| DParameterDecl (SigDecl name) | A delcaration in an interface |
| DParameterConstraint (ParameterConstraint name) | parameter type constraint (fin T) |
Instances
| Generic (ParamDecl name) Source # | |||||
Defined in Cryptol.Parser.AST Associated Types
| |||||
| Show name => Show (ParamDecl name) Source # | |||||
| NoPos (ParamDecl name) Source # | |||||
| HasLoc (ParamDecl name) Source # | |||||
| (Show name, PPName name) => PP (ParamDecl name) Source # | |||||
| NFData name => NFData (ParamDecl name) Source # | |||||
Defined in Cryptol.Parser.AST | |||||
| type Rep (ParamDecl name) Source # | |||||
Defined in Cryptol.Parser.AST type Rep (ParamDecl name) = D1 ('MetaData "ParamDecl" "Cryptol.Parser.AST" "cryptol-3.5.0-HoSGjqdyafy4TMoEJgOBMg" 'False) ((C1 ('MetaCons "DParameterType" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (ParameterType name))) :+: C1 ('MetaCons "DParameterFun" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (ParameterFun name)))) :+: (C1 ('MetaCons "DParameterDecl" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (SigDecl name))) :+: C1 ('MetaCons "DParameterConstraint" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (ParameterConstraint name))))) | |||||
data PropGuardCase name Source #
Instances
| Functor PropGuardCase Source # | |||||
Defined in Cryptol.Parser.AST Methods fmap :: (a -> b) -> PropGuardCase a -> PropGuardCase b # (<$) :: a -> PropGuardCase b -> PropGuardCase a # | |||||
| Rename PropGuardCase Source # | |||||
Defined in Cryptol.ModuleSystem.Renamer Methods rename :: PropGuardCase PName -> RenameM (PropGuardCase Name) Source # | |||||
| Generic (PropGuardCase name) Source # | |||||
Defined in Cryptol.Parser.AST Associated Types
Methods from :: PropGuardCase name -> Rep (PropGuardCase name) x # to :: Rep (PropGuardCase name) x -> PropGuardCase name # | |||||
| Show name => Show (PropGuardCase name) Source # | |||||
Defined in Cryptol.Parser.AST Methods showsPrec :: Int -> PropGuardCase name -> ShowS # show :: PropGuardCase name -> String # showList :: [PropGuardCase name] -> ShowS # | |||||
| HasLoc (PropGuardCase name) Source # | |||||
Defined in Cryptol.Parser.AST | |||||
| NFData name => NFData (PropGuardCase name) Source # | |||||
Defined in Cryptol.Parser.AST Methods rnf :: PropGuardCase name -> () # | |||||
| Eq name => Eq (PropGuardCase name) Source # | |||||
Defined in Cryptol.Parser.AST Methods (==) :: PropGuardCase name -> PropGuardCase name -> Bool # (/=) :: PropGuardCase name -> PropGuardCase name -> Bool # | |||||
| type Rep (PropGuardCase name) Source # | |||||
Defined in Cryptol.Parser.AST type Rep (PropGuardCase name) = D1 ('MetaData "PropGuardCase" "Cryptol.Parser.AST" "cryptol-3.5.0-HoSGjqdyafy4TMoEJgOBMg" 'False) (C1 ('MetaCons "PropGuardCase" 'PrefixI 'True) (S1 ('MetaSel ('Just "pgcProps") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Located (Prop name)]) :*: S1 ('MetaSel ('Just "pgcExpr") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Expr name)))) | |||||
data ForeignMode Source #
How to call a foreign functions
Constructors
| ForeignC | Call using C-style marshalling |
| ForeignAbstract | Call using import/export objects |
Instances
| Generic ForeignMode Source # | |||||
Defined in Cryptol.Parser.AST Associated Types
| |||||
| Show ForeignMode Source # | |||||
Defined in Cryptol.Parser.AST Methods showsPrec :: Int -> ForeignMode -> ShowS # show :: ForeignMode -> String # showList :: [ForeignMode] -> ShowS # | |||||
| PP ForeignMode Source # | |||||
Defined in Cryptol.Parser.AST Methods ppPrec :: Int -> ForeignMode -> Doc Source # ppPrecWithAnnot :: [([Int], PPAnnot)] -> Int -> ForeignMode -> Doc Source # | |||||
| NFData ForeignMode Source # | |||||
Defined in Cryptol.Parser.AST Methods rnf :: ForeignMode -> () # | |||||
| Eq ForeignMode Source # | |||||
Defined in Cryptol.Parser.AST | |||||
| type Rep ForeignMode Source # | |||||
Interactive
Input at the REPL, which can be an expression, a let
statement, or empty (possibly a comment).
Constructors
| ExprInput (Expr name) | |
| LetInput [Decl name] | |
| EmptyInput |
Expressions
Constructors
| EVar n | x |
| ELit Literal | 0x10 |
| EGenerate (Expr n) | generate f |
| ETuple [Expr n] | (1,2,3) |
| ERecord (Rec (Expr n)) | { x = 1, y = 2 } |
| ESel (Expr n) Selector | e.l |
| EUpd (Maybe (Expr n)) [UpdField n] | { r | x = e } |
| EList [Expr n] | [1,2,3] |
| EFromTo (Type n) (Maybe (Type n)) (Type n) (Maybe (Type n)) | [1, 5 .. 117 : t] |
| EFromToBy Bool (Type n) (Type n) (Type n) (Maybe (Type n)) | [1 .. 10 by 2 : t ] |
| EFromToDownBy Bool (Type n) (Type n) (Type n) (Maybe (Type n)) | [10 .. 1 down by 2 : t ] |
| EFromToLessThan (Type n) (Type n) (Maybe (Type n)) | [ 1 .. < 10 : t ] |
| EInfFrom | |
| EComp (Expr n) [[Match n]] | [ 1 | x <- xs ] |
| EApp (Expr n) (Expr n) | f x |
| EAppT (Expr n) [TypeInst n] | f `{x = 8}, f`{8} |
| EIf (Expr n) (Expr n) (Expr n) | if ok then e1 else e2 |
| ECase (Expr n) [CaseAlt n] | case e of { P -> e } |
| EWhere (Expr n) [Decl n] | 1 + x where { x = 2 } |
| ETyped (Expr n) (Type n) | 1 : [8] |
| ETypeVal (Type n) |
|
| EFun (FunDesc n) [Pattern n] (Expr n) | \x y -> x |
| ELocated (Expr n) Range | position annotation |
| ESplit (Expr n) |
|
| EParens (Expr n) |
|
| EInfix | |
| EPrefix PrefixOp (Expr n) | -1, ~1 |
Instances
| Functor Expr Source # | |
| Rename Expr Source # | |
| Generic (Expr n) Source # | |
| Show n => Show (Expr n) Source # | |
| NoPos (Expr name) Source # | |
| RemovePatterns (Expr PName) Source # | |
Defined in Cryptol.Parser.NoPat | |
| AddLoc (Expr n) Source # | |
| HasLoc (Expr name) Source # | |
| (Show name, PPName name) => PP (Expr name) Source # | |
| NFData n => NFData (Expr n) Source # | |
Defined in Cryptol.Parser.AST | |
| Eq n => Eq (Expr n) Source # | |
| type Rep (Expr n) Source # | |
Defined in Cryptol.Parser.AST | |
Literals.
Constructors
| ECNum Integer NumInfo |
|
| ECChar Char | |
| ECFrac Rational FracInfo | 1.2e3 |
| ECString String | "hello" |
Instances
| Generic Literal Source # | |||||
Defined in Cryptol.Parser.AST Associated Types
| |||||
| Show Literal Source # | |||||
| PP Literal Source # | |||||
| NFData Literal Source # | |||||
Defined in Cryptol.Parser.AST | |||||
| Eq Literal Source # | |||||
| type Rep Literal Source # | |||||
Defined in Cryptol.Parser.AST type Rep Literal = D1 ('MetaData "Literal" "Cryptol.Parser.AST" "cryptol-3.5.0-HoSGjqdyafy4TMoEJgOBMg" 'False) ((C1 ('MetaCons "ECNum" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Integer) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 NumInfo)) :+: C1 ('MetaCons "ECChar" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Char))) :+: (C1 ('MetaCons "ECFrac" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Rational) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FracInfo)) :+: C1 ('MetaCons "ECString" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String)))) | |||||
Infromation about the representation of a numeric constant.
Constructors
| BinLit Text Int | n-digit binary literal |
| OctLit Text Int | n-digit octal literal |
| DecLit Text | overloaded decimal literal |
| HexLit Text Int | n-digit hex literal |
| PolyLit Int | polynomial literal |
Instances
| Generic NumInfo Source # | |||||
Defined in Cryptol.Parser.AST Associated Types
| |||||
| Show NumInfo Source # | |||||
| NFData NumInfo Source # | |||||
Defined in Cryptol.Parser.AST | |||||
| Eq NumInfo Source # | |||||
| type Rep NumInfo Source # | |||||
Defined in Cryptol.Parser.AST type Rep NumInfo = D1 ('MetaData "NumInfo" "Cryptol.Parser.AST" "cryptol-3.5.0-HoSGjqdyafy4TMoEJgOBMg" 'False) ((C1 ('MetaCons "BinLit" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int)) :+: C1 ('MetaCons "OctLit" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int))) :+: (C1 ('MetaCons "DecLit" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)) :+: (C1 ('MetaCons "HexLit" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int)) :+: C1 ('MetaCons "PolyLit" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int))))) | |||||
Information about fractional literals.
Instances
| Generic FracInfo Source # | |||||
Defined in Cryptol.Parser.AST Associated Types
| |||||
| Show FracInfo Source # | |||||
| NFData FracInfo Source # | |||||
Defined in Cryptol.Parser.AST | |||||
| Eq FracInfo Source # | |||||
| type Rep FracInfo Source # | |||||
Defined in Cryptol.Parser.AST type Rep FracInfo = D1 ('MetaData "FracInfo" "Cryptol.Parser.AST" "cryptol-3.5.0-HoSGjqdyafy4TMoEJgOBMg" 'False) ((C1 ('MetaCons "BinFrac" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)) :+: C1 ('MetaCons "OctFrac" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text))) :+: (C1 ('MetaCons "DecFrac" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)) :+: C1 ('MetaCons "HexFrac" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))) | |||||
Instances
| Functor Match Source # | |||||
| Rename Match Source # | |||||
| Generic (Match name) Source # | |||||
Defined in Cryptol.Parser.AST Associated Types
| |||||
| Show name => Show (Match name) Source # | |||||
| NoPos (Match name) Source # | |||||
| HasLoc (Match name) Source # | |||||
| (Show name, PPName name) => PP (Match name) Source # | |||||
| NFData name => NFData (Match name) Source # | |||||
Defined in Cryptol.Parser.AST | |||||
| Eq name => Eq (Match name) Source # | |||||
| type Rep (Match name) Source # | |||||
Defined in Cryptol.Parser.AST type Rep (Match name) = D1 ('MetaData "Match" "Cryptol.Parser.AST" "cryptol-3.5.0-HoSGjqdyafy4TMoEJgOBMg" 'False) (C1 ('MetaCons "Match" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Pattern name)) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Expr name))) :+: C1 ('MetaCons "MatchLet" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Bind name)))) | |||||
Constructors
| PVar (Located n) | x |
| PWild | _ |
| PTuple [Pattern n] | (x,y,z) |
| PRecord (Rec (Pattern n)) | { x = (a,b,c), y = z } |
| PList [Pattern n] | [ x, y, z ] |
| PTyped (Pattern n) (Type n) | x : [8] |
| PSplit | |
| PCon (Located n) [Pattern n] | Just x |
| PLocated (Pattern n) Range | Location information |
Instances
| Functor Pattern Source # | |
| Rename Pattern Source # | |
| Generic (Pattern n) Source # | |
| Show n => Show (Pattern n) Source # | |
| BindsNames (Pattern PName) Source # | |
Defined in Cryptol.ModuleSystem.Binds | |
| NoPos (Pattern name) Source # | |
| AddLoc (Pattern name) Source # | |
| HasLoc (Pattern name) Source # | |
| PPName name => PP (Pattern name) Source # | |
| NFData n => NFData (Pattern n) Source # | |
Defined in Cryptol.Parser.AST | |
| Eq n => Eq (Pattern n) Source # | |
| type Rep (Pattern n) Source # | |
Defined in Cryptol.Parser.AST | |
Selectors are used for projecting from various components. Each selector has an option spec to specify the shape of the thing that is being selected. Currently, there is no surface syntax for list selectors, but they are used during the desugaring of patterns.
Constructors
| TupleSel Int (Maybe Int) | Zero-based tuple selection. Optionally specifies the shape of the tuple (one-based). |
| RecordSel Ident (Maybe [Ident]) | Record selection. Optionally specifies the shape of the record. |
| ListSel Int (Maybe Int) | List selection. Optionally specifies the length of the list. |
Instances
| Generic Selector Source # | |||||
Defined in Cryptol.Parser.Selector Associated Types
| |||||
| Show Selector Source # | |||||
| ShowParseable Selector Source # | |||||
Defined in Cryptol.TypeCheck.Parseable | |||||
| PP Selector Source # | |||||
| NFData Selector Source # | |||||
Defined in Cryptol.Parser.Selector | |||||
| Eq Selector Source # | |||||
| Ord Selector Source # | |||||
Defined in Cryptol.Parser.Selector | |||||
| type Rep Selector Source # | |||||
Defined in Cryptol.Parser.Selector type Rep Selector = D1 ('MetaData "Selector" "Cryptol.Parser.Selector" "cryptol-3.5.0-HoSGjqdyafy4TMoEJgOBMg" 'False) (C1 ('MetaCons "TupleSel" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Int))) :+: (C1 ('MetaCons "RecordSel" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Ident) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe [Ident]))) :+: C1 ('MetaCons "ListSel" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Int))))) | |||||
Instances
| Functor CaseAlt Source # | |||||
| Rename CaseAlt Source # | |||||
| Generic (CaseAlt n) Source # | |||||
Defined in Cryptol.Parser.AST Associated Types
| |||||
| Show n => Show (CaseAlt n) Source # | |||||
| NoPos (CaseAlt name) Source # | |||||
| (Show name, PPName name) => PP (CaseAlt name) Source # | |||||
| NFData n => NFData (CaseAlt n) Source # | |||||
Defined in Cryptol.Parser.AST | |||||
| Eq n => Eq (CaseAlt n) Source # | |||||
| type Rep (CaseAlt n) Source # | |||||
Defined in Cryptol.Parser.AST type Rep (CaseAlt n) = D1 ('MetaData "CaseAlt" "Cryptol.Parser.AST" "cryptol-3.5.0-HoSGjqdyafy4TMoEJgOBMg" 'False) (C1 ('MetaCons "CaseAlt" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Pattern n)) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Expr n)))) | |||||
Instances
| Functor TypeInst Source # | |||||
| Rename TypeInst Source # | |||||
| Generic (TypeInst name) Source # | |||||
Defined in Cryptol.Parser.AST Associated Types
| |||||
| Show name => Show (TypeInst name) Source # | |||||
| NoPos (TypeInst name) Source # | |||||
| PPName name => PP (TypeInst name) Source # | |||||
| NFData name => NFData (TypeInst name) Source # | |||||
Defined in Cryptol.Parser.AST | |||||
| Eq name => Eq (TypeInst name) Source # | |||||
| type Rep (TypeInst name) Source # | |||||
Defined in Cryptol.Parser.AST type Rep (TypeInst name) = D1 ('MetaData "TypeInst" "Cryptol.Parser.AST" "cryptol-3.5.0-HoSGjqdyafy4TMoEJgOBMg" 'False) (C1 ('MetaCons "NamedInst" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Named (Type name)))) :+: C1 ('MetaCons "PosInst" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Type name)))) | |||||
Instances
| Functor UpdField Source # | |||||
| Rename UpdField Source # | Note that after this point the | ||||
| Generic (UpdField n) Source # | |||||
Defined in Cryptol.Parser.AST Associated Types
| |||||
| Show n => Show (UpdField n) Source # | |||||
| NoPos (UpdField name) Source # | |||||
| (Show name, PPName name) => PP (UpdField name) Source # | |||||
| NFData n => NFData (UpdField n) Source # | |||||
Defined in Cryptol.Parser.AST | |||||
| Eq n => Eq (UpdField n) Source # | |||||
| type Rep (UpdField n) Source # | |||||
Defined in Cryptol.Parser.AST type Rep (UpdField n) = D1 ('MetaData "UpdField" "Cryptol.Parser.AST" "cryptol-3.5.0-HoSGjqdyafy4TMoEJgOBMg" 'False) (C1 ('MetaCons "UpdField" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 UpdHow) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Located Selector]) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Expr n))))) | |||||
Description of functions. Only trivial information is provided here by the parser. The NoPat pass fills this in as required.
Constructors
| FunDesc | |
Fields
| |
Instances
| Functor FunDesc Source # | |||||
| Rename FunDesc Source # | |||||
| Generic (FunDesc n) Source # | |||||
Defined in Cryptol.Parser.AST Associated Types
| |||||
| Show n => Show (FunDesc n) Source # | |||||
| NFData n => NFData (FunDesc n) Source # | |||||
Defined in Cryptol.Parser.AST | |||||
| Eq n => Eq (FunDesc n) Source # | |||||
| type Rep (FunDesc n) Source # | |||||
Defined in Cryptol.Parser.AST type Rep (FunDesc n) = D1 ('MetaData "FunDesc" "Cryptol.Parser.AST" "cryptol-3.5.0-HoSGjqdyafy4TMoEJgOBMg" 'False) (C1 ('MetaCons "FunDesc" 'PrefixI 'True) (S1 ('MetaSel ('Just "funDescrName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe n)) :*: S1 ('MetaSel ('Just "funDescrArgOffset") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int))) | |||||
emptyFunDesc :: FunDesc n Source #
Prefix operator.
Constructors
| PrefixNeg | - |
| PrefixComplement | ~ |
prefixFixity :: PrefixOp -> Fixity Source #
Positions
Instances
| Foldable Located Source # | |||||
Defined in Cryptol.Parser.Position Methods fold :: Monoid m => Located m -> m # foldMap :: Monoid m => (a -> m) -> Located a -> m # foldMap' :: Monoid m => (a -> m) -> Located a -> m # foldr :: (a -> b -> b) -> b -> Located a -> b # foldr' :: (a -> b -> b) -> b -> Located a -> b # foldl :: (b -> a -> b) -> b -> Located a -> b # foldl' :: (b -> a -> b) -> b -> Located a -> b # foldr1 :: (a -> a -> a) -> Located a -> a # foldl1 :: (a -> a -> a) -> Located a -> a # elem :: Eq a => a -> Located a -> Bool # maximum :: Ord a => Located a -> a # minimum :: Ord a => Located a -> a # | |||||
| Traversable Located Source # | |||||
| Functor Located Source # | |||||
| Generic (Located a) Source # | |||||
Defined in Cryptol.Parser.Position Associated Types
| |||||
| Show a => Show (Located a) Source # | |||||
| TraverseNames a => TraverseNames (Located a) Source # | |||||
Defined in Cryptol.IR.TraverseNames Methods traverseNamesIP :: (Applicative f, ?name :: Name -> f Name) => Located a -> f (Located a) Source # | |||||
| NoPos (Located t) Source # | |||||
| AddLoc (Located a) Source # | |||||
| HasLoc (Located a) Source # | |||||
| ModuleInstance a => ModuleInstance (Located a) Source # | |||||
Defined in Cryptol.TypeCheck.ModuleInstance Methods moduleInstance :: Located a -> Located a Source # | |||||
| ShowParseable a => ShowParseable (Located a) Source # | |||||
Defined in Cryptol.TypeCheck.Parseable | |||||
| PP a => PP (Located a) Source # | |||||
| PPName a => PPName (Located a) Source # | |||||
Defined in Cryptol.Parser.Position | |||||
| NFData a => NFData (Located a) Source # | |||||
Defined in Cryptol.Parser.Position | |||||
| Eq a => Eq (Located a) Source # | |||||
| Ord a => Ord (Located a) Source # | |||||
| type Rep (Located a) Source # | |||||
Defined in Cryptol.Parser.Position type Rep (Located a) = D1 ('MetaData "Located" "Cryptol.Parser.Position" "cryptol-3.5.0-HoSGjqdyafy4TMoEJgOBMg" 'False) (C1 ('MetaCons "Located" 'PrefixI 'True) (S1 ('MetaSel ('Just "srcRange") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Range) :*: S1 ('MetaSel ('Just "thing") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 a))) | |||||
Instances
| NoPos Pragma Source # | |
| NoPos Range Source # | |
| NoPos (Bind name) Source # | |
| NoPos (BindParams name) Source # | |
Defined in Cryptol.Parser.AST Methods noPos :: BindParams name -> BindParams name Source # | |
| NoPos (CaseAlt name) Source # | |
| NoPos (Decl name) Source # | |
| NoPos (EnumCon name) Source # | |
| NoPos (EnumDecl name) Source # | |
| NoPos (Expr name) Source # | |
| NoPos (Match name) Source # | |
| NoPos (ModParam name) Source # | |
| NoPos (ModuleDefinition name) Source # | |
Defined in Cryptol.Parser.AST Methods noPos :: ModuleDefinition name -> ModuleDefinition name Source # | |
| NoPos (ModuleInstanceArgs name) Source # | |
Defined in Cryptol.Parser.AST Methods noPos :: ModuleInstanceArgs name -> ModuleInstanceArgs name Source # | |
| NoPos (ModuleInstanceNamedArg name) Source # | |
Defined in Cryptol.Parser.AST Methods noPos :: ModuleInstanceNamedArg name -> ModuleInstanceNamedArg name Source # | |
| NoPos t => NoPos (Named t) Source # | |
| NoPos (NestedModule name) Source # | |
Defined in Cryptol.Parser.AST Methods noPos :: NestedModule name -> NestedModule name Source # | |
| NoPos (Newtype name) Source # | |
| NoPos (ParamDecl name) Source # | |
| NoPos (ParameterConstraint x) Source # | |
Defined in Cryptol.Parser.AST Methods noPos :: ParameterConstraint x -> ParameterConstraint x Source # | |
| NoPos (ParameterFun x) Source # | |
Defined in Cryptol.Parser.AST Methods noPos :: ParameterFun x -> ParameterFun x Source # | |
| NoPos (ParameterType name) Source # | |
Defined in Cryptol.Parser.AST Methods noPos :: ParameterType name -> ParameterType name Source # | |
| NoPos (Pattern name) Source # | |
| NoPos (PrimType name) Source # | |
| NoPos (Program name) Source # | |
| NoPos (Prop name) Source # | |
| NoPos (PropSyn name) Source # | |
| NoPos (Schema name) Source # | |
| NoPos (SigDecl name) Source # | |
| NoPos (Signature name) Source # | |
| NoPos (TParam name) Source # | |
| NoPos (TopDecl name) Source # | |
| NoPos a => NoPos (TopLevel a) Source # | |
| NoPos (TySyn name) Source # | |
| NoPos (Type name) Source # | |
| NoPos (TypeInst name) Source # | |
| NoPos (UpdField name) Source # | |
| NoPos (Located t) Source # | |
| NoPos t => NoPos (Maybe t) Source # | |
| NoPos t => NoPos [t] Source # | |
Defined in Cryptol.Parser.AST | |
| NoPos (ModuleG mname name) Source # | |
| (NoPos a, NoPos b) => NoPos (a, b) Source # | |
Defined in Cryptol.Parser.AST | |
Pretty-printing
ppSelector :: Selector -> Doc Source #
Display the thing selected by the selector, nicely.