A symbolic library name.
ModuleAgda-2.7.0.1Haskell2010
Agda.Interaction.Library.Base
Basic data types for library management.
- 19 types
- 22 values
- PackageAgda-2.7.0.1
- Exports41
- LanguageHaskell2010
- LicenceMIT
- SourceBase.hs
Constructors
Instances4Show, Generic, NFData, Rep
Show LibrariesFileDefined in Agda-2.7.0.1 · Agda.Interaction.Library.BaseGeneric LibrariesFileDefined in Agda-2.7.0.1 · Agda.Interaction.Library.BaseNFData LibrariesFileDefined in Agda-2.7.0.1 · Agda.Interaction.Library.Basetype Rep LibrariesFile = D1 ('MetaDataDefined in Agda-2.7.0.1 · Agda.Interaction.Library.Base"LibrariesFile"
"Agda.Interaction.Library.Base"
"Agda-2.7.0.1-DbbZpETDDF1KkwuzEZvfn8"
'False) (C1 ('MetaCons"LibrariesFile"
'PrefixI 'True) (S1 ('MetaSel ('Just"lfPath"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FilePath) :*: S1 ('MetaSel ('Just"lfExists"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool)))
A symbolic executable name.
Constructors
Instances5Show, Generic, NFData, EmbPrj, Rep
Show ExecutablesFileDefined in Agda-2.7.0.1 · Agda.Interaction.Library.BaseGeneric ExecutablesFileDefined in Agda-2.7.0.1 · Agda.Interaction.Library.BaseNFData ExecutablesFileDefined in Agda-2.7.0.1 · Agda.Interaction.Library.BaseEmbPrj ExecutablesFileDefined in Agda-2.7.0.1 · Agda.TypeChecking.Serialise.Instances.Errors · orphantype Rep ExecutablesFile = D1 ('MetaDataDefined in Agda-2.7.0.1 · Agda.Interaction.Library.Base"ExecutablesFile"
"Agda.Interaction.Library.Base"
"Agda-2.7.0.1-DbbZpETDDF1KkwuzEZvfn8"
'False) (C1 ('MetaCons"ExecutablesFile"
'PrefixI 'True) (S1 ('MetaSel ('Just"efPath"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FilePath) :*: S1 ('MetaSel ('Just"efExists"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool)))
The special name "." is used to indicated that the current directory
should count as a project root.
A file can either belong to a project located at a given root containing one or more .agda-lib files, or be part of the default project.
Constructors
ProjectConfigconfigRoot :: FilePathconfigAgdaLibFiles :: [FilePath]configAbove :: !IntHow many directories above the Agda file is the
.agda-libfile located?
DefaultProjectConfig
Instances3Generic, NFData, Rep
Generic ProjectConfigDefined in Agda-2.7.0.1 · Agda.Interaction.Library.BaseNFData ProjectConfigDefined in Agda-2.7.0.1 · Agda.Interaction.Library.Basetype Rep ProjectConfig = D1 ('MetaDataDefined in Agda-2.7.0.1 · Agda.Interaction.Library.Base"ProjectConfig"
"Agda.Interaction.Library.Base"
"Agda-2.7.0.1-DbbZpETDDF1KkwuzEZvfn8"
'False) (C1 ('MetaCons"ProjectConfig"
'PrefixI 'True) (S1 ('MetaSel ('Just"configRoot"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FilePath) :*: (S1 ('MetaSel ('Just"configAgdaLibFiles"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [FilePath]) :*: S1 ('MetaSel ('Just"configAbove"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 Int))) :+: C1 ('MetaCons"DefaultProjectConfig"
'PrefixI 'False) U1)
The options from an OPTIONS pragma (or a .agda-lib file).
In the future it might be nice to switch to a more structured representation. Note that, currently, there is not a one-to-one correspondence between list elements and options.
Constructors
OptionsPragmapragmaStrings :: [String]The options.
pragmaRange :: RangeThe range of the options in the pragma (not including things like an
OPTIONSkeyword).
Instances5Show, Semigroup, Monoid, NFData, EmbPrj
Show OptionsPragmaDefined in Agda-2.7.0.1 · Agda.Interaction.Library.BaseSemigroup OptionsPragmaDefined in Agda-2.7.0.1 · Agda.Interaction.Library.BaseMonoid OptionsPragmaDefined in Agda-2.7.0.1 · Agda.Interaction.Library.BaseNFData OptionsPragmaDefined in Agda-2.7.0.1 · Agda.Interaction.Library.BaseRanges are not forced.
EmbPrj OptionsPragmaDefined in Agda-2.7.0.1 · Agda.TypeChecking.Serialise.Instances.Common · orphan
Content of a .agda-lib file.
Constructors
AgdaLibFile_libName :: LibNameThe symbolic name of the library.
_libFile :: FilePathPath to this
.agda-libfile (not content of the file)._libAbove :: !IntHow many directories above the Agda file is the
.agda-libfile located?_libIncludes :: [FilePath]Roots where to look for the modules of the library.
_libDepends :: [LibName]Dependencies.
_libPragmas :: OptionsPragmaDefault pragma options for all files in the library.
Instances4Show, Generic, NFData, Rep
Show AgdaLibFileDefined in Agda-2.7.0.1 · Agda.Interaction.Library.BaseGeneric AgdaLibFileDefined in Agda-2.7.0.1 · Agda.Interaction.Library.BaseNFData AgdaLibFileDefined in Agda-2.7.0.1 · Agda.Interaction.Library.Basetype Rep AgdaLibFile = D1 ('MetaDataDefined in Agda-2.7.0.1 · Agda.Interaction.Library.Base"AgdaLibFile"
"Agda.Interaction.Library.Base"
"Agda-2.7.0.1-DbbZpETDDF1KkwuzEZvfn8"
'False) (C1 ('MetaCons"AgdaLibFile"
'PrefixI 'True) ((S1 ('MetaSel ('Just"_libName"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 LibName) :*: (S1 ('MetaSel ('Just"_libFile"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FilePath) :*: S1 ('MetaSel ('Just"_libAbove"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 Int))) :*: (S1 ('MetaSel ('Just"_libIncludes"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [FilePath]) :*: (S1 ('MetaSel ('Just"_libDepends"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [LibName]) :*: S1 ('MetaSel ('Just"_libPragmas"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 OptionsPragma)))))
Lenses for AgdaLibFile
Library warnings and errors
0 declarationsPosition information
Information about which .agda-lib file we are reading
and from where in the libraries file it came from.
Constructors
LibPositionInfolibFilePos :: Maybe FilePathName of
librariesfile.lineNumPos :: LineNumberLine number in
librariesfile.filePos :: FilePathLibrary file.
Instances5Show, Generic, NFData, EmbPrj, Rep
Show LibPositionInfoDefined in Agda-2.7.0.1 · Agda.Interaction.Library.BaseGeneric LibPositionInfoDefined in Agda-2.7.0.1 · Agda.Interaction.Library.BaseNFData LibPositionInfoDefined in Agda-2.7.0.1 · Agda.Interaction.Library.BaseEmbPrj LibPositionInfoDefined in Agda-2.7.0.1 · Agda.TypeChecking.Serialise.Instances.Errors · orphantype Rep LibPositionInfo = D1 ('MetaDataDefined in Agda-2.7.0.1 · Agda.Interaction.Library.Base"LibPositionInfo"
"Agda.Interaction.Library.Base"
"Agda-2.7.0.1-DbbZpETDDF1KkwuzEZvfn8"
'False) (C1 ('MetaCons"LibPositionInfo"
'PrefixI 'True) (S1 ('MetaSel ('Just"libFilePos"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe FilePath)) :*: (S1 ('MetaSel ('Just"lineNumPos"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 LineNumber) :*: S1 ('MetaSel ('Just"filePos"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FilePath))))
Warnings
Constructors
Instances6Show, Generic, NFData, Pretty, EmbPrj, Rep
Show LibWarningDefined in Agda-2.7.0.1 · Agda.Interaction.Library.BaseGeneric LibWarningDefined in Agda-2.7.0.1 · Agda.Interaction.Library.BaseNFData LibWarningDefined in Agda-2.7.0.1 · Agda.Interaction.Library.BasePretty LibWarningDefined in Agda-2.7.0.1 · Agda.Interaction.Library.BaseEmbPrj LibWarningDefined in Agda-2.7.0.1 · Agda.TypeChecking.Serialise.Instances.Errors · orphantype Rep LibWarning = D1 ('MetaDataDefined in Agda-2.7.0.1 · Agda.Interaction.Library.Base"LibWarning"
"Agda.Interaction.Library.Base"
"Agda-2.7.0.1-DbbZpETDDF1KkwuzEZvfn8"
'False) (C1 ('MetaCons"LibWarning"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe LibPositionInfo)) :*: S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 LibWarning')))
Library Warnings.
Constructors
Instances6Show, Generic, NFData, Pretty, EmbPrj, Rep
Show LibWarning'Defined in Agda-2.7.0.1 · Agda.Interaction.Library.BaseGeneric LibWarning'Defined in Agda-2.7.0.1 · Agda.Interaction.Library.BaseNFData LibWarning'Defined in Agda-2.7.0.1 · Agda.Interaction.Library.BasePretty LibWarning'Defined in Agda-2.7.0.1 · Agda.Interaction.Library.BaseEmbPrj LibWarning'Defined in Agda-2.7.0.1 · Agda.TypeChecking.Serialise.Instances.Errors · orphantype Rep LibWarning' = D1 ('MetaDataDefined in Agda-2.7.0.1 · Agda.Interaction.Library.Base"LibWarning'"
"Agda.Interaction.Library.Base"
"Agda-2.7.0.1-DbbZpETDDF1KkwuzEZvfn8"
'False) (C1 ('MetaCons"UnknownField"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String)))
Errors
3 declarationsConstructors
Instances4Show, Generic, NFData, Rep
Show LibErrorDefined in Agda-2.7.0.1 · Agda.Interaction.Library.BaseGeneric LibErrorDefined in Agda-2.7.0.1 · Agda.Interaction.Library.BaseNFData LibErrorDefined in Agda-2.7.0.1 · Agda.Interaction.Library.Basetype Rep LibError = D1 ('MetaDataDefined in Agda-2.7.0.1 · Agda.Interaction.Library.Base"LibError"
"Agda.Interaction.Library.Base"
"Agda-2.7.0.1-DbbZpETDDF1KkwuzEZvfn8"
'False) (C1 ('MetaCons"LibError"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe LibPositionInfo)) :*: S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 LibError')))
Collected errors while processing library files.
Constructors
LibrariesFileNotFound FilePathThe user specified replacement for the default
librariesfile does not exist.LibNotFound LibrariesFile LibNameRaised when a library name could not successfully be resolved to an
.agda-libfile.AmbiguousLib LibName [AgdaLibFile]Raised when a library name is defined in several
.agda-lib files.LibParseError LibParseErrorThe
.agda-libfile could not be parsed.ReadError IOException StringAn I/O Error occurred when reading a file.
DuplicateExecutable FilePath Text (List2 (LineNumber, FilePath))The
executablesfile contains duplicate entries.
Instances5Show, Generic, NFData, Pretty, Rep
Show LibError'Defined in Agda-2.7.0.1 · Agda.Interaction.Library.BaseGeneric LibError'Defined in Agda-2.7.0.1 · Agda.Interaction.Library.BaseNFData LibError'Defined in Agda-2.7.0.1 · Agda.Interaction.Library.BasePretty LibError'Defined in Agda-2.7.0.1 · Agda.Interaction.Library.BasePretty-print library management error without position info.
type Rep LibError' = D1 ('MetaDataDefined in Agda-2.7.0.1 · Agda.Interaction.Library.Base"LibError'"
"Agda.Interaction.Library.Base"
"Agda-2.7.0.1-DbbZpETDDF1KkwuzEZvfn8"
'False) ((C1 ('MetaCons"LibrariesFileNotFound"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FilePath)) :+: (C1 ('MetaCons"LibNotFound"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 LibrariesFile) :*: S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 LibName)) :+: C1 ('MetaCons"AmbiguousLib"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 LibName) :*: S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [AgdaLibFile])))) :+: (C1 ('MetaCons"LibParseError"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 LibParseError)) :+: (C1 ('MetaCons"ReadError"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 IOException) :*: S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String)) :+: C1 ('MetaCons"DuplicateExecutable"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FilePath) :*: (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (List2 (LineNumber, FilePath))))))))
Exceptions thrown by the .agda-lib parser.
Constructors
BadLibraryName StringAn invalid library name, e.g., containing spaces.
ReadFailure FilePath IOExceptionI/O error while reading file.
MissingFields (List1 String)Missing these mandatory fields.
DuplicateFields (List1 String)These fields occur each more than once.
MissingFieldName LineNumberAt the given line number, a field name is missing before the
:.BadFieldName LineNumber StringAt the given line number, an invalid field name is encountered before the
:. (E.g., containing spaces.)MissingColonForField LineNumber StringAt the given line number, the given field is not followed by
:.ContentWithoutField LineNumberAt the given line number, indented text (content) is not preceded by a field.
Instances5Show, Generic, NFData, Pretty, Rep
Show LibParseErrorDefined in Agda-2.7.0.1 · Agda.Interaction.Library.BaseGeneric LibParseErrorDefined in Agda-2.7.0.1 · Agda.Interaction.Library.BaseNFData LibParseErrorDefined in Agda-2.7.0.1 · Agda.Interaction.Library.BasePretty LibParseErrorDefined in Agda-2.7.0.1 · Agda.Interaction.Library.BasePrint library file parse error without position info.
type Rep LibParseError = D1 ('MetaDataDefined in Agda-2.7.0.1 · Agda.Interaction.Library.Base"LibParseError"
"Agda.Interaction.Library.Base"
"Agda-2.7.0.1-DbbZpETDDF1KkwuzEZvfn8"
'False) (((C1 ('MetaCons"BadLibraryName"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String)) :+: C1 ('MetaCons"ReadFailure"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FilePath) :*: S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 IOException))) :+: (C1 ('MetaCons"MissingFields"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (List1 String))) :+: C1 ('MetaCons"DuplicateFields"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (List1 String))))) :+: ((C1 ('MetaCons"MissingFieldName"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 LineNumber)) :+: C1 ('MetaCons"BadFieldName"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 LineNumber) :*: S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String))) :+: (C1 ('MetaCons"MissingColonForField"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 LineNumber) :*: S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String)) :+: C1 ('MetaCons"ContentWithoutField"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 LineNumber)))))
Raising warnings and errors
Collection of LibErrors and LibWarnings.
Library Monad
8 declarationsCollects LibErrors and LibWarnings.
Throws LibErrors exceptions, still collects LibWarnings.
Cache locations of project configurations and parsed .agda-lib files.
Collected errors when processing an .agda-lib file.
Constructors
Instances4Show, Generic, NFData, Rep
Show LibErrorsDefined in Agda-2.7.0.1 · Agda.Interaction.Library.BaseGeneric LibErrorsDefined in Agda-2.7.0.1 · Agda.Interaction.Library.BaseNFData LibErrorsDefined in Agda-2.7.0.1 · Agda.Interaction.Library.Basetype Rep LibErrors = D1 ('MetaDataDefined in Agda-2.7.0.1 · Agda.Interaction.Library.Base"LibErrors"
"Agda.Interaction.Library.Base"
"Agda-2.7.0.1-DbbZpETDDF1KkwuzEZvfn8"
'False) (C1 ('MetaCons"LibErrors"
'PrefixI 'True) (S1 ('MetaSel ('Just"libErrorsInstalledLibraries"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [AgdaLibFile]) :*: S1 ('MetaSel ('Just"libErrors"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (List1 LibError))))
Prettyprinting errors and warnings
5 declarationsPretty-print LibError.
Pretty-print LibErrors.
Does a parse error contain a line number?
Compute a position position prefix.
Depending on the error to be printed, it will
either give the name of the
librariesfile and a line inside it,or give the name of the
.agda-libfile.