Mikan
Safe HaskellNone
LanguageHaskell2010

Mikan.Interaction.Library.Base

Description

Basic data types for library management.

Synopsis

Documentation

data LibName Source #

A symbolic library name.

Library names are structured into the base name and a suffix of version numbers, e.g. mylib-1.2.3. The version suffix is optional.

Constructors

LibName 

Fields

Instances

Instances details
Pretty LibName Source # 
Instance details

Defined in Mikan.Interaction.Library.Base

Null LibName Source # 
Instance details

Defined in Mikan.Interaction.Library.Base

NFData LibName Source # 
Instance details

Defined in Mikan.Interaction.Library.Base

Methods

rnf :: LibName -> () #

Generic LibName Source # 
Instance details

Defined in Mikan.Interaction.Library.Base

Associated Types

type Rep LibName 
Instance details

Defined in Mikan.Interaction.Library.Base

type Rep LibName = D1 ('MetaData "LibName" "Mikan.Interaction.Library.Base" "Mikan-2.9.0-CZbYRMbHmng2A9zjJ31VFu" 'False) (C1 ('MetaCons "LibName" 'PrefixI 'True) (S1 ('MetaSel ('Just "libNameBase") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Just "libNameVersion") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Integer])))

Methods

from :: LibName -> Rep LibName x #

to :: Rep LibName x -> LibName #

Show LibName Source # 
Instance details

Defined in Mikan.Interaction.Library.Base

Eq LibName Source # 
Instance details

Defined in Mikan.Interaction.Library.Base

Methods

(==) :: LibName -> LibName -> Bool #

(/=) :: LibName -> LibName -> Bool #

Ord LibName Source #

In comparisons, a missing version number is assumed to be infinity. E.g. foo > foo-2.2 > foo-2.0.1 > foo-2 > foo-1.0.

Instance details

Defined in Mikan.Interaction.Library.Base

Hashable LibName Source # 
Instance details

Defined in Mikan.Interaction.Library.Base

Methods

hashWithSalt :: Int -> LibName -> Int #

hash :: LibName -> Int #

type Rep LibName Source # 
Instance details

Defined in Mikan.Interaction.Library.Base

type Rep LibName = D1 ('MetaData "LibName" "Mikan.Interaction.Library.Base" "Mikan-2.9.0-CZbYRMbHmng2A9zjJ31VFu" 'False) (C1 ('MetaCons "LibName" 'PrefixI 'True) (S1 ('MetaSel ('Just "libNameBase") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Just "libNameVersion") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Integer])))

parseLibName :: String -> LibName Source #

Split a library name into basename and a list of version numbers.

parseLibName "foo-1.2.3"    == LibName "foo" [1, 2, 3]
parseLibName "foo-01.002.3" == LibName "foo" [1, 2, 3]

Note that because of leading zeros, parseLibName is not injective. (prettyShow . parseLibName would produce a normal form.)

data LibrariesFile Source #

Constructors

LibrariesFile 

Fields

  • lfPath :: FilePath

    E.g. ~.agdalibraries.

  • lfExists :: Bool

    The libraries file might not exist, but we may print its assumed location in error messages.

Instances

Instances details
NFData LibrariesFile Source # 
Instance details

Defined in Mikan.Interaction.Library.Base

Methods

rnf :: LibrariesFile -> () #

Generic LibrariesFile Source # 
Instance details

Defined in Mikan.Interaction.Library.Base

Associated Types

type Rep LibrariesFile 
Instance details

Defined in Mikan.Interaction.Library.Base

type Rep LibrariesFile = D1 ('MetaData "LibrariesFile" "Mikan.Interaction.Library.Base" "Mikan-2.9.0-CZbYRMbHmng2A9zjJ31VFu" 'False) (C1 ('MetaCons "LibrariesFile" 'PrefixI 'True) (S1 ('MetaSel ('Just "lfPath") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FilePath) :*: S1 ('MetaSel ('Just "lfExists") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool)))
Show LibrariesFile Source # 
Instance details

Defined in Mikan.Interaction.Library.Base

type Rep LibrariesFile Source # 
Instance details

Defined in Mikan.Interaction.Library.Base

type Rep LibrariesFile = D1 ('MetaData "LibrariesFile" "Mikan.Interaction.Library.Base" "Mikan-2.9.0-CZbYRMbHmng2A9zjJ31VFu" 'False) (C1 ('MetaCons "LibrariesFile" 'PrefixI 'True) (S1 ('MetaSel ('Just "lfPath") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FilePath) :*: S1 ('MetaSel ('Just "lfExists") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool)))

type ExeName = Text Source #

A symbolic executable name.

data ExecutablesFile Source #

Constructors

ExecutablesFile 

Fields

  • efPath :: FilePath

    E.g. ~.agdaexecutables.

  • efExists :: Bool

    The executables file might not exist, but we may print its assumed location in error messages.

Instances

Instances details
NFData ExecutablesFile Source # 
Instance details

Defined in Mikan.Interaction.Library.Base

Methods

rnf :: ExecutablesFile -> () #

Generic ExecutablesFile Source # 
Instance details

Defined in Mikan.Interaction.Library.Base

Associated Types

type Rep ExecutablesFile 
Instance details

Defined in Mikan.Interaction.Library.Base

type Rep ExecutablesFile = D1 ('MetaData "ExecutablesFile" "Mikan.Interaction.Library.Base" "Mikan-2.9.0-CZbYRMbHmng2A9zjJ31VFu" 'False) (C1 ('MetaCons "ExecutablesFile" 'PrefixI 'True) (S1 ('MetaSel ('Just "efPath") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FilePath) :*: S1 ('MetaSel ('Just "efExists") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool)))
Show ExecutablesFile Source # 
Instance details

Defined in Mikan.Interaction.Library.Base

type Rep ExecutablesFile Source # 
Instance details

Defined in Mikan.Interaction.Library.Base

type Rep ExecutablesFile = D1 ('MetaData "ExecutablesFile" "Mikan.Interaction.Library.Base" "Mikan-2.9.0-CZbYRMbHmng2A9zjJ31VFu" '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 an .agda-lib file, or be part of the default project.

Constructors

ProjectConfig 

Fields

DefaultProjectConfig 

Instances

Instances details
NFData ProjectConfig Source # 
Instance details

Defined in Mikan.Interaction.Library.Base

Methods

rnf :: ProjectConfig -> () #

Generic ProjectConfig Source # 
Instance details

Defined in Mikan.Interaction.Library.Base

Associated Types

type Rep ProjectConfig 
Instance details

Defined in Mikan.Interaction.Library.Base

type Rep ProjectConfig = D1 ('MetaData "ProjectConfig" "Mikan.Interaction.Library.Base" "Mikan-2.9.0-CZbYRMbHmng2A9zjJ31VFu" 'False) (C1 ('MetaCons "ProjectConfig" 'PrefixI 'True) (S1 ('MetaSel ('Just "configRoot") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FilePath) :*: (S1 ('MetaSel ('Just "configAgdaLibFile") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FilePath) :*: S1 ('MetaSel ('Just "configAbove") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int))) :+: C1 ('MetaCons "DefaultProjectConfig" 'PrefixI 'False) (U1 :: Type -> Type))
type Rep ProjectConfig Source # 
Instance details

Defined in Mikan.Interaction.Library.Base

type Rep ProjectConfig = D1 ('MetaData "ProjectConfig" "Mikan.Interaction.Library.Base" "Mikan-2.9.0-CZbYRMbHmng2A9zjJ31VFu" 'False) (C1 ('MetaCons "ProjectConfig" 'PrefixI 'True) (S1 ('MetaSel ('Just "configRoot") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FilePath) :*: (S1 ('MetaSel ('Just "configAgdaLibFile") '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.

Constructors

OptionsPragma 

Fields

data AgdaLibFile Source #

Content of a .agda-lib file.

Constructors

AgdaLibFile 

Fields

Instances

Instances details
NFData AgdaLibFile Source # 
Instance details

Defined in Mikan.Interaction.Library.Base

Methods

rnf :: AgdaLibFile -> () #

Generic AgdaLibFile Source # 
Instance details

Defined in Mikan.Interaction.Library.Base

Associated Types

type Rep AgdaLibFile 
Instance details

Defined in Mikan.Interaction.Library.Base

Show AgdaLibFile Source # 
Instance details

Defined in Mikan.Interaction.Library.Base

type Rep AgdaLibFile Source # 
Instance details

Defined in Mikan.Interaction.Library.Base

Lenses

Lenses for ProjectConfig

Lenses for AgdaLibFile

Library warnings and errors

Position information

data LibPositionInfo Source #

Information about which .agda-lib file we are reading and from where in the libraries file it came from.

Constructors

LibPositionInfo 

Fields

Instances

Instances details
NFData LibPositionInfo Source # 
Instance details

Defined in Mikan.Interaction.Library.Base

Methods

rnf :: LibPositionInfo -> () #

Generic LibPositionInfo Source # 
Instance details

Defined in Mikan.Interaction.Library.Base

Associated Types

type Rep LibPositionInfo 
Instance details

Defined in Mikan.Interaction.Library.Base

type Rep LibPositionInfo = D1 ('MetaData "LibPositionInfo" "Mikan.Interaction.Library.Base" "Mikan-2.9.0-CZbYRMbHmng2A9zjJ31VFu" '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))))
Show LibPositionInfo Source # 
Instance details

Defined in Mikan.Interaction.Library.Base

type Rep LibPositionInfo Source # 
Instance details

Defined in Mikan.Interaction.Library.Base

type Rep LibPositionInfo = D1 ('MetaData "LibPositionInfo" "Mikan.Interaction.Library.Base" "Mikan-2.9.0-CZbYRMbHmng2A9zjJ31VFu" '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

Instances details
Pretty LibWarning Source # 
Instance details

Defined in Mikan.Interaction.Library.Base

NFData LibWarning Source # 
Instance details

Defined in Mikan.Interaction.Library.Base

Methods

rnf :: LibWarning -> () #

Generic LibWarning Source # 
Instance details

Defined in Mikan.Interaction.Library.Base

Associated Types

type Rep LibWarning 
Instance details

Defined in Mikan.Interaction.Library.Base

type Rep LibWarning = D1 ('MetaData "LibWarning" "Mikan.Interaction.Library.Base" "Mikan-2.9.0-CZbYRMbHmng2A9zjJ31VFu" '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')))
Show LibWarning Source # 
Instance details

Defined in Mikan.Interaction.Library.Base

type Rep LibWarning Source # 
Instance details

Defined in Mikan.Interaction.Library.Base

type Rep LibWarning = D1 ('MetaData "LibWarning" "Mikan.Interaction.Library.Base" "Mikan-2.9.0-CZbYRMbHmng2A9zjJ31VFu" '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.

Constructors

UnknownField String 

Instances

Instances details
Pretty LibWarning' Source # 
Instance details

Defined in Mikan.Interaction.Library.Base

NFData LibWarning' Source # 
Instance details

Defined in Mikan.Interaction.Library.Base

Methods

rnf :: LibWarning' -> () #

Generic LibWarning' Source # 
Instance details

Defined in Mikan.Interaction.Library.Base

Associated Types

type Rep LibWarning' 
Instance details

Defined in Mikan.Interaction.Library.Base

type Rep LibWarning' = D1 ('MetaData "LibWarning'" "Mikan.Interaction.Library.Base" "Mikan-2.9.0-CZbYRMbHmng2A9zjJ31VFu" 'False) (C1 ('MetaCons "UnknownField" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String)))
Show LibWarning' Source # 
Instance details

Defined in Mikan.Interaction.Library.Base

type Rep LibWarning' Source # 
Instance details

Defined in Mikan.Interaction.Library.Base

type Rep LibWarning' = D1 ('MetaData "LibWarning'" "Mikan.Interaction.Library.Base" "Mikan-2.9.0-CZbYRMbHmng2A9zjJ31VFu" 'False) (C1 ('MetaCons "UnknownField" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String)))

Errors

data LibError Source #

Instances

Instances details
NFData LibError Source # 
Instance details

Defined in Mikan.Interaction.Library.Base

Methods

rnf :: LibError -> () #

Generic LibError Source # 
Instance details

Defined in Mikan.Interaction.Library.Base

Associated Types

type Rep LibError 
Instance details

Defined in Mikan.Interaction.Library.Base

type Rep LibError = D1 ('MetaData "LibError" "Mikan.Interaction.Library.Base" "Mikan-2.9.0-CZbYRMbHmng2A9zjJ31VFu" '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')))

Methods

from :: LibError -> Rep LibError x #

to :: Rep LibError x -> LibError #

Show LibError Source # 
Instance details

Defined in Mikan.Interaction.Library.Base

type Rep LibError Source # 
Instance details

Defined in Mikan.Interaction.Library.Base

type Rep LibError = D1 ('MetaData "LibError" "Mikan.Interaction.Library.Base" "Mikan-2.9.0-CZbYRMbHmng2A9zjJ31VFu" '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')))

data LibError' Source #

Collected errors while processing library files.

Constructors

LibrariesFileNotFound FilePath

The user specified replacement for the default libraries file does not exist.

DefaultsFileNotFound FilePath

The user specified replacement for the default defaults file does not exist.

LibNotFound LibrariesFile LibName

Raised when a library name could not successfully be resolved to an .agda-lib file.

AmbiguousLib LibName (List2 AgdaLibFile)

Raised when a library name is defined in several .agda-lib files.

SeveralAgdaLibFiles FilePath (List2 FilePath)

The given project root contains more than one .agda-lib file.

LibParseError LibParseError

The .agda-lib file could not be parsed.

ReadError

An I/O Error occurred when reading a file.

Fields

DuplicateExecutable

The executables file contains duplicate entries.

Fields

Instances

Instances details
Pretty LibError' Source #

Pretty-print library management error without position info.

Instance details

Defined in Mikan.Interaction.Library.Base

NFData LibError' Source # 
Instance details

Defined in Mikan.Interaction.Library.Base

Methods

rnf :: LibError' -> () #

Generic LibError' Source # 
Instance details

Defined in Mikan.Interaction.Library.Base

Associated Types

type Rep LibError' 
Instance details

Defined in Mikan.Interaction.Library.Base

type Rep LibError' = D1 ('MetaData "LibError'" "Mikan.Interaction.Library.Base" "Mikan-2.9.0-CZbYRMbHmng2A9zjJ31VFu" 'False) (((C1 ('MetaCons "LibrariesFileNotFound" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FilePath)) :+: C1 ('MetaCons "DefaultsFileNotFound" '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 (List2 AgdaLibFile))))) :+: ((C1 ('MetaCons "SeveralAgdaLibFiles" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FilePath) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (List2 FilePath))) :+: 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))))))))
Show LibError' Source # 
Instance details

Defined in Mikan.Interaction.Library.Base

type Rep LibError' Source # 
Instance details

Defined in Mikan.Interaction.Library.Base

type Rep LibError' = D1 ('MetaData "LibError'" "Mikan.Interaction.Library.Base" "Mikan-2.9.0-CZbYRMbHmng2A9zjJ31VFu" 'False) (((C1 ('MetaCons "LibrariesFileNotFound" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FilePath)) :+: C1 ('MetaCons "DefaultsFileNotFound" '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 (List2 AgdaLibFile))))) :+: ((C1 ('MetaCons "SeveralAgdaLibFiles" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FilePath) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (List2 FilePath))) :+: 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.

Constructors

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 :. (E.g., containing spaces.)

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

Instances details
Pretty LibParseError Source #

Print library file parse error without position info.

Instance details

Defined in Mikan.Interaction.Library.Base

NFData LibParseError Source # 
Instance details

Defined in Mikan.Interaction.Library.Base

Methods

rnf :: LibParseError -> () #

Generic LibParseError Source # 
Instance details

Defined in Mikan.Interaction.Library.Base

Associated Types

type Rep LibParseError 
Instance details

Defined in Mikan.Interaction.Library.Base

type Rep LibParseError = D1 ('MetaData "LibParseError" "Mikan.Interaction.Library.Base" "Mikan-2.9.0-CZbYRMbHmng2A9zjJ31VFu" '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)))))
Show LibParseError Source # 
Instance details

Defined in Mikan.Interaction.Library.Base

type Rep LibParseError Source # 
Instance details

Defined in Mikan.Interaction.Library.Base

type Rep LibParseError = D1 ('MetaData "LibParseError" "Mikan.Interaction.Library.Base" "Mikan-2.9.0-CZbYRMbHmng2A9zjJ31VFu" '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

Library Monad

type LibM = ExceptT LibErrors (WriterT [LibWarning] (StateT LibState IO)) Source #

Throws LibErrors exceptions, still collects LibWarnings.

data LibCache Source #

Cache locations of project configurations and parsed .agda-lib files.

Constructors

LibCache 

Fields

Instances

Instances details
Null LibCache Source # 
Instance details

Defined in Mikan.Interaction.Library.Base

NFData LibCache Source # 
Instance details

Defined in Mikan.Interaction.Library.Base

Methods

rnf :: LibCache -> () #

Generic LibCache Source # 
Instance details

Defined in Mikan.Interaction.Library.Base

Associated Types

type Rep LibCache 
Instance details

Defined in Mikan.Interaction.Library.Base

type Rep LibCache = D1 ('MetaData "LibCache" "Mikan.Interaction.Library.Base" "Mikan-2.9.0-CZbYRMbHmng2A9zjJ31VFu" 'False) (C1 ('MetaCons "LibCache" 'PrefixI 'True) (S1 ('MetaSel ('Just "projectConfigs") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map FilePath ProjectConfig)) :*: (S1 ('MetaSel ('Just "agdaLibFiles") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map FilePath AgdaLibFile)) :*: S1 ('MetaSel ('Just "ifaceFilePaths") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map AbsolutePath AbsolutePath)))))

Methods

from :: LibCache -> Rep LibCache x #

to :: Rep LibCache x -> LibCache #

type Rep LibCache Source # 
Instance details

Defined in Mikan.Interaction.Library.Base

type Rep LibCache = D1 ('MetaData "LibCache" "Mikan.Interaction.Library.Base" "Mikan-2.9.0-CZbYRMbHmng2A9zjJ31VFu" 'False) (C1 ('MetaCons "LibCache" 'PrefixI 'True) (S1 ('MetaSel ('Just "projectConfigs") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map FilePath ProjectConfig)) :*: (S1 ('MetaSel ('Just "agdaLibFiles") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map FilePath AgdaLibFile)) :*: S1 ('MetaSel ('Just "ifaceFilePaths") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map AbsolutePath AbsolutePath)))))

data LibErrors Source #

Collected errors when processing an .agda-lib file.

Instances

Instances details
NFData LibErrors Source # 
Instance details

Defined in Mikan.Interaction.Library.Base

Methods

rnf :: LibErrors -> () #

Generic LibErrors Source # 
Instance details

Defined in Mikan.Interaction.Library.Base

Associated Types

type Rep LibErrors 
Instance details

Defined in Mikan.Interaction.Library.Base

type Rep LibErrors = D1 ('MetaData "LibErrors" "Mikan.Interaction.Library.Base" "Mikan-2.9.0-CZbYRMbHmng2A9zjJ31VFu" '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))))
Show LibErrors Source # 
Instance details

Defined in Mikan.Interaction.Library.Base

type Rep LibErrors Source # 
Instance details

Defined in Mikan.Interaction.Library.Base

type Rep LibErrors = D1 ('MetaData "LibErrors" "Mikan.Interaction.Library.Base" "Mikan-2.9.0-CZbYRMbHmng2A9zjJ31VFu" '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

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.

Orphan instances

NFData IOException Source # 
Instance details

Methods

rnf :: IOException -> () #