Safe Haskell | None |
---|---|
Language | Haskell2010 |
Basic data types for library management.
Synopsis
- type LibName = String
- data LibrariesFile = LibrariesFile {}
- type ExeName = Text
- data ExecutablesFile = ExecutablesFile {}
- libNameForCurrentDir :: LibName
- data ProjectConfig
- = ProjectConfig {
- configRoot :: FilePath
- configAgdaLibFiles :: [FilePath]
- configAbove :: !Int
- | DefaultProjectConfig
- = ProjectConfig {
- data OptionsPragma = OptionsPragma {
- pragmaStrings :: [String]
- pragmaRange :: Range
- data AgdaLibFile = AgdaLibFile {
- _libName :: LibName
- _libFile :: FilePath
- _libAbove :: !Int
- _libIncludes :: [FilePath]
- _libDepends :: [LibName]
- _libPragmas :: OptionsPragma
- emptyLibFile :: AgdaLibFile
- libName :: Lens' AgdaLibFile LibName
- libFile :: Lens' AgdaLibFile FilePath
- libAbove :: Lens' AgdaLibFile Int
- libIncludes :: Lens' AgdaLibFile [FilePath]
- libDepends :: Lens' AgdaLibFile [LibName]
- libPragmas :: Lens' AgdaLibFile OptionsPragma
- type LineNumber = Int
- data LibPositionInfo = LibPositionInfo {
- libFilePos :: Maybe FilePath
- lineNumPos :: LineNumber
- filePos :: FilePath
- data LibWarning = LibWarning (Maybe LibPositionInfo) LibWarning'
- data LibWarning' = UnknownField String
- libraryWarningName :: LibWarning -> WarningName
- data LibError = LibError (Maybe LibPositionInfo) LibError'
- data LibError'
- = LibrariesFileNotFound FilePath
- | LibNotFound LibrariesFile LibName
- | AmbiguousLib LibName [AgdaLibFile]
- | LibParseError LibParseError
- | ReadError IOException String
- | DuplicateExecutable FilePath Text (List2 (LineNumber, FilePath))
- data LibParseError
- = BadLibraryName String
- | ReadFailure FilePath IOException
- | MissingFields (List1 String)
- | DuplicateFields (List1 String)
- | MissingFieldName LineNumber
- | BadFieldName LineNumber String
- | MissingColonForField LineNumber String
- | ContentWithoutField LineNumber
- type LibErrWarns = [Either LibError LibWarning]
- warnings :: MonadWriter LibErrWarns m => List1 LibWarning -> m ()
- warnings' :: MonadWriter LibErrWarns m => List1 LibWarning' -> m ()
- raiseErrors' :: MonadWriter LibErrWarns m => List1 LibError' -> m ()
- raiseErrors :: MonadWriter LibErrWarns m => List1 LibError -> m ()
- type LibErrorIO = WriterT LibErrWarns (StateT LibState IO)
- type LibM = ExceptT LibErrors (WriterT [LibWarning] (StateT LibState IO))
- type LibState = (Map FilePath ProjectConfig, Map FilePath AgdaLibFile)
- data LibErrors = LibErrors {}
- getCachedProjectConfig :: (MonadState LibState m, MonadIO m) => FilePath -> m (Maybe ProjectConfig)
- storeCachedProjectConfig :: (MonadState LibState m, MonadIO m) => FilePath -> ProjectConfig -> m ()
- getCachedAgdaLibFile :: (MonadState LibState m, MonadIO m) => FilePath -> m (Maybe AgdaLibFile)
- storeCachedAgdaLibFile :: (MonadState LibState m, MonadIO m) => FilePath -> AgdaLibFile -> m ()
- formatLibError :: [AgdaLibFile] -> LibError -> Doc
- formatLibErrors :: LibErrors -> Doc
- hasLineNumber :: LibParseError -> Maybe LineNumber
- formatLibPositionInfo :: LibPositionInfo -> LibParseError -> Doc
- prettyInstalledLibraries :: [AgdaLibFile] -> Doc
Documentation
data LibrariesFile Source #
Instances
NFData LibrariesFile Source # | |||||
Defined in Agda.Interaction.Library.Base rnf :: LibrariesFile -> () | |||||
Generic LibrariesFile Source # | |||||
Defined in Agda.Interaction.Library.Base
from :: LibrariesFile -> Rep LibrariesFile x to :: Rep LibrariesFile x -> LibrariesFile | |||||
Show LibrariesFile Source # | |||||
Defined in Agda.Interaction.Library.Base showsPrec :: Int -> LibrariesFile -> ShowS show :: LibrariesFile -> String showList :: [LibrariesFile] -> ShowS | |||||
type Rep LibrariesFile Source # | |||||
Defined in Agda.Interaction.Library.Base type Rep LibrariesFile = D1 ('MetaData "LibrariesFile" "Agda.Interaction.Library.Base" "Agda-2.6.20240714-inplace" 'False) (C1 ('MetaCons "LibrariesFile" 'PrefixI 'True) (S1 ('MetaSel ('Just "lfPath") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FilePath) :*: S1 ('MetaSel ('Just "lfExists") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool))) |
data ExecutablesFile Source #
Instances
EmbPrj ExecutablesFile Source # | |||||
Defined in Agda.TypeChecking.Serialise.Instances.Errors icode :: ExecutablesFile -> S Int32 Source # icod_ :: ExecutablesFile -> S Int32 Source # value :: Int32 -> R ExecutablesFile Source # | |||||
NFData ExecutablesFile Source # | |||||
Defined in Agda.Interaction.Library.Base rnf :: ExecutablesFile -> () | |||||
Generic ExecutablesFile Source # | |||||
Defined in Agda.Interaction.Library.Base
from :: ExecutablesFile -> Rep ExecutablesFile x to :: Rep ExecutablesFile x -> ExecutablesFile | |||||
Show ExecutablesFile Source # | |||||
Defined in Agda.Interaction.Library.Base showsPrec :: Int -> ExecutablesFile -> ShowS show :: ExecutablesFile -> String showList :: [ExecutablesFile] -> ShowS | |||||
type Rep ExecutablesFile Source # | |||||
Defined in Agda.Interaction.Library.Base type Rep ExecutablesFile = D1 ('MetaData "ExecutablesFile" "Agda.Interaction.Library.Base" "Agda-2.6.20240714-inplace" 'False) (C1 ('MetaCons "ExecutablesFile" 'PrefixI 'True) (S1 ('MetaSel ('Just "efPath") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FilePath) :*: S1 ('MetaSel ('Just "efExists") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool))) |
libNameForCurrentDir :: LibName Source #
The special name "."
is used to indicated that the current directory
should count as a project root.
data ProjectConfig Source #
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.
ProjectConfig | |
| |
DefaultProjectConfig |
Instances
NFData ProjectConfig Source # | |||||
Defined in Agda.Interaction.Library.Base rnf :: ProjectConfig -> () | |||||
Generic ProjectConfig Source # | |||||
Defined in Agda.Interaction.Library.Base
from :: ProjectConfig -> Rep ProjectConfig x to :: Rep ProjectConfig x -> ProjectConfig | |||||
type Rep ProjectConfig Source # | |||||
Defined in Agda.Interaction.Library.Base type Rep ProjectConfig = D1 ('MetaData "ProjectConfig" "Agda.Interaction.Library.Base" "Agda-2.6.20240714-inplace" '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 'DecidedStrict) (Rec0 Int))) :+: C1 ('MetaCons "DefaultProjectConfig" 'PrefixI 'False) (U1 :: Type -> Type)) |
data OptionsPragma Source #
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.
OptionsPragma | |
|
Instances
EmbPrj OptionsPragma Source # | |
Defined in Agda.TypeChecking.Serialise.Instances.Common icode :: OptionsPragma -> S Int32 Source # icod_ :: OptionsPragma -> S Int32 Source # value :: Int32 -> R OptionsPragma Source # | |
NFData OptionsPragma Source # | Ranges are not forced. |
Defined in Agda.Interaction.Library.Base rnf :: OptionsPragma -> () | |
Monoid OptionsPragma Source # | |
Defined in Agda.Interaction.Library.Base mappend :: OptionsPragma -> OptionsPragma -> OptionsPragma mconcat :: [OptionsPragma] -> OptionsPragma | |
Semigroup OptionsPragma Source # | |
Defined in Agda.Interaction.Library.Base (<>) :: OptionsPragma -> OptionsPragma -> OptionsPragma # sconcat :: NonEmpty OptionsPragma -> OptionsPragma stimes :: Integral b => b -> OptionsPragma -> OptionsPragma | |
Show OptionsPragma Source # | |
Defined in Agda.Interaction.Library.Base showsPrec :: Int -> OptionsPragma -> ShowS show :: OptionsPragma -> String showList :: [OptionsPragma] -> ShowS |
data AgdaLibFile Source #
Content of a .agda-lib
file.
AgdaLibFile | |
|
Instances
NFData AgdaLibFile Source # | |||||
Defined in Agda.Interaction.Library.Base rnf :: AgdaLibFile -> () | |||||
Generic AgdaLibFile Source # | |||||
Defined in Agda.Interaction.Library.Base
from :: AgdaLibFile -> Rep AgdaLibFile x to :: Rep AgdaLibFile x -> AgdaLibFile | |||||
Show AgdaLibFile Source # | |||||
Defined in Agda.Interaction.Library.Base showsPrec :: Int -> AgdaLibFile -> ShowS show :: AgdaLibFile -> String showList :: [AgdaLibFile] -> ShowS | |||||
type Rep AgdaLibFile Source # | |||||
Defined in Agda.Interaction.Library.Base type Rep AgdaLibFile = D1 ('MetaData "AgdaLibFile" "Agda.Interaction.Library.Base" "Agda-2.6.20240714-inplace" '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 'DecidedStrict) (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))))) |
libFile :: Lens' AgdaLibFile FilePath Source #
libAbove :: Lens' AgdaLibFile Int Source #
libIncludes :: Lens' AgdaLibFile [FilePath] Source #
libDepends :: Lens' AgdaLibFile [LibName] Source #
Library warnings and errors
Position information
type LineNumber = Int Source #
data LibPositionInfo Source #
Information about which .agda-lib
file we are reading
and from where in the libraries
file it came from.
LibPositionInfo | |
|
Instances
EmbPrj LibPositionInfo Source # | |||||
Defined in Agda.TypeChecking.Serialise.Instances.Errors icode :: LibPositionInfo -> S Int32 Source # icod_ :: LibPositionInfo -> S Int32 Source # value :: Int32 -> R LibPositionInfo Source # | |||||
NFData LibPositionInfo Source # | |||||
Defined in Agda.Interaction.Library.Base rnf :: LibPositionInfo -> () | |||||
Generic LibPositionInfo Source # | |||||
Defined in Agda.Interaction.Library.Base
from :: LibPositionInfo -> Rep LibPositionInfo x to :: Rep LibPositionInfo x -> LibPositionInfo | |||||
Show LibPositionInfo Source # | |||||
Defined in Agda.Interaction.Library.Base showsPrec :: Int -> LibPositionInfo -> ShowS show :: LibPositionInfo -> String showList :: [LibPositionInfo] -> ShowS | |||||
type Rep LibPositionInfo Source # | |||||
Defined in Agda.Interaction.Library.Base type Rep LibPositionInfo = D1 ('MetaData "LibPositionInfo" "Agda.Interaction.Library.Base" "Agda-2.6.20240714-inplace" '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
data LibWarning Source #
Instances
Pretty LibWarning Source # | |||||
Defined in Agda.Interaction.Library.Base pretty :: LibWarning -> Doc Source # prettyPrec :: Int -> LibWarning -> Doc Source # prettyList :: [LibWarning] -> Doc Source # | |||||
EmbPrj LibWarning Source # | |||||
Defined in Agda.TypeChecking.Serialise.Instances.Errors icode :: LibWarning -> S Int32 Source # icod_ :: LibWarning -> S Int32 Source # value :: Int32 -> R LibWarning Source # | |||||
NFData LibWarning Source # | |||||
Defined in Agda.Interaction.Library.Base rnf :: LibWarning -> () | |||||
Generic LibWarning Source # | |||||
Defined in Agda.Interaction.Library.Base
from :: LibWarning -> Rep LibWarning x to :: Rep LibWarning x -> LibWarning | |||||
Show LibWarning Source # | |||||
Defined in Agda.Interaction.Library.Base showsPrec :: Int -> LibWarning -> ShowS show :: LibWarning -> String showList :: [LibWarning] -> ShowS | |||||
type Rep LibWarning Source # | |||||
Defined in Agda.Interaction.Library.Base type Rep LibWarning = D1 ('MetaData "LibWarning" "Agda.Interaction.Library.Base" "Agda-2.6.20240714-inplace" 'False) (C1 ('MetaCons "LibWarning" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe LibPositionInfo)) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 LibWarning'))) |
data LibWarning' Source #
Library Warnings.
UnknownField String |
Instances
Pretty LibWarning' Source # | |||||
Defined in Agda.Interaction.Library.Base pretty :: LibWarning' -> Doc Source # prettyPrec :: Int -> LibWarning' -> Doc Source # prettyList :: [LibWarning'] -> Doc Source # | |||||
EmbPrj LibWarning' Source # | |||||
Defined in Agda.TypeChecking.Serialise.Instances.Errors icode :: LibWarning' -> S Int32 Source # icod_ :: LibWarning' -> S Int32 Source # value :: Int32 -> R LibWarning' Source # | |||||
NFData LibWarning' Source # | |||||
Defined in Agda.Interaction.Library.Base rnf :: LibWarning' -> () | |||||
Generic LibWarning' Source # | |||||
Defined in Agda.Interaction.Library.Base
from :: LibWarning' -> Rep LibWarning' x to :: Rep LibWarning' x -> LibWarning' | |||||
Show LibWarning' Source # | |||||
Defined in Agda.Interaction.Library.Base showsPrec :: Int -> LibWarning' -> ShowS show :: LibWarning' -> String showList :: [LibWarning'] -> ShowS | |||||
type Rep LibWarning' Source # | |||||
Defined in Agda.Interaction.Library.Base type Rep LibWarning' = D1 ('MetaData "LibWarning'" "Agda.Interaction.Library.Base" "Agda-2.6.20240714-inplace" 'False) (C1 ('MetaCons "UnknownField" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String))) |
Errors
Instances
NFData LibError Source # | |||||
Defined in Agda.Interaction.Library.Base | |||||
Generic LibError Source # | |||||
Defined in Agda.Interaction.Library.Base
| |||||
Show LibError Source # | |||||
type Rep LibError Source # | |||||
Defined in Agda.Interaction.Library.Base type Rep LibError = D1 ('MetaData "LibError" "Agda.Interaction.Library.Base" "Agda-2.6.20240714-inplace" 'False) (C1 ('MetaCons "LibError" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe LibPositionInfo)) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 LibError'))) |
Collected errors while processing library files.
LibrariesFileNotFound FilePath | The user specified replacement for the default |
LibNotFound LibrariesFile LibName | Raised when a library name could not successfully be resolved
to an |
AmbiguousLib LibName [AgdaLibFile] | Raised when a library name is defined in several |
LibParseError LibParseError | The |
ReadError | An I/O Error occurred when reading a file. |
| |
DuplicateExecutable | The |
|
Instances
Pretty LibError' Source # | Pretty-print library management error without position info. | ||||
NFData LibError' Source # | |||||
Defined in Agda.Interaction.Library.Base | |||||
Generic LibError' Source # | |||||
Defined in Agda.Interaction.Library.Base
| |||||
Show LibError' Source # | |||||
type Rep LibError' Source # | |||||
Defined in Agda.Interaction.Library.Base type Rep LibError' = D1 ('MetaData "LibError'" "Agda.Interaction.Library.Base" "Agda-2.6.20240714-inplace" 'False) ((C1 ('MetaCons "LibrariesFileNotFound" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FilePath)) :+: (C1 ('MetaCons "LibNotFound" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 LibrariesFile) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 LibName)) :+: C1 ('MetaCons "AmbiguousLib" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 LibName) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [AgdaLibFile])))) :+: (C1 ('MetaCons "LibParseError" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 LibParseError)) :+: (C1 ('MetaCons "ReadError" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 IOException) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String)) :+: C1 ('MetaCons "DuplicateExecutable" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FilePath) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (List2 (LineNumber, FilePath)))))))) |
data LibParseError Source #
Exceptions thrown by the .agda-lib
parser.
BadLibraryName String | An invalid library name, e.g., containing spaces. |
ReadFailure FilePath IOException | I/O error while reading file. |
MissingFields (List1 String) | Missing these mandatory fields. |
DuplicateFields (List1 String) | These fields occur each more than once. |
MissingFieldName LineNumber | At the given line number, a field name is missing before the |
BadFieldName LineNumber String | At the given line number, an invalid field name is encountered before the |
MissingColonForField LineNumber String | At the given line number, the given field is not followed by |
ContentWithoutField LineNumber | At the given line number, indented text (content) is not preceded by a field. |
Instances
Pretty LibParseError Source # | Print library file parse error without position info. | ||||
Defined in Agda.Interaction.Library.Base pretty :: LibParseError -> Doc Source # prettyPrec :: Int -> LibParseError -> Doc Source # prettyList :: [LibParseError] -> Doc Source # | |||||
NFData LibParseError Source # | |||||
Defined in Agda.Interaction.Library.Base rnf :: LibParseError -> () | |||||
Generic LibParseError Source # | |||||
Defined in Agda.Interaction.Library.Base
from :: LibParseError -> Rep LibParseError x to :: Rep LibParseError x -> LibParseError | |||||
Show LibParseError Source # | |||||
Defined in Agda.Interaction.Library.Base showsPrec :: Int -> LibParseError -> ShowS show :: LibParseError -> String showList :: [LibParseError] -> ShowS | |||||
type Rep LibParseError Source # | |||||
Defined in Agda.Interaction.Library.Base type Rep LibParseError = D1 ('MetaData "LibParseError" "Agda.Interaction.Library.Base" "Agda-2.6.20240714-inplace" 'False) (((C1 ('MetaCons "BadLibraryName" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String)) :+: C1 ('MetaCons "ReadFailure" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FilePath) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 IOException))) :+: (C1 ('MetaCons "MissingFields" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (List1 String))) :+: C1 ('MetaCons "DuplicateFields" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (List1 String))))) :+: ((C1 ('MetaCons "MissingFieldName" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 LineNumber)) :+: C1 ('MetaCons "BadFieldName" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 LineNumber) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String))) :+: (C1 ('MetaCons "MissingColonForField" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 LineNumber) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String)) :+: C1 ('MetaCons "ContentWithoutField" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 LineNumber))))) |
Raising warnings and errors
type LibErrWarns = [Either LibError LibWarning] Source #
Collection of LibError
s and LibWarning
s.
warnings :: MonadWriter LibErrWarns m => List1 LibWarning -> m () Source #
warnings' :: MonadWriter LibErrWarns m => List1 LibWarning' -> m () Source #
raiseErrors' :: MonadWriter LibErrWarns m => List1 LibError' -> m () Source #
raiseErrors :: MonadWriter LibErrWarns m => List1 LibError -> m () Source #
Library Monad
type LibErrorIO = WriterT LibErrWarns (StateT LibState IO) Source #
Collects LibError
s and LibWarning
s.
type LibM = ExceptT LibErrors (WriterT [LibWarning] (StateT LibState IO)) Source #
Throws LibErrors
exceptions, still collects LibWarning
s.
type LibState = (Map FilePath ProjectConfig, Map FilePath AgdaLibFile) Source #
Cache locations of project configurations and parsed .agda-lib
files.
Collected errors when processing an .agda-lib
file.
Instances
NFData LibErrors Source # | |||||
Defined in Agda.Interaction.Library.Base | |||||
Generic LibErrors Source # | |||||
Defined in Agda.Interaction.Library.Base
| |||||
Show LibErrors Source # | |||||
type Rep LibErrors Source # | |||||
Defined in Agda.Interaction.Library.Base type Rep LibErrors = D1 ('MetaData "LibErrors" "Agda.Interaction.Library.Base" "Agda-2.6.20240714-inplace" '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)))) |
getCachedProjectConfig :: (MonadState LibState m, MonadIO m) => FilePath -> m (Maybe ProjectConfig) Source #
storeCachedProjectConfig :: (MonadState LibState m, MonadIO m) => FilePath -> ProjectConfig -> m () Source #
getCachedAgdaLibFile :: (MonadState LibState m, MonadIO m) => FilePath -> m (Maybe AgdaLibFile) Source #
storeCachedAgdaLibFile :: (MonadState LibState m, MonadIO m) => FilePath -> AgdaLibFile -> m () Source #
Prettyprinting errors and warnings
formatLibError :: [AgdaLibFile] -> LibError -> Doc Source #
Pretty-print LibError
.
hasLineNumber :: LibParseError -> Maybe LineNumber Source #
Does a parse error contain a line number?
formatLibPositionInfo :: LibPositionInfo -> LibParseError -> Doc Source #
Compute a position position prefix.
Depending on the error to be printed, it will
- either give the name of the
libraries
file and a line inside it, - or give the name of the
.agda-lib
file.
prettyInstalledLibraries :: [AgdaLibFile] -> Doc Source #