Copyright | (c) 2013-2015 Galois, Inc. |
---|---|
License | BSD3 |
Maintainer | cryptol@galois.com |
Stability | provisional |
Portability | portable |
Safe Haskell | Safe |
Language | Haskell98 |
- newtype ModName = ModName [String]
- modRange :: Module -> Range
- data QName = QName (Maybe ModName) Name
- mkQual :: ModName -> Name -> QName
- mkUnqual :: Name -> QName
- unqual :: QName -> Name
- data Name
- data Named a = Named {}
- data Pass
- = NoPat
- | MonoValues
- data Schema = Forall [TParam] [Prop] Type (Maybe Range)
- data TParam = TParam {}
- tpQName :: TParam -> QName
- data Kind
- data Type
- data Prop
- data Module = Module {}
- newtype Program = Program [TopDecl]
- data TopDecl
- data Decl
- data TySyn = TySyn LQName [TParam] Type
- data Bind = Bind {}
- data Pragma
- data ExportType
- data ExportSpec = ExportSpec {}
- exportBind :: TopLevel QName -> ExportSpec
- exportType :: TopLevel QName -> ExportSpec
- isExportedBind :: QName -> ExportSpec -> Bool
- isExportedType :: QName -> ExportSpec -> Bool
- data TopLevel a = TopLevel {
- tlExport :: ExportType
- tlValue :: a
- data Import = Import {}
- data ImportSpec
- data Newtype = Newtype {}
- data ReplInput
- data Expr
- = EVar QName
- | ECon ECon
- | ELit Literal
- | ETuple [Expr]
- | ERecord [Named Expr]
- | ESel Expr Selector
- | EList [Expr]
- | EFromTo Type (Maybe Type) (Maybe Type)
- | EInfFrom Expr (Maybe Expr)
- | EComp Expr [[Match]]
- | EApp Expr Expr
- | EAppT Expr [TypeInst]
- | EIf Expr Expr Expr
- | EWhere Expr [Decl]
- | ETyped Expr Type
- | ETypeVal Type
- | EFun [Pattern] Expr
- | ELocated Expr Range
- data Literal
- data NumInfo
- data Match
- data Pattern
- data Selector
- data TypeInst
- data Located a = Located {}
- type LName = Located Name
- type LQName = Located QName
- type LString = Located String
- class NoPos t where
- noPos :: t -> t
- cppKind :: Kind -> Doc
- ppSelector :: Selector -> Doc
Names
Module names are just namespaces.
INVARIANT: the list of strings should never be empty in a valid module name.
Types
Eq Schema Source | |
Show Schema Source | |
PP Schema Source | |
AddLoc Schema Source | |
HasLoc Schema Source | |
NoPos Schema Source | |
BindsNames Schema Source | Generate a type renaming environment from the parameters that are bound by this schema. |
Rename Schema Source | Rename a schema, assuming that none of its type variables are already in scope. |
Declarations
DSignature [LQName] Schema | |
DPragma [LQName] Pragma | |
DBind Bind | |
DPatBind Pattern Expr | |
DType TySyn | |
DLocated Decl Range |
Eq Decl Source | |
Show Decl Source | |
PP Decl Source | |
AddLoc Decl Source | |
HasLoc Decl Source | |
NoPos Decl Source | |
BindsNames Decl Source | The naming environment for a single declaration, unqualified. This is meanat to be used for things like where clauses. |
Rename Decl Source | |
FromDecl Decl Source | |
RemovePatterns [Decl] Source |
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.
Eq Bind Source | |
Show Bind Source | |
PP Bind Source | |
HasLoc Bind Source | |
NoPos Bind Source | |
BindsNames Bind Source | |
Rename Bind Source | Rename a binding. NOTE: this does not bind its own name into the naming context of its body. The assumption here is that this has been done by the enclosing environment, to allow for top-level renaming |
data ExportType Source
Export information for a declaration.
data ExportSpec Source
exportBind :: TopLevel QName -> ExportSpec Source
Add a binding name to the export list, if it should be exported.
exportType :: TopLevel QName -> ExportSpec Source
Add a type synonym name to the export list, if it should be exported.
isExportedBind :: QName -> ExportSpec -> Bool Source
Check to see if a binding is exported.
isExportedType :: QName -> ExportSpec -> Bool Source
Check to see if a type synonym is exported.
TopLevel | |
|
An import declaration.
data ImportSpec Source
Interactive
Input at the REPL, which can either be an expression or a let
statement.
Expressions
EVar QName | x |
ECon ECon | split |
ELit Literal | 0x10 |
ETuple [Expr] | (1,2,3) |
ERecord [Named Expr] | { x = 1, y = 2 } |
ESel Expr Selector | e.l |
EList [Expr] | [1,2,3] |
EFromTo Type (Maybe Type) (Maybe Type) | [1, 5 .. 117 ] |
EInfFrom Expr (Maybe Expr) | [1, 3 ...] |
EComp Expr [[Match]] | [ 1 | x <- xs ] |
EApp Expr Expr | f x |
EAppT Expr [TypeInst] | f `{x = 8}, f`{8} |
EIf Expr Expr Expr | if ok then e1 else e2 |
EWhere Expr [Decl] | 1 + x where { x = 2 } |
ETyped Expr Type | 1 : [8] |
ETypeVal Type |
|
EFun [Pattern] Expr | \x y -> x |
ELocated Expr Range | position annotation |
Literals.
Infromation about the representation of a numeric constant.
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.
Positions
NoPos Prop Source | |
NoPos Type Source | |
NoPos TParam Source | |
NoPos Schema Source | |
NoPos Pattern Source | |
NoPos Match Source | |
NoPos TypeInst Source | |
NoPos Expr Source | |
NoPos Newtype Source | |
NoPos Pragma Source | |
NoPos Bind Source | |
NoPos TySyn Source | |
NoPos Decl Source | |
NoPos TopDecl Source | |
NoPos Module Source | |
NoPos Program Source | |
NoPos t => NoPos [t] Source | |
NoPos t => NoPos (Maybe t) Source | |
NoPos (Located t) Source | |
NoPos t => NoPos (Named t) Source | |
NoPos a => NoPos (TopLevel a) Source |
Pretty-printing
Conversational printing of kinds (e.g., to use in error messages)
ppSelector :: Selector -> Doc Source
Display the thing selected by the selector, nicely.