Safe Haskell | None |
---|---|
Language | Haskell2010 |
Database.HsSqlPpp.Annotation
Contents
Description
Contains the annotation data types and a few auxiliary functions.
- data Annotation = Annotation {
- anSrc :: Maybe SourcePosition
- anType :: Maybe TypeExtra
- anErrs :: [TypeError]
- anImplicitCast :: Maybe TypeExtra
- anCatUpd :: [CatalogUpdate]
- data TypeExtra = TypeExtra {
- teType :: Type
- tePrecision :: Maybe Int
- teScale :: Maybe Int
- teNullable :: Bool
- type SourcePosition = (FilePath, Int, Int)
- getAnnotation :: Data a => a -> Annotation
- updateAnnotation :: Data a => (Annotation -> Annotation) -> a -> a
- emptyAnnotation :: Annotation
Annotation data types
data Annotation
Annotation type - one of these is attached to most of the data types used in the ast. the fields in order are:
Constructors
Annotation | |
Fields
|
Instances
data TypeExtra
Quick fix to add precision and nullable information to the annotation types. This approach should be revisited, maybe this information should be in the Type type?
type SourcePosition = (FilePath, Int, Int)
Represents a source file position, usually set by the parser.
getAnnotation :: Data a => a -> Annotation
get the annotation for the root element of the tree passed
updateAnnotation :: Data a => (Annotation -> Annotation) -> a -> a
Update the first annotation in a tree using the function supplied
An annotation value with no information.