Safe Haskell | None |
---|---|
Language | Haskell2010 |
Data types for modules and declarations
- type Context = [(Ident, Type)]
- data TypeSearch
- = TSBefore Environment
- | TSAfter {
- tsAfterIdentifiers :: [(Qualified Text, Type)]
- tsAfterRecordFields :: Maybe [(Label, Type)]
- onTypeSearchTypes :: (Type -> Type) -> TypeSearch -> TypeSearch
- onTypeSearchTypesM :: Applicative m => (Type -> m Type) -> TypeSearch -> m TypeSearch
- data SimpleErrorMessage
- = ModuleNotFound ModuleName
- | ErrorParsingFFIModule FilePath (Maybe ErrorMessage)
- | ErrorParsingModule ParseError
- | MissingFFIModule ModuleName
- | UnnecessaryFFIModule ModuleName FilePath
- | MissingFFIImplementations ModuleName [Ident]
- | UnusedFFIImplementations ModuleName [Ident]
- | InvalidFFIIdentifier ModuleName Text
- | CannotGetFileInfo FilePath
- | CannotReadFile FilePath
- | CannotWriteFile FilePath
- | InfiniteType Type
- | InfiniteKind Kind
- | MultipleValueOpFixities (OpName ValueOpName)
- | MultipleTypeOpFixities (OpName TypeOpName)
- | OrphanTypeDeclaration Ident
- | RedefinedIdent Ident
- | OverlappingNamesInLet
- | UnknownName (Qualified Name)
- | UnknownImport ModuleName Name
- | UnknownImportDataConstructor ModuleName (ProperName TypeName) (ProperName ConstructorName)
- | UnknownExport Name
- | UnknownExportDataConstructor (ProperName TypeName) (ProperName ConstructorName)
- | ScopeConflict Name [ModuleName]
- | ScopeShadowing Name (Maybe ModuleName) [ModuleName]
- | DeclConflict Name Name
- | ExportConflict (Qualified Name) (Qualified Name)
- | DuplicateModule ModuleName
- | DuplicateTypeClass (ProperName ClassName) SourceSpan
- | DuplicateInstance Ident SourceSpan
- | DuplicateTypeArgument Text
- | InvalidDoBind
- | InvalidDoLet
- | CycleInDeclaration Ident
- | CycleInTypeSynonym (Maybe (ProperName TypeName))
- | CycleInModules [ModuleName]
- | NameIsUndefined Ident
- | UndefinedTypeVariable (ProperName TypeName)
- | PartiallyAppliedSynonym (Qualified (ProperName TypeName))
- | EscapedSkolem Text (Maybe SourceSpan) Type
- | TypesDoNotUnify Type Type
- | KindsDoNotUnify Kind Kind
- | ConstrainedTypeUnified Type Type
- | OverlappingInstances (Qualified (ProperName ClassName)) [Type] [Qualified Ident]
- | NoInstanceFound Constraint
- | AmbiguousTypeVariables Type Constraint
- | UnknownClass (Qualified (ProperName ClassName))
- | PossiblyInfiniteInstance (Qualified (ProperName ClassName)) [Type]
- | CannotDerive (Qualified (ProperName ClassName)) [Type]
- | InvalidDerivedInstance (Qualified (ProperName ClassName)) [Type] Int
- | ExpectedTypeConstructor (Qualified (ProperName ClassName)) [Type] Type
- | InvalidNewtypeInstance (Qualified (ProperName ClassName)) [Type]
- | MissingNewtypeSuperclassInstance (Qualified (ProperName ClassName)) (Qualified (ProperName ClassName)) [Type]
- | UnverifiableSuperclassInstance (Qualified (ProperName ClassName)) (Qualified (ProperName ClassName)) [Type]
- | CannotFindDerivingType (ProperName TypeName)
- | DuplicateLabel Label (Maybe Expr)
- | DuplicateValueDeclaration Ident
- | ArgListLengthsDiffer Ident
- | OverlappingArgNames (Maybe Ident)
- | MissingClassMember Ident
- | ExtraneousClassMember Ident (Qualified (ProperName ClassName))
- | ExpectedType Type Kind
- | IncorrectConstructorArity (Qualified (ProperName ConstructorName)) Int Int
- | ExprDoesNotHaveType Expr Type
- | PropertyIsMissing Label
- | AdditionalProperty Label
- | TypeSynonymInstance
- | OrphanInstance Ident (Qualified (ProperName ClassName)) (Set ModuleName) [Type]
- | InvalidNewtype (ProperName TypeName)
- | InvalidInstanceHead Type
- | TransitiveExportError DeclarationRef [DeclarationRef]
- | TransitiveDctorExportError DeclarationRef (ProperName ConstructorName)
- | ShadowedName Ident
- | ShadowedTypeVar Text
- | UnusedTypeVar Text
- | WildcardInferredType Type Context
- | HoleInferredType Text Type Context TypeSearch
- | MissingTypeDeclaration Ident Type
- | OverlappingPattern [[Binder]] Bool
- | IncompleteExhaustivityCheck
- | MisleadingEmptyTypeImport ModuleName (ProperName TypeName)
- | ImportHidingModule ModuleName
- | UnusedImport ModuleName
- | UnusedExplicitImport ModuleName [Name] (Maybe ModuleName) [DeclarationRef]
- | UnusedDctorImport ModuleName (ProperName TypeName) (Maybe ModuleName) [DeclarationRef]
- | UnusedDctorExplicitImport ModuleName (ProperName TypeName) [ProperName ConstructorName] (Maybe ModuleName) [DeclarationRef]
- | DuplicateSelectiveImport ModuleName
- | DuplicateImport ModuleName ImportDeclarationType (Maybe ModuleName)
- | DuplicateImportRef Name
- | DuplicateExportRef Name
- | IntOutOfRange Integer Text Integer Integer
- | ImplicitQualifiedImport ModuleName ModuleName [DeclarationRef]
- | ImplicitQualifiedImportReExport ModuleName ModuleName [DeclarationRef]
- | ImplicitImport ModuleName [DeclarationRef]
- | HidingImport ModuleName [DeclarationRef]
- | CaseBinderLengthDiffers Int [Binder]
- | IncorrectAnonymousArgument
- | InvalidOperatorInBinder (Qualified (OpName ValueOpName)) (Qualified Ident)
- | CannotGeneralizeRecursiveFunction Ident Type
- | CannotDeriveNewtypeForData (ProperName TypeName)
- | ExpectedWildcard (ProperName TypeName)
- | CannotUseBindWithDo Ident
- | ClassInstanceArityMismatch Ident (Qualified (ProperName ClassName)) Int Int
- | UserDefinedWarning Type
- | UnusableDeclaration Ident [[Text]]
- | CannotDefinePrimModules ModuleName
- | MixedAssociativityError (NonEmpty (Qualified (OpName AnyOpName), Associativity))
- | NonAssociativeError (NonEmpty (Qualified (OpName AnyOpName)))
- data ErrorMessageHint
- = ErrorUnifyingTypes Type Type
- | ErrorInExpression Expr
- | ErrorInModule ModuleName
- | ErrorInInstance (Qualified (ProperName ClassName)) [Type]
- | ErrorInSubsumption Type Type
- | ErrorCheckingAccessor Expr PSString
- | ErrorCheckingType Expr Type
- | ErrorCheckingKind Type
- | ErrorCheckingGuard
- | ErrorInferringType Expr
- | ErrorInApplication Expr Type Expr
- | ErrorInDataConstructor (ProperName ConstructorName)
- | ErrorInTypeConstructor (ProperName TypeName)
- | ErrorInBindingGroup (NonEmpty Ident)
- | ErrorInDataBindingGroup [ProperName TypeName]
- | ErrorInTypeSynonym (ProperName TypeName)
- | ErrorInValueDeclaration Ident
- | ErrorInTypeDeclaration Ident
- | ErrorInTypeClassDeclaration (ProperName ClassName)
- | ErrorInForeignImport Ident
- | ErrorSolvingConstraint Constraint
- | PositionedError (NonEmpty SourceSpan)
- data HintCategory
- data ErrorMessage = ErrorMessage [ErrorMessageHint] SimpleErrorMessage
- data Module = Module SourceSpan [Comment] ModuleName [Declaration] (Maybe [DeclarationRef])
- getModuleName :: Module -> ModuleName
- getModuleSourceSpan :: Module -> SourceSpan
- getModuleDeclarations :: Module -> [Declaration]
- addDefaultImport :: Qualified ModuleName -> Module -> Module
- importPrim :: Module -> Module
- data DeclarationRef
- = TypeRef SourceSpan (ProperName TypeName) (Maybe [ProperName ConstructorName])
- | TypeOpRef SourceSpan (OpName TypeOpName)
- | ValueRef SourceSpan Ident
- | ValueOpRef SourceSpan (OpName ValueOpName)
- | TypeClassRef SourceSpan (ProperName ClassName)
- | TypeInstanceRef SourceSpan Ident
- | ModuleRef SourceSpan ModuleName
- | KindRef SourceSpan (ProperName KindName)
- | ReExportRef SourceSpan ModuleName DeclarationRef
- compDecRef :: DeclarationRef -> DeclarationRef -> Ordering
- declRefSourceSpan :: DeclarationRef -> SourceSpan
- declRefName :: DeclarationRef -> Name
- getTypeRef :: DeclarationRef -> Maybe (ProperName TypeName, Maybe [ProperName ConstructorName])
- getTypeOpRef :: DeclarationRef -> Maybe (OpName TypeOpName)
- getValueRef :: DeclarationRef -> Maybe Ident
- getValueOpRef :: DeclarationRef -> Maybe (OpName ValueOpName)
- getTypeClassRef :: DeclarationRef -> Maybe (ProperName ClassName)
- getKindRef :: DeclarationRef -> Maybe (ProperName KindName)
- isModuleRef :: DeclarationRef -> Bool
- data ImportDeclarationType
- isImplicit :: ImportDeclarationType -> Bool
- isExplicit :: ImportDeclarationType -> Bool
- data TypeDeclarationData = TypeDeclarationData {
- tydeclSourceAnn :: !SourceAnn
- tydeclIdent :: !Ident
- tydeclType :: !Type
- overTypeDeclaration :: (TypeDeclarationData -> TypeDeclarationData) -> Declaration -> Declaration
- getTypeDeclaration :: Declaration -> Maybe TypeDeclarationData
- unwrapTypeDeclaration :: TypeDeclarationData -> (Ident, Type)
- data ValueDeclarationData a = ValueDeclarationData {
- valdeclSourceAnn :: !SourceAnn
- valdeclIdent :: !Ident
- valdeclName :: !NameKind
- valdeclBinders :: ![Binder]
- valdeclExpression :: !a
- overValueDeclaration :: (ValueDeclarationData [GuardedExpr] -> ValueDeclarationData [GuardedExpr]) -> Declaration -> Declaration
- getValueDeclaration :: Declaration -> Maybe (ValueDeclarationData [GuardedExpr])
- pattern ValueDecl :: SourceAnn -> Ident -> NameKind -> [Binder] -> [GuardedExpr] -> Declaration
- data Declaration
- = DataDeclaration SourceAnn DataDeclType (ProperName TypeName) [(Text, Maybe Kind)] [(ProperName ConstructorName, [Type])]
- | DataBindingGroupDeclaration (NonEmpty Declaration)
- | TypeSynonymDeclaration SourceAnn (ProperName TypeName) [(Text, Maybe Kind)] Type
- | TypeDeclaration !TypeDeclarationData
- | ValueDeclaration !(ValueDeclarationData [GuardedExpr])
- | BoundValueDeclaration SourceAnn Binder Expr
- | BindingGroupDeclaration (NonEmpty ((SourceAnn, Ident), NameKind, Expr))
- | ExternDeclaration SourceAnn Ident Type
- | ExternDataDeclaration SourceAnn (ProperName TypeName) Kind
- | ExternKindDeclaration SourceAnn (ProperName KindName)
- | FixityDeclaration SourceAnn (Either ValueFixity TypeFixity)
- | ImportDeclaration SourceAnn ModuleName ImportDeclarationType (Maybe ModuleName)
- | TypeClassDeclaration SourceAnn (ProperName ClassName) [(Text, Maybe Kind)] [Constraint] [FunctionalDependency] [Declaration]
- | TypeInstanceDeclaration SourceAnn [Ident] Integer Ident [Constraint] (Qualified (ProperName ClassName)) [Type] TypeInstanceBody
- data ValueFixity = ValueFixity Fixity (Qualified (Either Ident (ProperName ConstructorName))) (OpName ValueOpName)
- data TypeFixity = TypeFixity Fixity (Qualified (ProperName TypeName)) (OpName TypeOpName)
- pattern ValueFixityDeclaration :: SourceAnn -> Fixity -> Qualified (Either Ident (ProperName ConstructorName)) -> OpName ValueOpName -> Declaration
- pattern TypeFixityDeclaration :: SourceAnn -> Fixity -> Qualified (ProperName TypeName) -> OpName TypeOpName -> Declaration
- data TypeInstanceBody
- mapTypeInstanceBody :: ([Declaration] -> [Declaration]) -> TypeInstanceBody -> TypeInstanceBody
- traverseTypeInstanceBody :: Applicative f => ([Declaration] -> f [Declaration]) -> TypeInstanceBody -> f TypeInstanceBody
- declSourceAnn :: Declaration -> SourceAnn
- declSourceSpan :: Declaration -> SourceSpan
- declName :: Declaration -> Maybe Name
- isValueDecl :: Declaration -> Bool
- isDataDecl :: Declaration -> Bool
- isImportDecl :: Declaration -> Bool
- isExternDataDecl :: Declaration -> Bool
- isExternKindDecl :: Declaration -> Bool
- isFixityDecl :: Declaration -> Bool
- getFixityDecl :: Declaration -> Maybe (Either ValueFixity TypeFixity)
- isExternDecl :: Declaration -> Bool
- isTypeClassInstanceDeclaration :: Declaration -> Bool
- isTypeClassDeclaration :: Declaration -> Bool
- flattenDecls :: [Declaration] -> [Declaration]
- data Guard
- data GuardedExpr = GuardedExpr [Guard] Expr
- pattern MkUnguarded :: Expr -> GuardedExpr
- data Expr
- = Literal SourceSpan (Literal Expr)
- | UnaryMinus SourceSpan Expr
- | BinaryNoParens Expr Expr Expr
- | Parens Expr
- | Accessor PSString Expr
- | ObjectUpdate Expr [(PSString, Expr)]
- | ObjectUpdateNested Expr (PathTree Expr)
- | Abs Binder Expr
- | App Expr Expr
- | Var SourceSpan (Qualified Ident)
- | Op SourceSpan (Qualified (OpName ValueOpName))
- | IfThenElse Expr Expr Expr
- | Constructor SourceSpan (Qualified (ProperName ConstructorName))
- | Case [Expr] [CaseAlternative]
- | TypedValue Bool Expr Type
- | Let WhereProvenance [Declaration] Expr
- | Do [DoNotationElement]
- | Ado [DoNotationElement] Expr
- | TypeClassDictionaryConstructorApp (Qualified (ProperName ClassName)) Expr
- | TypeClassDictionary Constraint (Map (Maybe ModuleName) (Map (Qualified (ProperName ClassName)) (Map (Qualified Ident) NamedDict))) [ErrorMessageHint]
- | TypeClassDictionaryAccessor (Qualified (ProperName ClassName)) Ident
- | DeferredDictionary (Qualified (ProperName ClassName)) [Type]
- | AnonymousArgument
- | Hole Text
- | PositionedValue SourceSpan [Comment] Expr
- data WhereProvenance
- data CaseAlternative = CaseAlternative {}
- data DoNotationElement
- newtype PathTree t = PathTree (AssocList PSString (PathNode t))
- data PathNode t
- newtype AssocList k t = AssocList {
- runAssocList :: [(k, t)]
- isTrueExpr :: Expr -> Bool
Documentation
data TypeSearch Source #
Holds the data necessary to do type directed search for typed holes
TSBefore Environment | An Environment captured for later consumption by type directed search |
TSAfter | Results of applying type directed search to the previously captured Environment |
|
onTypeSearchTypes :: (Type -> Type) -> TypeSearch -> TypeSearch Source #
onTypeSearchTypesM :: Applicative m => (Type -> m Type) -> TypeSearch -> m TypeSearch Source #
data SimpleErrorMessage Source #
A type of error messages
data ErrorMessageHint Source #
Error message hints, providing more detailed information about failure.
data HintCategory Source #
Categories of hints
data ErrorMessage Source #
A module declaration, consisting of comments about the module, a module name, a list of declarations, and a list of the declarations that are explicitly exported. If the export list is Nothing, everything is exported.
getModuleName :: Module -> ModuleName Source #
Return a module's name.
getModuleSourceSpan :: Module -> SourceSpan Source #
Return a module's source span.
getModuleDeclarations :: Module -> [Declaration] Source #
Return a module's declarations.
addDefaultImport :: Qualified ModuleName -> Module -> Module Source #
Add an import declaration for a module if it does not already explicitly import it.
Will not import an unqualified module if that module has already been imported qualified. (See #2197)
importPrim :: Module -> Module Source #
Adds import declarations to a module for an implicit Prim import and Prim | qualified as Prim, as necessary.
data DeclarationRef Source #
An item in a list of explicit imports or exports
TypeRef SourceSpan (ProperName TypeName) (Maybe [ProperName ConstructorName]) | A type constructor with data constructors |
TypeOpRef SourceSpan (OpName TypeOpName) | A type operator |
ValueRef SourceSpan Ident | A value |
ValueOpRef SourceSpan (OpName ValueOpName) | A value-level operator |
TypeClassRef SourceSpan (ProperName ClassName) | A type class |
TypeInstanceRef SourceSpan Ident | A type class instance, created during typeclass desugaring (name, class name, instance types) |
ModuleRef SourceSpan ModuleName | A module, in its entirety |
KindRef SourceSpan (ProperName KindName) | A named kind |
ReExportRef SourceSpan ModuleName DeclarationRef | A value re-exported from another module. These will be inserted during elaboration in name desugaring. |
compDecRef :: DeclarationRef -> DeclarationRef -> Ordering Source #
declRefName :: DeclarationRef -> Name Source #
getTypeRef :: DeclarationRef -> Maybe (ProperName TypeName, Maybe [ProperName ConstructorName]) Source #
getTypeOpRef :: DeclarationRef -> Maybe (OpName TypeOpName) Source #
getValueRef :: DeclarationRef -> Maybe Ident Source #
getValueOpRef :: DeclarationRef -> Maybe (OpName ValueOpName) Source #
getKindRef :: DeclarationRef -> Maybe (ProperName KindName) Source #
isModuleRef :: DeclarationRef -> Bool Source #
data ImportDeclarationType Source #
The data type which specifies type of import declaration
Implicit | An import with no explicit list: `import M`. |
Explicit [DeclarationRef] | An import with an explicit list of references to import: `import M (foo)` |
Hiding [DeclarationRef] | An import with a list of references to hide: `import M hiding (foo)` |
data TypeDeclarationData Source #
A type declaration assigns a type to an identifier, eg:
identity :: forall a. a -> a
In this example identity
is the identifier and forall a. a -> a
the type.
overTypeDeclaration :: (TypeDeclarationData -> TypeDeclarationData) -> Declaration -> Declaration Source #
unwrapTypeDeclaration :: TypeDeclarationData -> (Ident, Type) Source #
data ValueDeclarationData a Source #
A value declaration assigns a name and potential binders, to an expression (or multiple guarded expressions).
double x = x + x
In this example double
is the identifier, x
is a binder and x + x
is the expression.
ValueDeclarationData | |
|
overValueDeclaration :: (ValueDeclarationData [GuardedExpr] -> ValueDeclarationData [GuardedExpr]) -> Declaration -> Declaration Source #
pattern ValueDecl :: SourceAnn -> Ident -> NameKind -> [Binder] -> [GuardedExpr] -> Declaration Source #
data Declaration Source #
The data type of declarations
DataDeclaration SourceAnn DataDeclType (ProperName TypeName) [(Text, Maybe Kind)] [(ProperName ConstructorName, [Type])] | A data type declaration (data or newtype, name, arguments, data constructors) |
DataBindingGroupDeclaration (NonEmpty Declaration) | A minimal mutually recursive set of data type declarations |
TypeSynonymDeclaration SourceAnn (ProperName TypeName) [(Text, Maybe Kind)] Type | A type synonym declaration (name, arguments, type) |
TypeDeclaration !TypeDeclarationData | A type declaration for a value (name, ty) |
ValueDeclaration !(ValueDeclarationData [GuardedExpr]) | A value declaration (name, top-level binders, optional guard, value) |
BoundValueDeclaration SourceAnn Binder Expr | A declaration paired with pattern matching in let-in expression (binder, optional guard, value) |
BindingGroupDeclaration (NonEmpty ((SourceAnn, Ident), NameKind, Expr)) | A minimal mutually recursive set of value declarations |
ExternDeclaration SourceAnn Ident Type | A foreign import declaration (name, type) |
ExternDataDeclaration SourceAnn (ProperName TypeName) Kind | A data type foreign import (name, kind) |
ExternKindDeclaration SourceAnn (ProperName KindName) | A foreign kind import (name) |
FixityDeclaration SourceAnn (Either ValueFixity TypeFixity) | A fixity declaration |
ImportDeclaration SourceAnn ModuleName ImportDeclarationType (Maybe ModuleName) | A module import (module name, qualifiedunqualifiedhiding, optional "qualified as" name) |
TypeClassDeclaration SourceAnn (ProperName ClassName) [(Text, Maybe Kind)] [Constraint] [FunctionalDependency] [Declaration] | A type class declaration (name, argument, implies, member declarations) |
TypeInstanceDeclaration SourceAnn [Ident] Integer Ident [Constraint] (Qualified (ProperName ClassName)) [Type] TypeInstanceBody | A type instance declaration (instance chain, chain index, name, dependencies, class name, instance types, member declarations) |
data ValueFixity Source #
data TypeFixity Source #
pattern ValueFixityDeclaration :: SourceAnn -> Fixity -> Qualified (Either Ident (ProperName ConstructorName)) -> OpName ValueOpName -> Declaration Source #
pattern TypeFixityDeclaration :: SourceAnn -> Fixity -> Qualified (ProperName TypeName) -> OpName TypeOpName -> Declaration Source #
data TypeInstanceBody Source #
The members of a type class instance declaration
DerivedInstance | This is a derived instance |
NewtypeInstance | This is an instance derived from a newtype |
NewtypeInstanceWithDictionary Expr | This is an instance derived from a newtype, desugared to include a dictionary for the type under the newtype. |
ExplicitInstance [Declaration] | This is a regular (explicit) instance |
mapTypeInstanceBody :: ([Declaration] -> [Declaration]) -> TypeInstanceBody -> TypeInstanceBody Source #
traverseTypeInstanceBody :: Applicative f => ([Declaration] -> f [Declaration]) -> TypeInstanceBody -> f TypeInstanceBody Source #
A traversal for TypeInstanceBody
declSourceAnn :: Declaration -> SourceAnn Source #
isValueDecl :: Declaration -> Bool Source #
Test if a declaration is a value declaration
isDataDecl :: Declaration -> Bool Source #
Test if a declaration is a data type or type synonym declaration
isImportDecl :: Declaration -> Bool Source #
Test if a declaration is a module import
isExternDataDecl :: Declaration -> Bool Source #
Test if a declaration is a data type foreign import
isExternKindDecl :: Declaration -> Bool Source #
Test if a declaration is a foreign kind import
isFixityDecl :: Declaration -> Bool Source #
Test if a declaration is a fixity declaration
isExternDecl :: Declaration -> Bool Source #
Test if a declaration is a foreign import
isTypeClassInstanceDeclaration :: Declaration -> Bool Source #
Test if a declaration is a type class instance declaration
isTypeClassDeclaration :: Declaration -> Bool Source #
Test if a declaration is a type class declaration
flattenDecls :: [Declaration] -> [Declaration] Source #
Recursively flatten data binding groups in the list of declarations
A guard is just a boolean-valued expression that appears alongside a set of binders
data GuardedExpr Source #
The right hand side of a binder in value declarations and case expressions.
pattern MkUnguarded :: Expr -> GuardedExpr Source #
Data type for expressions and terms
Literal SourceSpan (Literal Expr) | A literal value |
UnaryMinus SourceSpan Expr | A prefix -, will be desugared |
BinaryNoParens Expr Expr Expr | Binary operator application. During the rebracketing phase of desugaring, this data constructor will be removed. |
Parens Expr | Explicit parentheses. During the rebracketing phase of desugaring, this data constructor will be removed. Note: although it seems this constructor is not used, it _is_ useful, since it prevents certain traversals from matching. |
Accessor PSString Expr | An record property accessor expression (e.g. `obj.x` or `_.x`). Anonymous arguments will be removed during desugaring and expanded into a lambda that reads a property from a record. |
ObjectUpdate Expr [(PSString, Expr)] | Partial record update |
ObjectUpdateNested Expr (PathTree Expr) | Object updates with nested support: `x { foo { bar = e } }`
Replaced during desugaring into a |
Abs Binder Expr | Function introduction |
App Expr Expr | Function application |
Var SourceSpan (Qualified Ident) | Variable |
Op SourceSpan (Qualified (OpName ValueOpName)) | An operator. This will be desugared into a function during the "operators" phase of desugaring. |
IfThenElse Expr Expr Expr | Conditional (if-then-else expression) |
Constructor SourceSpan (Qualified (ProperName ConstructorName)) | A data constructor |
Case [Expr] [CaseAlternative] | A case expression. During the case expansion phase of desugaring, top-level binders will get desugared into case expressions, hence the need for guards and multiple binders per branch here. |
TypedValue Bool Expr Type | A value with a type annotation |
Let WhereProvenance [Declaration] Expr | A let binding |
Do [DoNotationElement] | A do-notation block |
Ado [DoNotationElement] Expr | An ado-notation block |
TypeClassDictionaryConstructorApp (Qualified (ProperName ClassName)) Expr | An application of a typeclass dictionary constructor. The value should be an ObjectLiteral. |
TypeClassDictionary Constraint (Map (Maybe ModuleName) (Map (Qualified (ProperName ClassName)) (Map (Qualified Ident) NamedDict))) [ErrorMessageHint] | A placeholder for a type class dictionary to be inserted later. At the end of type checking, these placeholders will be replaced with actual expressions representing type classes dictionaries which can be evaluated at runtime. The constructor arguments represent (in order): whether or not to look at superclass implementations when searching for a dictionary, the type class name and instance type, and the type class dictionaries in scope. |
TypeClassDictionaryAccessor (Qualified (ProperName ClassName)) Ident | A typeclass dictionary accessor, the implementation is left unspecified until CoreFn desugaring. |
DeferredDictionary (Qualified (ProperName ClassName)) [Type] | A placeholder for a superclass dictionary to be turned into a TypeClassDictionary during typechecking |
AnonymousArgument | A placeholder for an anonymous function argument |
Hole Text | A typed hole that will be turned into a hint/error during typechecking |
PositionedValue SourceSpan [Comment] Expr | A value with source position information |
data WhereProvenance Source #
Metadata that tells where a let binding originated
data CaseAlternative Source #
An alternative in a case statement
CaseAlternative | |
|
data DoNotationElement Source #
A statement in a do-notation block
DoNotationValue Expr | A monadic value without a binder |
DoNotationBind Binder Expr | A monadic value with a binder |
DoNotationLet [Declaration] | A let statement, i.e. a pure value with a binder |
PositionedDoNotationElement SourceSpan [Comment] DoNotationElement | A do notation element with source position information |
newtype AssocList k t Source #
AssocList | |
|
isTrueExpr :: Expr -> Bool Source #