License | BSD3 |
---|---|
Maintainer | The Idris Community. |
Safe Haskell | None |
Language | Haskell2010 |
- getContext :: Idris Context
- forCodegen :: Codegen -> [(Codegen, a)] -> [a]
- getObjectFiles :: Codegen -> Idris [FilePath]
- addObjectFile :: Codegen -> FilePath -> Idris ()
- getLibs :: Codegen -> Idris [String]
- addLib :: Codegen -> String -> Idris ()
- getFlags :: Codegen -> Idris [String]
- addFlag :: Codegen -> String -> Idris ()
- addDyLib :: [String] -> Idris (Either DynamicLib String)
- getAutoImports :: Idris [FilePath]
- addAutoImport :: FilePath -> Idris ()
- addDefinedName :: Name -> Idris ()
- getDefinedNames :: Idris [Name]
- addTT :: Term -> Idris (Maybe Term)
- dumpTT :: Idris ()
- addHdr :: Codegen -> String -> Idris ()
- addImported :: Bool -> FilePath -> Idris ()
- addLangExt :: LanguageExt -> Idris ()
- dropLangExt :: LanguageExt -> Idris ()
- addTrans :: Name -> (Term, Term) -> Idris ()
- addErrRev :: (Term, Term) -> Idris ()
- addErrReduce :: Name -> Idris ()
- addErasureUsage :: Name -> Int -> Idris ()
- addExport :: Name -> Idris ()
- addUsedName :: FC -> Name -> Name -> Idris ()
- getErasureUsage :: Idris [(Name, Int)]
- getExports :: Idris [Name]
- totcheck :: (FC, Name) -> Idris ()
- defer_totcheck :: (FC, Name) -> Idris ()
- clear_totcheck :: Idris ()
- setFlags :: Name -> [FnOpt] -> Idris ()
- addFnOpt :: Name -> FnOpt -> Idris ()
- setFnInfo :: Name -> FnInfo -> Idris ()
- setAccessibility :: Name -> Accessibility -> Idris ()
- getFromHideList :: Name -> Idris (Maybe Accessibility)
- setTotality :: Name -> Totality -> Idris ()
- setInjectivity :: Name -> Injectivity -> Idris ()
- getTotality :: Name -> Idris Totality
- getCoercionsTo :: IState -> Type -> [Name]
- addToCG :: Name -> CGInfo -> Idris ()
- addCalls :: Name -> [Name] -> Idris ()
- addTyInferred :: Name -> Idris ()
- addTyInfConstraints :: FC -> [(Term, Term)] -> Idris ()
- isTyInferred :: Name -> Idris Bool
- addFunctionErrorHandlers :: Name -> Name -> [Name] -> Idris ()
- getAllNames :: Name -> Idris [Name]
- getCGAllNames :: IState -> Name -> Maybe [Name]
- addCGAllNames :: IState -> Name -> [Name] -> Idris ()
- allNames :: [Name] -> Name -> Idris [Name]
- addCoercion :: Name -> Idris ()
- addDocStr :: Name -> Docstring DocTerm -> [(Name, Docstring DocTerm)] -> Idris ()
- addNameHint :: Name -> Name -> Idris ()
- getNameHints :: IState -> Name -> [Name]
- addDeprecated :: Name -> String -> Idris ()
- getDeprecated :: Name -> Idris (Maybe String)
- addFragile :: Name -> String -> Idris ()
- getFragile :: Name -> Idris (Maybe String)
- push_estack :: Name -> Bool -> Idris ()
- pop_estack :: Idris ()
- addImplementation :: Bool -> Bool -> Name -> Name -> Idris ()
- addOpenImpl :: [Name] -> Idris [Name]
- setOpenImpl :: [Name] -> Idris ()
- getOpenImpl :: Idris [Name]
- addInterface :: Name -> InterfaceInfo -> Idris ()
- updateIMethods :: Name -> [(Name, PTerm)] -> Idris ()
- addRecord :: Name -> RecordInfo -> Idris ()
- addAutoHint :: Name -> Name -> Idris ()
- getAutoHints :: Name -> Idris [Name]
- addIBC :: IBCWrite -> Idris ()
- clearIBC :: Idris ()
- resetNameIdx :: Idris ()
- addNameIdx :: Name -> Idris (Int, Name)
- addNameIdx' :: IState -> Name -> (IState, (Int, Name))
- getSymbol :: Name -> Idris Name
- getHdrs :: Codegen -> Idris [String]
- getImported :: Idris [(FilePath, Bool)]
- setErrSpan :: FC -> Idris ()
- clearErr :: Idris ()
- getSO :: Idris (Maybe String)
- setSO :: Maybe String -> Idris ()
- getIState :: Idris IState
- putIState :: IState -> Idris ()
- updateIState :: (IState -> IState) -> Idris ()
- withContext :: (IState -> Ctxt a) -> Name -> b -> (a -> Idris b) -> Idris b
- withContext_ :: (IState -> Ctxt a) -> Name -> (a -> Idris ()) -> Idris ()
- runIO :: IO a -> Idris a
- getName :: Idris Int
- addInternalApp :: FilePath -> Int -> PTerm -> Idris ()
- getInternalApp :: FilePath -> Int -> Idris PTerm
- clearOrigPats :: Idris ()
- clearPTypes :: Idris ()
- checkUndefined :: FC -> Name -> Idris ()
- isUndefined :: FC -> Name -> Idris Bool
- setContext :: Context -> Idris ()
- updateContext :: (Context -> Context) -> Idris ()
- addConstraints :: FC -> (Int, [UConstraint]) -> Idris ()
- addDeferred :: [(Name, (Int, Maybe Name, Type, [Name], Bool, Bool))] -> Idris ()
- addDeferredTyCon :: [(Name, (Int, Maybe Name, Type, [Name], Bool, Bool))] -> Idris ()
- addDeferred' :: NameType -> [(Name, (Int, Maybe Name, Type, [Name], Bool, Bool))] -> Idris ()
- solveDeferred :: FC -> Name -> Idris ()
- getUndefined :: Idris [Name]
- isMetavarName :: Name -> IState -> Bool
- getWidth :: Idris ConsoleWidth
- setWidth :: ConsoleWidth -> Idris ()
- setDepth :: Maybe Int -> Idris ()
- typeDescription :: String
- type1Doc :: Doc OutputAnnotation
- isetPrompt :: String -> Idris ()
- isetLoadedRegion :: Idris ()
- setLogLevel :: Int -> Idris ()
- setLogCats :: [LogCat] -> Idris ()
- setCmdLine :: [Opt] -> Idris ()
- getCmdLine :: Idris [Opt]
- getDumpHighlighting :: Idris Bool
- getDumpDefun :: Idris (Maybe FilePath)
- getDumpCases :: Idris (Maybe FilePath)
- logLevel :: Idris Int
- setAutoImpls :: Bool -> Idris ()
- getAutoImpls :: Idris Bool
- setErrContext :: Bool -> Idris ()
- errContext :: Idris Bool
- getOptimise :: Idris [Optimisation]
- setOptimise :: [Optimisation] -> Idris ()
- addOptimise :: Optimisation -> Idris ()
- removeOptimise :: Optimisation -> Idris ()
- setOptLevel :: Int -> Idris ()
- useREPL :: Idris Bool
- setREPL :: Bool -> Idris ()
- showOrigErr :: Idris Bool
- setShowOrigErr :: Bool -> Idris ()
- setAutoSolve :: Bool -> Idris ()
- setNoBanner :: Bool -> Idris ()
- getNoBanner :: Idris Bool
- setEvalTypes :: Bool -> Idris ()
- getDesugarNats :: Idris Bool
- setDesugarNats :: Bool -> Idris ()
- setQuiet :: Bool -> Idris ()
- getQuiet :: Idris Bool
- setCodegen :: Codegen -> Idris ()
- codegen :: Idris Codegen
- setOutputTy :: OutputType -> Idris ()
- outputTy :: Idris OutputType
- setIdeMode :: Bool -> Handle -> Idris ()
- setTargetTriple :: String -> Idris ()
- targetTriple :: Idris String
- setTargetCPU :: String -> Idris ()
- targetCPU :: Idris String
- verbose :: Idris Int
- setVerbose :: Int -> Idris ()
- iReport :: Int -> String -> Idris ()
- typeInType :: Idris Bool
- setTypeInType :: Bool -> Idris ()
- coverage :: Idris Bool
- setCoverage :: Bool -> Idris ()
- setIBCSubDir :: FilePath -> Idris ()
- valIBCSubDir :: IState -> Idris FilePath
- addImportDir :: FilePath -> Idris ()
- setImportDirs :: [FilePath] -> Idris ()
- allImportDirs :: Idris [FilePath]
- rankedImportDirs :: FilePath -> Idris [FilePath]
- addSourceDir :: FilePath -> Idris ()
- setSourceDirs :: [FilePath] -> Idris ()
- allSourceDirs :: Idris [FilePath]
- colourise :: Idris Bool
- setColourise :: Bool -> Idris ()
- impShow :: Idris Bool
- setImpShow :: Bool -> Idris ()
- setColour :: ColourType -> IdrisColour -> Idris ()
- logLvl :: Int -> String -> Idris ()
- logCoverage :: Int -> String -> Idris ()
- logErasure :: Int -> String -> Idris ()
- logParser :: Int -> String -> Idris ()
- logElab :: Int -> String -> Idris ()
- logCodeGen :: Int -> String -> Idris ()
- logIBC :: Int -> String -> Idris ()
- logLvlCats :: [LogCat] -> Int -> String -> Idris ()
- cmdOptType :: Opt -> Idris Bool
- noErrors :: Idris Bool
- setTypeCase :: Bool -> Idris ()
- getIndentWith :: Idris Int
- setIndentWith :: Int -> Idris ()
- getIndentClause :: Idris Int
- setIndentClause :: Int -> Idris ()
- expandParams :: (Name -> Name) -> [(Name, PTerm)] -> [Name] -> [Name] -> PTerm -> PTerm
- expandParamsD :: Bool -> IState -> (Name -> Name) -> [(Name, PTerm)] -> [Name] -> PDecl -> PDecl
- mapsnd :: (t -> b) -> (a, t) -> (a, b)
- expandImplementationScope :: p1 -> p2 -> [(Name, t)] -> p3 -> PDecl' t -> PDecl' t
- getPriority :: IState -> PTerm -> Int
- addStatics :: Name -> Term -> PTerm -> Idris ()
- addToUsing :: [Using] -> [(Name, PTerm)] -> [Using]
- addUsingConstraints :: SyntaxInfo -> FC -> PTerm -> Idris PTerm
- addUsingImpls :: SyntaxInfo -> Name -> FC -> PTerm -> Idris PTerm
- getUnboundImplicits :: IState -> Type -> PTerm -> [(Bool, PArg)]
- implicit :: ElabInfo -> SyntaxInfo -> Name -> PTerm -> Idris PTerm
- implicit' :: ElabInfo -> SyntaxInfo -> [Name] -> Name -> PTerm -> Idris PTerm
- implicitise :: Bool -> SyntaxInfo -> [Name] -> IState -> PTerm -> (PTerm, [PArg])
- addImplPat :: IState -> PTerm -> PTerm
- addImplBound :: IState -> [Name] -> PTerm -> PTerm
- addImplBoundInf :: IState -> [Name] -> [Name] -> PTerm -> PTerm
- addImpl :: [Name] -> IState -> PTerm -> PTerm
- addImpl' :: Bool -> [Name] -> [Name] -> [Name] -> IState -> PTerm -> PTerm
- aiFn :: Name -> Bool -> Bool -> Bool -> Bool -> [Name] -> IState -> FC -> Name -> FC -> [[Text]] -> [PArg] -> Either Err PTerm
- impIn :: [PArg] -> PArg -> Bool
- expArg :: PArg' t -> Bool
- stripLinear :: IState -> PTerm -> PTerm
- stripUnmatchable :: IState -> PTerm -> PTerm
- mkPApp :: FC -> Int -> PTerm -> [PArg] -> PTerm
- findStatics :: IState -> PTerm -> (PTerm, [Bool])
- data EitherErr a b
- toEither :: EitherErr a b -> Either a b
- matchClause :: IState -> PTerm -> PTerm -> Either (PTerm, PTerm) [(Name, PTerm)]
- matchClause' :: Bool -> IState -> PTerm -> PTerm -> Either (PTerm, PTerm) [(Name, PTerm)]
- substMatches :: [(Name, PTerm)] -> PTerm -> PTerm
- substMatch :: Name -> PTerm -> PTerm -> PTerm
- substMatchShadow :: Name -> [Name] -> PTerm -> PTerm -> PTerm
- substMatchesShadow :: [(Name, PTerm)] -> [Name] -> PTerm -> PTerm
- shadow :: Name -> Name -> PTerm -> PTerm
- mkUniqueNames :: [Name] -> [(Name, Name)] -> PTerm -> PTerm
- module Idris.AbsSyntaxTree
Documentation
forCodegen :: Codegen -> [(Codegen, a)] -> [a] Source #
getAutoImports :: Idris [FilePath] Source #
addAutoImport :: FilePath -> Idris () Source #
addDefinedName :: Name -> Idris () Source #
getDefinedNames :: Idris [Name] Source #
addLangExt :: LanguageExt -> Idris () Source #
dropLangExt :: LanguageExt -> Idris () Source #
addTrans :: Name -> (Term, Term) -> Idris () Source #
Transforms are organised by the function being applied on the lhs of the transform, to make looking up appropriate transforms quicker
addErrRev :: (Term, Term) -> Idris () Source #
Add transformation rules from a definition, which will reverse the definition for an error to make it more readable
addErrReduce :: Name -> Idris () Source #
Say that the name should always be reduced in error messages, to help readability/error reflection
getExports :: Idris [Name] Source #
clear_totcheck :: Idris () Source #
setAccessibility :: Name -> Accessibility -> Idris () Source #
getFromHideList :: Name -> Idris (Maybe Accessibility) Source #
get the accessibility of a name outside this module
setInjectivity :: Name -> Injectivity -> Idris () Source #
addTyInferred :: Name -> Idris () Source #
addFunctionErrorHandlers :: Name -> Name -> [Name] -> Idris () Source #
Adds error handlers for a particular function and argument. If names are ambiguous, all matching handlers are updated.
getAllNames :: Name -> Idris [Name] Source #
Trace all the names in a call graph starting at the given name
addCoercion :: Name -> Idris () Source #
pop_estack :: Idris () Source #
:: Bool | whether the name is an Integer implementation |
-> Bool | whether to include the implementation in implementation search |
-> Name | the name of the interface |
-> Name | the name of the implementation |
-> Idris () |
Add an interface implementation function.
Precondition: the implementation should have the correct type.
Dodgy hack 1: Put integer implementations first in the list so they are resolved by default.
Dodgy hack 2: put constraint chasers (ParentN) last
addOpenImpl :: [Name] -> Idris [Name] Source #
Add a privileged implementation - one which implementation search will happily resolve immediately if it is type correct This is used for naming parent implementations when defining an implementation with constraints. Returns the old list, so we can revert easily at the end of a block
setOpenImpl :: [Name] -> Idris () Source #
getOpenImpl :: Idris [Name] Source #
addInterface :: Name -> InterfaceInfo -> Idris () Source #
resetNameIdx :: Idris () Source #
setErrSpan :: FC -> Idris () Source #
runIO :: IO a -> Idris a Source #
A version of liftIO that puts errors into the exception type of the Idris monad
addInternalApp :: FilePath -> Int -> PTerm -> Idris () Source #
InternalApp keeps track of the real function application for making case splits from, not the application the programmer wrote, which doesn't have the whole context in any case other than top level definitions
clearOrigPats :: Idris () Source #
Pattern definitions are only used for coverage checking, so erase them when we're done
clearPTypes :: Idris () Source #
Erase types from Ps in the context (basically ending up with what's in the .ibc, which is all we need after all the analysis is done)
setContext :: Context -> Idris () Source #
addConstraints :: FC -> (Int, [UConstraint]) -> Idris () Source #
:: NameType | |
-> [(Name, (Int, Maybe Name, Type, [Name], Bool, Bool))] | The Name is the name being made into a metavar, the Int is the number of vars that are part of a putative proof context, the Maybe Name is the top-level function containing the new metavariable, the Type is its type, and the Bool is whether :p is allowed |
-> Idris () |
Save information about a name that is not yet defined
getUndefined :: Idris [Name] Source #
setWidth :: ConsoleWidth -> Idris () Source #
isetPrompt :: String -> Idris () Source #
isetLoadedRegion :: Idris () Source #
Tell clients how much was parsed and loaded
setLogLevel :: Int -> Idris () Source #
setLogCats :: [LogCat] -> Idris () Source #
setCmdLine :: [Opt] -> Idris () Source #
getCmdLine :: Idris [Opt] Source #
setAutoImpls :: Bool -> Idris () Source #
getAutoImpls :: Idris Bool Source #
setErrContext :: Bool -> Idris () Source #
errContext :: Idris Bool Source #
getOptimise :: Idris [Optimisation] Source #
setOptimise :: [Optimisation] -> Idris () Source #
addOptimise :: Optimisation -> Idris () Source #
removeOptimise :: Optimisation -> Idris () Source #
setOptLevel :: Int -> Idris () Source #
Set appropriate optimisation set for the given level. We only have one optimisation that is configurable at the moment, however!
showOrigErr :: Idris Bool Source #
setShowOrigErr :: Bool -> Idris () Source #
setAutoSolve :: Bool -> Idris () Source #
setNoBanner :: Bool -> Idris () Source #
getNoBanner :: Idris Bool Source #
setEvalTypes :: Bool -> Idris () Source #
setDesugarNats :: Bool -> Idris () Source #
setCodegen :: Codegen -> Idris () Source #
setOutputTy :: OutputType -> Idris () Source #
setTargetTriple :: String -> Idris () Source #
setTargetCPU :: String -> Idris () Source #
setVerbose :: Int -> Idris () Source #
typeInType :: Idris Bool Source #
setTypeInType :: Bool -> Idris () Source #
setCoverage :: Bool -> Idris () Source #
setIBCSubDir :: FilePath -> Idris () Source #
addImportDir :: FilePath -> Idris () Source #
setImportDirs :: [FilePath] -> Idris () Source #
allImportDirs :: Idris [FilePath] Source #
addSourceDir :: FilePath -> Idris () Source #
setSourceDirs :: [FilePath] -> Idris () Source #
allSourceDirs :: Idris [FilePath] Source #
setColourise :: Bool -> Idris () Source #
setImpShow :: Bool -> Idris () Source #
setColour :: ColourType -> IdrisColour -> Idris () Source #
:: [LogCat] | The categories that the message should appear under. |
-> Int | The Logging level the message should appear. |
-> String | The message to show the developer. |
-> Idris () |
Log aspect of Idris execution
An empty set of logging levels is used to denote all categories.
@TODO update IDE protocol
setTypeCase :: Bool -> Idris () Source #
getIndentWith :: Idris Int Source #
setIndentWith :: Int -> Idris () Source #
setIndentClause :: Int -> Idris () Source #
expandParamsD :: Bool -> IState -> (Name -> Name) -> [(Name, PTerm)] -> [Name] -> PDecl -> PDecl Source #
getPriority :: IState -> PTerm -> Int Source #
Calculate a priority for a type, for deciding elaboration order * if it's just a type variable or concrete type, do it early (0) * if there's only type variables and injective constructors, do it next (1) * if there's a function type, next (2) * finally, everything else (3)
addUsingConstraints :: SyntaxInfo -> FC -> PTerm -> Idris PTerm Source #
addUsingImpls :: SyntaxInfo -> Name -> FC -> PTerm -> Idris PTerm Source #
Add implicit bindings from using block, and bind any missing names
implicitise :: Bool -> SyntaxInfo -> [Name] -> IState -> PTerm -> (PTerm, [PArg]) Source #
Even if auto_implicits is off, we need to call this so we record which arguments are implicit
addImpl :: [Name] -> IState -> PTerm -> PTerm Source #
Add the implicit arguments to applications in the term [Name] gives the names to always expend, even when under a binder of that name (this is to expand methods with implicit arguments in dependent interfaces).
impIn :: [PArg] -> PArg -> Bool Source #
return True if the second argument is an implicit argument which is expected in the implicits, or if it's not an implicit
stripUnmatchable :: IState -> PTerm -> PTerm Source #
Remove functions which aren't applied to anything, which must then be resolved by unification. Assume names resolved and alternatives filled in (so no ambiguity).
findStatics :: IState -> PTerm -> (PTerm, [Bool]) Source #
Find static
argument positions
(the declared ones, plus any names in argument position in the declared
statics)
FIXME: It's possible that this really has to happen after elaboration
matchClause :: IState -> PTerm -> PTerm -> Either (PTerm, PTerm) [(Name, PTerm)] Source #
Syntactic match of a against b, returning pair of variables in a and what they match. Returns the pair that failed if not a match.
mkUniqueNames :: [Name] -> [(Name, Name)] -> PTerm -> PTerm Source #
Rename any binders which are repeated (so that we don't have to mess about with shadowing anywhere else).
module Idris.AbsSyntaxTree