idris-1.3.1: Functional Programming Language with Dependent Types

LicenseBSD3
MaintainerThe Idris Community.
Safe HaskellNone
LanguageHaskell2010

Idris.AbsSyntax

Description

 
Synopsis

Documentation

data EitherErr a b Source #

Constructors

LeftErr a 
RightOK b 
Instances
Monad (EitherErr a) Source # 
Instance details

Defined in Idris.AbsSyntax

Methods

(>>=) :: EitherErr a a0 -> (a0 -> EitherErr a b) -> EitherErr a b #

(>>) :: EitherErr a a0 -> EitherErr a b -> EitherErr a b #

return :: a0 -> EitherErr a a0 #

fail :: String -> EitherErr a a0 #

Functor (EitherErr a) Source # 
Instance details

Defined in Idris.AbsSyntax

Methods

fmap :: (a0 -> b) -> EitherErr a a0 -> EitherErr a b #

(<$) :: a0 -> EitherErr a b -> EitherErr a a0 #

Applicative (EitherErr a) Source # 
Instance details

Defined in Idris.AbsSyntax

Methods

pure :: a0 -> EitherErr a a0 #

(<*>) :: EitherErr a (a0 -> b) -> EitherErr a a0 -> EitherErr a b #

liftA2 :: (a0 -> b -> c) -> EitherErr a a0 -> EitherErr a b -> EitherErr a c #

(*>) :: EitherErr a a0 -> EitherErr a b -> EitherErr a b #

(<*) :: EitherErr a a0 -> EitherErr a b -> EitherErr a a0 #

forCodegen :: Codegen -> [(Codegen, a)] -> [a] 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

getFromHideList :: Name -> Idris (Maybe Accessibility) Source #

get the accessibility of a name outside this module

addCalls :: Name -> [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

addImplementation Source #

Arguments

:: 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

addNameIdx :: Name -> Idris (Int, Name) Source #

Used to preserve sharing of names

withContext :: (IState -> Ctxt a) -> Name -> b -> (a -> Idris b) -> Idris b Source #

withContext_ :: (IState -> Ctxt a) -> Name -> (a -> Idris ()) -> 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)

addDeferred' Source #

Arguments

:: 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

isetLoadedRegion :: Idris () Source #

Tell clients how much was parsed and loaded

setOptLevel :: Int -> Idris () Source #

Set appropriate optimisation set for the given level. We only have one optimisation that is configurable at the moment, however!

logParser :: Int -> String -> Idris () Source #

Log an action of the parser

logElab :: Int -> String -> Idris () Source #

Log an action of the elaborator.

logCodeGen :: Int -> String -> Idris () Source #

Log an action of the compiler.

logLvlCats Source #

Arguments

:: [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

expandParams :: (Name -> Name) -> [(Name, PTerm)] -> [Name] -> [Name] -> PTerm -> PTerm Source #

expandParamsD :: Bool -> IState -> (Name -> Name) -> [(Name, PTerm)] -> [Name] -> PDecl -> PDecl Source #

mapsnd :: (t -> b) -> (a, t) -> (a, b) Source #

expandImplementationScope :: p1 -> p2 -> [(Name, t)] -> p3 -> PDecl' t -> PDecl' t 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)

addToUsing :: [Using] -> [(Name, PTerm)] -> [Using] 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

addImplPat :: IState -> PTerm -> PTerm Source #

Add implicit arguments in function calls

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).

addImpl' :: Bool -> [Name] -> [Name] -> [Name] -> IState -> PTerm -> PTerm Source #

aiFn Source #

Arguments

:: Name 
-> Bool

Allow capitalization of pattern variables

-> Bool 
-> Bool 
-> Bool 
-> [Name] 
-> IState 
-> FC 
-> Name

function being applied

-> FC 
-> [[Text]] 
-> [PArg]

initial arguments (if in a pattern)

-> Either Err PTerm 

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).

mkPApp :: FC -> Int -> PTerm -> [PArg] -> PTerm Source #

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).