idris 0.9.19.1 → 0.9.20
raw patch · 196 files changed
+4332/−1271 lines, 196 filesdep ~vectorPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependency ranges changed: vector
API changes (from Hackage documentation)
- IRTS.Bytecode: instance Eq Reg
- IRTS.Bytecode: instance Show BC
- IRTS.Bytecode: instance Show Reg
- IRTS.CodegenCommon: compileLibs :: CodegenInfo -> [String]
- IRTS.CodegenCommon: compileObjs :: CodegenInfo -> [String]
- IRTS.CodegenCommon: compilerFlags :: CodegenInfo -> [String]
- IRTS.CodegenCommon: debugLevel :: CodegenInfo -> DbgLevel
- IRTS.CodegenCommon: defunDecls :: CodegenInfo -> [(Name, DDecl)]
- IRTS.CodegenCommon: exportDecls :: CodegenInfo -> [ExportIFace]
- IRTS.CodegenCommon: importDirs :: CodegenInfo -> [FilePath]
- IRTS.CodegenCommon: includes :: CodegenInfo -> [FilePath]
- IRTS.CodegenCommon: instance Eq DbgLevel
- IRTS.CodegenCommon: instance Eq OutputType
- IRTS.CodegenCommon: instance Show OutputType
- IRTS.CodegenCommon: interfaces :: CodegenInfo -> Bool
- IRTS.CodegenCommon: liftDecls :: CodegenInfo -> [(Name, LDecl)]
- IRTS.CodegenCommon: outputFile :: CodegenInfo -> String
- IRTS.CodegenCommon: outputType :: CodegenInfo -> OutputType
- IRTS.CodegenCommon: simpleDecls :: CodegenInfo -> [(Name, SDecl)]
- IRTS.CodegenCommon: targetCPU :: CodegenInfo -> String
- IRTS.CodegenCommon: targetTriple :: CodegenInfo -> String
- IRTS.CodegenJavaScript: instance Eq JSTarget
- IRTS.Compiler: instance Show VarInfo
- IRTS.Defunctionalise: instance Eq DAlt
- IRTS.Defunctionalise: instance Eq DDecl
- IRTS.Defunctionalise: instance Eq DExp
- IRTS.Defunctionalise: instance Show DAlt
- IRTS.Defunctionalise: instance Show DDecl
- IRTS.Defunctionalise: instance Show DExp
- IRTS.JavaScript.AST: instance Eq JS
- IRTS.JavaScript.AST: instance Eq JSAnnotation
- IRTS.JavaScript.AST: instance Eq JSInteger
- IRTS.JavaScript.AST: instance Eq JSNum
- IRTS.JavaScript.AST: instance Eq JSType
- IRTS.JavaScript.AST: instance Eq JSWord
- IRTS.JavaScript.AST: instance Show JSAnnotation
- IRTS.Lang: instance Eq Endianness
- IRTS.Lang: instance Eq Export
- IRTS.Lang: instance Eq ExportIFace
- IRTS.Lang: instance Eq FCallType
- IRTS.Lang: instance Eq FDesc
- IRTS.Lang: instance Eq FType
- IRTS.Lang: instance Eq LDecl
- IRTS.Lang: instance Eq LExp
- IRTS.Lang: instance Eq LOpt
- IRTS.Lang: instance Eq LVar
- IRTS.Lang: instance Eq PrimFn
- IRTS.Lang: instance Eq e => Eq (LAlt' e)
- IRTS.Lang: instance Functor LAlt'
- IRTS.Lang: instance Show Endianness
- IRTS.Lang: instance Show Export
- IRTS.Lang: instance Show ExportIFace
- IRTS.Lang: instance Show FCallType
- IRTS.Lang: instance Show FDesc
- IRTS.Lang: instance Show FType
- IRTS.Lang: instance Show LDecl
- IRTS.Lang: instance Show LExp
- IRTS.Lang: instance Show LOpt
- IRTS.Lang: instance Show LVar
- IRTS.Lang: instance Show PrimFn
- IRTS.Lang: instance Show e => Show (LAlt' e)
- IRTS.Simplified: instance Show SAlt
- IRTS.Simplified: instance Show SDecl
- IRTS.Simplified: instance Show SExp
- Idris.ASTUtils: instance Category Field
- Idris.AbsSyntax: instance Applicative (EitherErr a)
- Idris.AbsSyntax: instance Functor (EitherErr a)
- Idris.AbsSyntax: instance Monad (EitherErr a)
- Idris.AbsSyntaxTree: argopts :: PArg' t -> [ArgOpt]
- Idris.AbsSyntaxTree: argsdef :: CGInfo -> [Name]
- Idris.AbsSyntaxTree: argsused :: CGInfo -> [Name]
- Idris.AbsSyntaxTree: brace_stack :: IState -> [Maybe Int]
- Idris.AbsSyntaxTree: calls :: CGInfo -> [(Name, [[Name]])]
- Idris.AbsSyntaxTree: case_decls :: EState -> [(Name, PDecl)]
- Idris.AbsSyntaxTree: class_default_superclasses :: ClassInfo -> [PDecl]
- Idris.AbsSyntaxTree: class_defaults :: ClassInfo -> [(Name, (Name, PDecl))]
- Idris.AbsSyntaxTree: class_determiners :: ClassInfo -> [Int]
- Idris.AbsSyntaxTree: class_instances :: ClassInfo -> [(Name, Bool)]
- Idris.AbsSyntaxTree: class_methods :: ClassInfo -> [(Name, (FnOpts, PTerm))]
- Idris.AbsSyntaxTree: class_params :: ClassInfo -> [Name]
- Idris.AbsSyntaxTree: compiled_so :: IState -> Maybe String
- Idris.AbsSyntaxTree: d_cons :: PData' t -> [(Docstring (Either Err PTerm), [(Name, Docstring (Either Err PTerm))], Name, FC, t, FC, [Name])]
- Idris.AbsSyntaxTree: d_name :: PData' t -> Name
- Idris.AbsSyntaxTree: d_name_fc :: PData' t -> FC
- Idris.AbsSyntaxTree: d_tcon :: PData' t -> t
- Idris.AbsSyntaxTree: decoration :: SyntaxInfo -> Name -> Name
- Idris.AbsSyntaxTree: default_access :: IState -> Accessibility
- Idris.AbsSyntaxTree: default_total :: IState -> Bool
- Idris.AbsSyntaxTree: delayed_elab :: EState -> [(Int, Elab' EState ())]
- Idris.AbsSyntaxTree: detaggable :: OptInfo -> Bool
- Idris.AbsSyntaxTree: dsl_apply :: DSL' t -> t
- Idris.AbsSyntaxTree: dsl_bind :: DSL' t -> t
- Idris.AbsSyntaxTree: dsl_info :: SyntaxInfo -> DSL
- Idris.AbsSyntaxTree: dsl_lambda :: DSL' t -> Maybe t
- Idris.AbsSyntaxTree: dsl_let :: DSL' t -> Maybe t
- Idris.AbsSyntaxTree: dsl_pi :: DSL' t -> Maybe t
- Idris.AbsSyntaxTree: dsl_pure :: DSL' t -> t
- Idris.AbsSyntaxTree: dsl_return :: DSL' t -> t
- Idris.AbsSyntaxTree: dsl_var :: DSL' t -> Maybe t
- Idris.AbsSyntaxTree: elabFC :: ElabInfo -> Maybe FC
- Idris.AbsSyntaxTree: elab_stack :: IState -> [(Name, Bool)]
- Idris.AbsSyntaxTree: errSpan :: IState -> Maybe FC
- Idris.AbsSyntaxTree: fn_params :: FnInfo -> [Int]
- Idris.AbsSyntaxTree: getScript :: PArg' t -> t
- Idris.AbsSyntaxTree: getTm :: PArg' t -> t
- Idris.AbsSyntaxTree: hide_list :: IState -> [(Name, Maybe Accessibility)]
- Idris.AbsSyntaxTree: highlighting :: EState -> [(FC, OutputAnnotation)]
- Idris.AbsSyntaxTree: ibc_write :: IState -> [IBCWrite]
- Idris.AbsSyntaxTree: idris_autohints :: IState -> Ctxt [Name]
- Idris.AbsSyntaxTree: idris_calledgraph :: IState -> Ctxt [Name]
- Idris.AbsSyntaxTree: idris_callgraph :: IState -> Ctxt CGInfo
- Idris.AbsSyntaxTree: idris_callswho :: IState -> Maybe (Map Name [Name])
- Idris.AbsSyntaxTree: idris_cgflags :: IState -> [(Codegen, String)]
- Idris.AbsSyntaxTree: idris_classes :: IState -> Ctxt ClassInfo
- Idris.AbsSyntaxTree: idris_coercions :: IState -> [Name]
- Idris.AbsSyntaxTree: idris_colourRepl :: IState -> Bool
- Idris.AbsSyntaxTree: idris_colourTheme :: IState -> ColourTheme
- Idris.AbsSyntaxTree: idris_consolewidth :: IState -> ConsoleWidth
- Idris.AbsSyntaxTree: idris_constraints :: IState -> Set ConstraintFC
- Idris.AbsSyntaxTree: idris_datatypes :: IState -> Ctxt TypeInfo
- Idris.AbsSyntaxTree: idris_defertotcheck :: IState -> [(FC, Name)]
- Idris.AbsSyntaxTree: idris_docstrings :: IState -> Ctxt (Docstring DocTerm, [(Name, Docstring DocTerm)])
- Idris.AbsSyntaxTree: idris_dsls :: IState -> Ctxt DSL
- Idris.AbsSyntaxTree: idris_dynamic_libs :: IState -> [DynamicLib]
- Idris.AbsSyntaxTree: idris_erasureUsed :: IState -> [(Name, Int)]
- Idris.AbsSyntaxTree: idris_errRev :: IState -> [(Term, Term)]
- Idris.AbsSyntaxTree: idris_errorhandlers :: IState -> [Name]
- Idris.AbsSyntaxTree: idris_exports :: IState -> [Name]
- Idris.AbsSyntaxTree: idris_externs :: IState -> Set (Name, Int)
- Idris.AbsSyntaxTree: idris_flags :: IState -> Ctxt [FnOpt]
- Idris.AbsSyntaxTree: idris_fninfo :: IState -> Ctxt FnInfo
- Idris.AbsSyntaxTree: idris_function_errorhandlers :: IState -> Ctxt (Map Name (Set Name))
- Idris.AbsSyntaxTree: idris_hdrs :: IState -> [(Codegen, String)]
- Idris.AbsSyntaxTree: idris_highlightedRegions :: IState -> [(FC, OutputAnnotation)]
- Idris.AbsSyntaxTree: idris_implicits :: IState -> Ctxt [PArg]
- Idris.AbsSyntaxTree: idris_imported :: IState -> [(FilePath, Bool)]
- Idris.AbsSyntaxTree: idris_infixes :: IState -> [FixDecl]
- Idris.AbsSyntaxTree: idris_language_extensions :: IState -> [LanguageExt]
- Idris.AbsSyntaxTree: idris_libs :: IState -> [(Codegen, String)]
- Idris.AbsSyntaxTree: idris_lineapps :: IState -> [((FilePath, Int), PTerm)]
- Idris.AbsSyntaxTree: idris_metavars :: IState -> [(Name, (Maybe Name, Int, [Name], Bool))]
- Idris.AbsSyntaxTree: idris_moduledocs :: IState -> Ctxt (Docstring DocTerm)
- Idris.AbsSyntaxTree: idris_name :: IState -> Int
- Idris.AbsSyntaxTree: idris_nameIdx :: IState -> (Int, Ctxt (Int, Name))
- Idris.AbsSyntaxTree: idris_namehints :: IState -> Ctxt [Name]
- Idris.AbsSyntaxTree: idris_objs :: IState -> [(Codegen, FilePath)]
- Idris.AbsSyntaxTree: idris_optimisation :: IState -> Ctxt OptInfo
- Idris.AbsSyntaxTree: idris_options :: IState -> IOption
- Idris.AbsSyntaxTree: idris_outputmode :: IState -> OutputMode
- Idris.AbsSyntaxTree: idris_parsedSpan :: IState -> Maybe FC
- Idris.AbsSyntaxTree: idris_parserHighlights :: IState -> [(FC, OutputAnnotation)]
- Idris.AbsSyntaxTree: idris_patdefs :: IState -> Ctxt ([([Name], Term, Term)], [PTerm])
- Idris.AbsSyntaxTree: idris_postulates :: IState -> Set Name
- Idris.AbsSyntaxTree: idris_records :: IState -> Ctxt RecordInfo
- Idris.AbsSyntaxTree: idris_repl_defs :: IState -> [Name]
- Idris.AbsSyntaxTree: idris_scprims :: IState -> [(Name, (Int, PrimFn))]
- Idris.AbsSyntaxTree: idris_statics :: IState -> Ctxt [Bool]
- Idris.AbsSyntaxTree: idris_symbols :: IState -> Map Name Name
- Idris.AbsSyntaxTree: idris_totcheck :: IState -> [(FC, Name)]
- Idris.AbsSyntaxTree: idris_totcheckfail :: IState -> [(FC, String)]
- Idris.AbsSyntaxTree: idris_transforms :: IState -> Ctxt [(Term, Term)]
- Idris.AbsSyntaxTree: idris_tyinfodata :: IState -> Ctxt TIData
- Idris.AbsSyntaxTree: idris_whocalls :: IState -> Maybe (Map Name [Name])
- Idris.AbsSyntaxTree: imp_methods :: SyntaxInfo -> [Name]
- Idris.AbsSyntaxTree: implicitAllowed :: SyntaxInfo -> Bool
- Idris.AbsSyntaxTree: imported :: IState -> [FilePath]
- Idris.AbsSyntaxTree: inPattern :: SyntaxInfo -> Bool
- Idris.AbsSyntaxTree: inaccessible :: OptInfo -> [(Int, Name)]
- Idris.AbsSyntaxTree: inblock :: ElabInfo -> Ctxt [Name]
- Idris.AbsSyntaxTree: indent_stack :: IState -> [Int]
- Idris.AbsSyntaxTree: index_first :: DSL' t -> Maybe t
- Idris.AbsSyntaxTree: index_next :: DSL' t -> Maybe t
- Idris.AbsSyntaxTree: instance Data ArgOpt
- Idris.AbsSyntaxTree: instance Data PAltType
- Idris.AbsSyntaxTree: instance Data PTerm
- Idris.AbsSyntaxTree: instance Data Plicity
- Idris.AbsSyntaxTree: instance Data PunInfo
- Idris.AbsSyntaxTree: instance Data Static
- Idris.AbsSyntaxTree: instance Data Using
- Idris.AbsSyntaxTree: instance Data t => Data (PArg' t)
- Idris.AbsSyntaxTree: instance Data t => Data (PDo' t)
- Idris.AbsSyntaxTree: instance Data t => Data (PTactic' t)
- Idris.AbsSyntaxTree: instance Eq ArgOpt
- Idris.AbsSyntaxTree: instance Eq Codegen
- Idris.AbsSyntaxTree: instance Eq ConsoleWidth
- Idris.AbsSyntaxTree: instance Eq ElabShellCmd
- Idris.AbsSyntaxTree: instance Eq ElabWhat
- Idris.AbsSyntaxTree: instance Eq FixDecl
- Idris.AbsSyntaxTree: instance Eq Fixity
- Idris.AbsSyntaxTree: instance Eq FnOpt
- Idris.AbsSyntaxTree: instance Eq IOption
- Idris.AbsSyntaxTree: instance Eq LanguageExt
- Idris.AbsSyntaxTree: instance Eq Opt
- Idris.AbsSyntaxTree: instance Eq Optimisation
- Idris.AbsSyntaxTree: instance Eq PAltType
- Idris.AbsSyntaxTree: instance Eq PTerm
- Idris.AbsSyntaxTree: instance Eq Plicity
- Idris.AbsSyntaxTree: instance Eq PunInfo
- Idris.AbsSyntaxTree: instance Eq SSymbol
- Idris.AbsSyntaxTree: instance Eq SizeChange
- Idris.AbsSyntaxTree: instance Eq Static
- Idris.AbsSyntaxTree: instance Eq Using
- Idris.AbsSyntaxTree: instance Eq t => Eq (PArg' t)
- Idris.AbsSyntaxTree: instance Eq t => Eq (PDo' t)
- Idris.AbsSyntaxTree: instance Eq t => Eq (PTactic' t)
- Idris.AbsSyntaxTree: instance Eq t => Eq (ProvideWhat' t)
- Idris.AbsSyntaxTree: instance Foldable PTactic'
- Idris.AbsSyntaxTree: instance Functor DSL'
- Idris.AbsSyntaxTree: instance Functor PArg'
- Idris.AbsSyntaxTree: instance Functor PClause'
- Idris.AbsSyntaxTree: instance Functor PData'
- Idris.AbsSyntaxTree: instance Functor PDecl'
- Idris.AbsSyntaxTree: instance Functor PDo'
- Idris.AbsSyntaxTree: instance Functor PTactic'
- Idris.AbsSyntaxTree: instance Functor ProvideWhat'
- Idris.AbsSyntaxTree: instance Ord FixDecl
- Idris.AbsSyntaxTree: instance Ord LanguageExt
- Idris.AbsSyntaxTree: instance Pretty PTerm OutputAnnotation
- Idris.AbsSyntaxTree: instance Read LanguageExt
- Idris.AbsSyntaxTree: instance Show ArgOpt
- Idris.AbsSyntaxTree: instance Show CGInfo
- Idris.AbsSyntaxTree: instance Show ClassInfo
- Idris.AbsSyntaxTree: instance Show Codegen
- Idris.AbsSyntaxTree: instance Show ConsoleWidth
- Idris.AbsSyntaxTree: instance Show ElabShellCmd
- Idris.AbsSyntaxTree: instance Show ElabWhat
- Idris.AbsSyntaxTree: instance Show FixDecl
- Idris.AbsSyntaxTree: instance Show Fixity
- Idris.AbsSyntaxTree: instance Show FnInfo
- Idris.AbsSyntaxTree: instance Show FnOpt
- Idris.AbsSyntaxTree: instance Show IBCWrite
- Idris.AbsSyntaxTree: instance Show IOption
- Idris.AbsSyntaxTree: instance Show IState
- Idris.AbsSyntaxTree: instance Show LanguageExt
- Idris.AbsSyntaxTree: instance Show Opt
- Idris.AbsSyntaxTree: instance Show OptInfo
- Idris.AbsSyntaxTree: instance Show Optimisation
- Idris.AbsSyntaxTree: instance Show OutputMode
- Idris.AbsSyntaxTree: instance Show PClause
- Idris.AbsSyntaxTree: instance Show PData
- Idris.AbsSyntaxTree: instance Show PDecl
- Idris.AbsSyntaxTree: instance Show PPOption
- Idris.AbsSyntaxTree: instance Show PTerm
- Idris.AbsSyntaxTree: instance Show Plicity
- Idris.AbsSyntaxTree: instance Show PunInfo
- Idris.AbsSyntaxTree: instance Show RecordInfo
- Idris.AbsSyntaxTree: instance Show SSymbol
- Idris.AbsSyntaxTree: instance Show SizeChange
- Idris.AbsSyntaxTree: instance Show Static
- Idris.AbsSyntaxTree: instance Show SynContext
- Idris.AbsSyntaxTree: instance Show Syntax
- Idris.AbsSyntaxTree: instance Show SyntaxInfo
- Idris.AbsSyntaxTree: instance Show TIData
- Idris.AbsSyntaxTree: instance Show Using
- Idris.AbsSyntaxTree: instance Show t => Show (DSL' t)
- Idris.AbsSyntaxTree: instance Show t => Show (PArg' t)
- Idris.AbsSyntaxTree: instance Show t => Show (PTactic' t)
- Idris.AbsSyntaxTree: instance Show t => Show (ProvideWhat' t)
- Idris.AbsSyntaxTree: instance Sized PTerm
- Idris.AbsSyntaxTree: instance Sized a => Sized (PArg' a)
- Idris.AbsSyntaxTree: instance Sized a => Sized (PDo' a)
- Idris.AbsSyntaxTree: instance Sized a => Sized (PTactic' a)
- Idris.AbsSyntaxTree: instance Traversable PTactic'
- Idris.AbsSyntaxTree: instance Typeable ArgOpt
- Idris.AbsSyntaxTree: instance Typeable PAltType
- Idris.AbsSyntaxTree: instance Typeable PArg'
- Idris.AbsSyntaxTree: instance Typeable PDo'
- Idris.AbsSyntaxTree: instance Typeable PTactic'
- Idris.AbsSyntaxTree: instance Typeable PTerm
- Idris.AbsSyntaxTree: instance Typeable Plicity
- Idris.AbsSyntaxTree: instance Typeable PunInfo
- Idris.AbsSyntaxTree: instance Typeable Static
- Idris.AbsSyntaxTree: instance Typeable Using
- Idris.AbsSyntaxTree: instanceCtorName :: ClassInfo -> Name
- Idris.AbsSyntaxTree: lastParse :: IState -> Maybe Name
- Idris.AbsSyntaxTree: lastTokenSpan :: IState -> Maybe FC
- Idris.AbsSyntaxTree: liftname :: ElabInfo -> Name -> Name
- Idris.AbsSyntaxTree: machine_inf :: PArg' t -> Bool
- Idris.AbsSyntaxTree: maxline :: SyntaxInfo -> Maybe Int
- Idris.AbsSyntaxTree: module_aliases :: IState -> Map [Text] [Text]
- Idris.AbsSyntaxTree: mut_nesting :: SyntaxInfo -> Int
- Idris.AbsSyntaxTree: namespace :: ElabInfo -> Maybe [String]
- Idris.AbsSyntaxTree: new_tyDecls :: EState -> [RDeclInstructions]
- Idris.AbsSyntaxTree: no_imp :: SyntaxInfo -> [Name]
- Idris.AbsSyntaxTree: opt_autoImport :: IOption -> [FilePath]
- Idris.AbsSyntaxTree: opt_autoSolve :: IOption -> Bool
- Idris.AbsSyntaxTree: opt_cmdline :: IOption -> [Opt]
- Idris.AbsSyntaxTree: opt_codegen :: IOption -> Codegen
- Idris.AbsSyntaxTree: opt_coverage :: IOption -> Bool
- Idris.AbsSyntaxTree: opt_cpu :: IOption -> String
- Idris.AbsSyntaxTree: opt_desugarnats :: IOption -> Bool
- Idris.AbsSyntaxTree: opt_errContext :: IOption -> Bool
- Idris.AbsSyntaxTree: opt_evaltypes :: IOption -> Bool
- Idris.AbsSyntaxTree: opt_ibcsubdir :: IOption -> FilePath
- Idris.AbsSyntaxTree: opt_importdirs :: IOption -> [FilePath]
- Idris.AbsSyntaxTree: opt_logLevel :: IOption -> Int
- Idris.AbsSyntaxTree: opt_nobanner :: IOption -> Bool
- Idris.AbsSyntaxTree: opt_optimise :: IOption -> [Optimisation]
- Idris.AbsSyntaxTree: opt_origerr :: IOption -> Bool
- Idris.AbsSyntaxTree: opt_outputTy :: IOption -> OutputType
- Idris.AbsSyntaxTree: opt_printdepth :: IOption -> Maybe Int
- Idris.AbsSyntaxTree: opt_quiet :: IOption -> Bool
- Idris.AbsSyntaxTree: opt_repl :: IOption -> Bool
- Idris.AbsSyntaxTree: opt_showimp :: IOption -> Bool
- Idris.AbsSyntaxTree: opt_triple :: IOption -> String
- Idris.AbsSyntaxTree: opt_typecase :: IOption -> Bool
- Idris.AbsSyntaxTree: opt_typeintype :: IOption -> Bool
- Idris.AbsSyntaxTree: opt_verbose :: IOption -> Bool
- Idris.AbsSyntaxTree: params :: ElabInfo -> [(Name, PTerm)]
- Idris.AbsSyntaxTree: pargopts :: Plicity -> [ArgOpt]
- Idris.AbsSyntaxTree: parserWarnings :: IState -> [(FC, Err)]
- Idris.AbsSyntaxTree: pname :: PArg' t -> Name
- Idris.AbsSyntaxTree: pparam :: Plicity -> Bool
- Idris.AbsSyntaxTree: ppopt_depth :: PPOption -> Maybe Int
- Idris.AbsSyntaxTree: ppopt_desugarnats :: PPOption -> Bool
- Idris.AbsSyntaxTree: ppopt_impl :: PPOption -> Bool
- Idris.AbsSyntaxTree: ppopt_pinames :: PPOption -> Bool
- Idris.AbsSyntaxTree: prec :: Fixity -> Int
- Idris.AbsSyntaxTree: priority :: PArg' t -> Int
- Idris.AbsSyntaxTree: proof_list :: IState -> [(Name, (Bool, [String]))]
- Idris.AbsSyntaxTree: pscoped :: Plicity -> Maybe ImplicitInfo
- Idris.AbsSyntaxTree: pscript :: Plicity -> PTerm
- Idris.AbsSyntaxTree: pstatic :: Plicity -> Static
- Idris.AbsSyntaxTree: rec_elabDecl :: ElabInfo -> ElabWhat -> ElabInfo -> PDecl -> Idris ()
- Idris.AbsSyntaxTree: record_constructor :: RecordInfo -> Name
- Idris.AbsSyntaxTree: record_parameters :: RecordInfo -> [(Name, PTerm)]
- Idris.AbsSyntaxTree: record_projections :: RecordInfo -> [Name]
- Idris.AbsSyntaxTree: scg :: CGInfo -> [SCGEntry]
- Idris.AbsSyntaxTree: syn_in_quasiquote :: SyntaxInfo -> Int
- Idris.AbsSyntaxTree: syn_namespace :: SyntaxInfo -> [String]
- Idris.AbsSyntaxTree: syn_params :: SyntaxInfo -> [(Name, PTerm)]
- Idris.AbsSyntaxTree: syntaxRulesList :: SyntaxRules -> [Syntax]
- Idris.AbsSyntaxTree: syntax_keywords :: IState -> [String]
- Idris.AbsSyntaxTree: syntax_rules :: IState -> SyntaxRules
- Idris.AbsSyntaxTree: tt_ctxt :: IState -> Context
- Idris.AbsSyntaxTree: usedpos :: CGInfo -> [(Int, [UsageReason])]
- Idris.AbsSyntaxTree: using :: SyntaxInfo -> [Using]
- Idris.Apropos: instance (Apropos a, Apropos b) => Apropos (a, b)
- Idris.Apropos: instance Apropos (Binder (TT Name))
- Idris.Apropos: instance Apropos (Docstring a)
- Idris.Apropos: instance Apropos (TT Name)
- Idris.Apropos: instance Apropos Const
- Idris.Apropos: instance Apropos Def
- Idris.Apropos: instance Apropos Name
- Idris.Apropos: instance Apropos a => Apropos (Maybe a)
- Idris.Apropos: instance Apropos a => Apropos [a]
- Idris.Chaser: instance Show ModuleTree
- Idris.Chaser: mod_deps :: ModuleTree -> [ModuleTree]
- Idris.Chaser: mod_needsRecheck :: ModuleTree -> Bool
- Idris.Chaser: mod_path :: ModuleTree -> IFileType
- Idris.Chaser: mod_time :: ModuleTree -> UTCTime
- Idris.Colours: bold :: IdrisColour -> Bool
- Idris.Colours: boundVarColour :: ColourTheme -> IdrisColour
- Idris.Colours: colour :: IdrisColour -> Maybe Color
- Idris.Colours: dataColour :: ColourTheme -> IdrisColour
- Idris.Colours: functionColour :: ColourTheme -> IdrisColour
- Idris.Colours: implicitColour :: ColourTheme -> IdrisColour
- Idris.Colours: instance Bounded ColourType
- Idris.Colours: instance Enum ColourType
- Idris.Colours: instance Eq ColourTheme
- Idris.Colours: instance Eq ColourType
- Idris.Colours: instance Eq IdrisColour
- Idris.Colours: instance Show ColourTheme
- Idris.Colours: instance Show ColourType
- Idris.Colours: instance Show IdrisColour
- Idris.Colours: italic :: IdrisColour -> Bool
- Idris.Colours: keywordColour :: ColourTheme -> IdrisColour
- Idris.Colours: postulateColour :: ColourTheme -> IdrisColour
- Idris.Colours: promptColour :: ColourTheme -> IdrisColour
- Idris.Colours: typeColour :: ColourTheme -> IdrisColour
- Idris.Colours: underline :: IdrisColour -> Bool
- Idris.Colours: vivid :: IdrisColour -> Bool
- Idris.Core.Binary: instance Binary (TT Name)
- Idris.Core.Binary: instance Binary Const
- Idris.Core.Binary: instance Binary ConstraintFC
- Idris.Core.Binary: instance Binary ErrorReportPart
- Idris.Core.Binary: instance Binary FC
- Idris.Core.Binary: instance Binary ImplicitInfo
- Idris.Core.Binary: instance Binary Name
- Idris.Core.Binary: instance Binary NameType
- Idris.Core.Binary: instance Binary Provenance
- Idris.Core.Binary: instance Binary Raw
- Idris.Core.Binary: instance Binary SpecialName
- Idris.Core.Binary: instance Binary UConstraint
- Idris.Core.Binary: instance Binary UExp
- Idris.Core.Binary: instance Binary Universe
- Idris.Core.Binary: instance Binary a => Binary (Err' a)
- Idris.Core.Binary: instance Binary b => Binary (Binder b)
- Idris.Core.CaseTree: instance Eq CaseType
- Idris.Core.CaseTree: instance Eq ConType
- Idris.Core.CaseTree: instance Eq Phase
- Idris.Core.CaseTree: instance Eq t => Eq (CaseAlt' t)
- Idris.Core.CaseTree: instance Eq t => Eq (SC' t)
- Idris.Core.CaseTree: instance Functor CaseAlt'
- Idris.Core.CaseTree: instance Functor SC'
- Idris.Core.CaseTree: instance Ord CaseType
- Idris.Core.CaseTree: instance Ord t => Ord (CaseAlt' t)
- Idris.Core.CaseTree: instance Ord t => Ord (SC' t)
- Idris.Core.CaseTree: instance Show CaseDef
- Idris.Core.CaseTree: instance Show CaseType
- Idris.Core.CaseTree: instance Show ConType
- Idris.Core.CaseTree: instance Show Group
- Idris.Core.CaseTree: instance Show Partition
- Idris.Core.CaseTree: instance Show Pat
- Idris.Core.CaseTree: instance Show Phase
- Idris.Core.CaseTree: instance Show t => Show (CaseAlt' t)
- Idris.Core.CaseTree: instance Show t => Show (SC' t)
- Idris.Core.CaseTree: instance TermSize CaseAlt
- Idris.Core.CaseTree: instance TermSize SC
- Idris.Core.Constraints: instance Eq Domain
- Idris.Core.Constraints: instance Eq Var
- Idris.Core.Constraints: instance Ord Domain
- Idris.Core.Constraints: instance Ord Var
- Idris.Core.Constraints: instance Show Domain
- Idris.Core.Constraints: instance Show Var
- Idris.Core.DeepSeq: instance NFData Accessibility
- Idris.Core.DeepSeq: instance NFData ArithTy
- Idris.Core.DeepSeq: instance NFData CaseDefs
- Idris.Core.DeepSeq: instance NFData CaseInfo
- Idris.Core.DeepSeq: instance NFData Const
- Idris.Core.DeepSeq: instance NFData ConstraintFC
- Idris.Core.DeepSeq: instance NFData Context
- Idris.Core.DeepSeq: instance NFData Def
- Idris.Core.DeepSeq: instance NFData Err
- Idris.Core.DeepSeq: instance NFData ErrorReportPart
- Idris.Core.DeepSeq: instance NFData FC
- Idris.Core.DeepSeq: instance NFData ImplicitInfo
- Idris.Core.DeepSeq: instance NFData IntTy
- Idris.Core.DeepSeq: instance NFData MetaInformation
- Idris.Core.DeepSeq: instance NFData Name
- Idris.Core.DeepSeq: instance NFData NameOutput
- Idris.Core.DeepSeq: instance NFData NameType
- Idris.Core.DeepSeq: instance NFData NativeTy
- Idris.Core.DeepSeq: instance NFData Ordering
- Idris.Core.DeepSeq: instance NFData OutputAnnotation
- Idris.Core.DeepSeq: instance NFData PReason
- Idris.Core.DeepSeq: instance NFData Provenance
- Idris.Core.DeepSeq: instance NFData Raw
- Idris.Core.DeepSeq: instance NFData SpecialName
- Idris.Core.DeepSeq: instance NFData TextFormatting
- Idris.Core.DeepSeq: instance NFData Totality
- Idris.Core.DeepSeq: instance NFData UConstraint
- Idris.Core.DeepSeq: instance NFData UExp
- Idris.Core.DeepSeq: instance NFData Universe
- Idris.Core.DeepSeq: instance NFData b => NFData (Binder b)
- Idris.Core.DeepSeq: instance NFData n => NFData (TT n)
- Idris.Core.DeepSeq: instance NFData t => NFData (CaseAlt' t)
- Idris.Core.DeepSeq: instance NFData t => NFData (SC' t)
- Idris.Core.Elaborate: instance Show aux => Show (ElabState aux)
- Idris.Core.Evaluate: case_alwaysinline :: CaseInfo -> Bool
- Idris.Core.Evaluate: case_inlinable :: CaseInfo -> Bool
- Idris.Core.Evaluate: cases_compiletime :: CaseDefs -> !([Name], SC)
- Idris.Core.Evaluate: cases_inlined :: CaseDefs -> !([Name], SC)
- Idris.Core.Evaluate: cases_runtime :: CaseDefs -> !([Name], SC)
- Idris.Core.Evaluate: cases_totcheck :: CaseDefs -> !([Name], SC)
- Idris.Core.Evaluate: instance Eq Accessibility
- Idris.Core.Evaluate: instance Eq EvalOpt
- Idris.Core.Evaluate: instance Eq MetaInformation
- Idris.Core.Evaluate: instance Eq PReason
- Idris.Core.Evaluate: instance Eq Totality
- Idris.Core.Evaluate: instance Eq Value
- Idris.Core.Evaluate: instance Quote Value
- Idris.Core.Evaluate: instance Show (a -> b)
- Idris.Core.Evaluate: instance Show Accessibility
- Idris.Core.Evaluate: instance Show Context
- Idris.Core.Evaluate: instance Show Def
- Idris.Core.Evaluate: instance Show EvalOpt
- Idris.Core.Evaluate: instance Show EvalState
- Idris.Core.Evaluate: instance Show MetaInformation
- Idris.Core.Evaluate: instance Show PReason
- Idris.Core.Evaluate: instance Show Totality
- Idris.Core.Evaluate: instance Show Value
- Idris.Core.Evaluate: tc_dictionary :: CaseInfo -> Bool
- Idris.Core.ProofState: autos :: ProofState -> [(Name, ([FailContext], [Name]))]
- Idris.Core.ProofState: context :: ProofState -> Context
- Idris.Core.ProofState: datatypes :: ProofState -> Ctxt TypeInfo
- Idris.Core.ProofState: deferred :: ProofState -> [Name]
- Idris.Core.ProofState: done :: ProofState -> Bool
- Idris.Core.ProofState: dontunify :: ProofState -> [Name]
- Idris.Core.ProofState: dotted :: ProofState -> [(Name, [Name])]
- Idris.Core.ProofState: goalType :: Goal -> Binder Term
- Idris.Core.ProofState: holes :: ProofState -> [Name]
- Idris.Core.ProofState: injective :: ProofState -> [Name]
- Idris.Core.ProofState: instance Pretty ProofState OutputAnnotation
- Idris.Core.ProofState: instance Show ProofState
- Idris.Core.ProofState: instance Show Tactic
- Idris.Core.ProofState: instances :: ProofState -> [Name]
- Idris.Core.ProofState: nextname :: ProofState -> Int
- Idris.Core.ProofState: notunified :: ProofState -> [(Name, Term)]
- Idris.Core.ProofState: plog :: ProofState -> String
- Idris.Core.ProofState: premises :: Goal -> Env
- Idris.Core.ProofState: previous :: ProofState -> Maybe ProofState
- Idris.Core.ProofState: problems :: ProofState -> Fails
- Idris.Core.ProofState: psnames :: ProofState -> [Name]
- Idris.Core.ProofState: pterm :: ProofState -> ProofTerm
- Idris.Core.ProofState: ptype :: ProofState -> Type
- Idris.Core.ProofState: recents :: ProofState -> [Name]
- Idris.Core.ProofState: solved :: ProofState -> Maybe (Name, Term)
- Idris.Core.ProofState: thname :: ProofState -> Name
- Idris.Core.ProofState: unified :: ProofState -> (Name, [(Name, Term)])
- Idris.Core.ProofState: unifylog :: ProofState -> Bool
- Idris.Core.ProofState: usedns :: ProofState -> [Name]
- Idris.Core.ProofState: while_elaborating :: ProofState -> [FailContext]
- Idris.Core.ProofTerm: goalType :: Goal -> Binder Term
- Idris.Core.ProofTerm: instance Show BinderPath
- Idris.Core.ProofTerm: instance Show ProofTerm
- Idris.Core.ProofTerm: instance Show TermPath
- Idris.Core.ProofTerm: premises :: Goal -> Env
- Idris.Core.TT: NErased :: Name
- Idris.Core.TT: RForce :: Raw -> Raw
- Idris.Core.TT: _fc_end :: FC -> (Int, Int)
- Idris.Core.TT: _fc_fname :: FC -> String
- Idris.Core.TT: _fc_start :: FC -> (Int, Int)
- Idris.Core.TT: binderImpl :: Binder b -> Maybe ImplicitInfo
- Idris.Core.TT: binderKind :: Binder b -> !b
- Idris.Core.TT: binderTy :: Binder b -> !b
- Idris.Core.TT: binderVal :: Binder b -> b
- Idris.Core.TT: codata :: TypeInfo -> Bool
- Idris.Core.TT: con_names :: TypeInfo -> [Name]
- Idris.Core.TT: d_cons :: Datatype n -> [(n, TT n)]
- Idris.Core.TT: d_type :: Datatype n -> (TT n)
- Idris.Core.TT: d_typename :: Datatype n -> n
- Idris.Core.TT: d_typetag :: Datatype n -> Int
- Idris.Core.TT: d_unique :: Datatype n -> Bool
- Idris.Core.TT: data_opts :: TypeInfo -> DataOpts
- Idris.Core.TT: envlen :: Binder b -> Int
- Idris.Core.TT: instance (Eq n, Show n) => Show (Datatype n)
- Idris.Core.TT: instance (Eq n, Show n) => Show (TT n)
- Idris.Core.TT: instance Alternative TC
- Idris.Core.TT: instance Applicative TC
- Idris.Core.TT: instance Data ArithTy
- Idris.Core.TT: instance Data Const
- Idris.Core.TT: instance Data ConstraintFC
- Idris.Core.TT: instance Data ErrorReportPart
- Idris.Core.TT: instance Data FC
- Idris.Core.TT: instance Data ImplicitInfo
- Idris.Core.TT: instance Data IntTy
- Idris.Core.TT: instance Data Name
- Idris.Core.TT: instance Data NameType
- Idris.Core.TT: instance Data NativeTy
- Idris.Core.TT: instance Data Provenance
- Idris.Core.TT: instance Data Raw
- Idris.Core.TT: instance Data SpecialName
- Idris.Core.TT: instance Data UConstraint
- Idris.Core.TT: instance Data UExp
- Idris.Core.TT: instance Data Universe
- Idris.Core.TT: instance Data b => Data (Binder b)
- Idris.Core.TT: instance Data n => Data (AppStatus n)
- Idris.Core.TT: instance Data n => Data (TT n)
- Idris.Core.TT: instance Data t => Data (Err' t)
- Idris.Core.TT: instance Enum NativeTy
- Idris.Core.TT: instance Eq ArithTy
- Idris.Core.TT: instance Eq Const
- Idris.Core.TT: instance Eq ConstraintFC
- Idris.Core.TT: instance Eq DataOpt
- Idris.Core.TT: instance Eq ErrorReportPart
- Idris.Core.TT: instance Eq FC
- Idris.Core.TT: instance Eq FC'
- Idris.Core.TT: instance Eq ImplicitInfo
- Idris.Core.TT: instance Eq IntTy
- Idris.Core.TT: instance Eq Name
- Idris.Core.TT: instance Eq NameOutput
- Idris.Core.TT: instance Eq NameType
- Idris.Core.TT: instance Eq NativeTy
- Idris.Core.TT: instance Eq Option
- Idris.Core.TT: instance Eq OutputAnnotation
- Idris.Core.TT: instance Eq Provenance
- Idris.Core.TT: instance Eq Raw
- Idris.Core.TT: instance Eq SpecialName
- Idris.Core.TT: instance Eq TextFormatting
- Idris.Core.TT: instance Eq UConstraint
- Idris.Core.TT: instance Eq UExp
- Idris.Core.TT: instance Eq Universe
- Idris.Core.TT: instance Eq a => Eq (TC a)
- Idris.Core.TT: instance Eq b => Eq (Binder b)
- Idris.Core.TT: instance Eq n => Eq (AppStatus n)
- Idris.Core.TT: instance Eq n => Eq (Datatype n)
- Idris.Core.TT: instance Eq n => Eq (TT n)
- Idris.Core.TT: instance Eq t => Eq (Err' t)
- Idris.Core.TT: instance Foldable Binder
- Idris.Core.TT: instance Functor AppStatus
- Idris.Core.TT: instance Functor Binder
- Idris.Core.TT: instance Functor Datatype
- Idris.Core.TT: instance Functor Err'
- Idris.Core.TT: instance Functor TC
- Idris.Core.TT: instance Functor TT
- Idris.Core.TT: instance Monad TC
- Idris.Core.TT: instance MonadPlus TC
- Idris.Core.TT: instance Ord ArithTy
- Idris.Core.TT: instance Ord Const
- Idris.Core.TT: instance Ord ConstraintFC
- Idris.Core.TT: instance Ord FC
- Idris.Core.TT: instance Ord ImplicitInfo
- Idris.Core.TT: instance Ord IntTy
- Idris.Core.TT: instance Ord Name
- Idris.Core.TT: instance Ord NameType
- Idris.Core.TT: instance Ord NativeTy
- Idris.Core.TT: instance Ord SpecialName
- Idris.Core.TT: instance Ord UConstraint
- Idris.Core.TT: instance Ord UExp
- Idris.Core.TT: instance Ord Universe
- Idris.Core.TT: instance Ord b => Ord (Binder b)
- Idris.Core.TT: instance Ord n => Ord (AppStatus n)
- Idris.Core.TT: instance Ord n => Ord (TT n)
- Idris.Core.TT: instance Pretty ArithTy OutputAnnotation
- Idris.Core.TT: instance Pretty Const OutputAnnotation
- Idris.Core.TT: instance Pretty Err OutputAnnotation
- Idris.Core.TT: instance Pretty Name OutputAnnotation
- Idris.Core.TT: instance Pretty NameType OutputAnnotation
- Idris.Core.TT: instance Pretty NativeTy OutputAnnotation
- Idris.Core.TT: instance Pretty Raw OutputAnnotation
- Idris.Core.TT: instance Pretty [Name] OutputAnnotation
- Idris.Core.TT: instance Pretty a OutputAnnotation => Pretty (TC a) OutputAnnotation
- Idris.Core.TT: instance Pretty a o => Pretty (TT a) o
- Idris.Core.TT: instance Show ArithTy
- Idris.Core.TT: instance Show Const
- Idris.Core.TT: instance Show ConstraintFC
- Idris.Core.TT: instance Show DataOpt
- Idris.Core.TT: instance Show Err
- Idris.Core.TT: instance Show ErrorReportPart
- Idris.Core.TT: instance Show FC
- Idris.Core.TT: instance Show ImplicitInfo
- Idris.Core.TT: instance Show IntTy
- Idris.Core.TT: instance Show Name
- Idris.Core.TT: instance Show NameOutput
- Idris.Core.TT: instance Show NameType
- Idris.Core.TT: instance Show NativeTy
- Idris.Core.TT: instance Show OutputAnnotation
- Idris.Core.TT: instance Show Provenance
- Idris.Core.TT: instance Show Raw
- Idris.Core.TT: instance Show SpecialName
- Idris.Core.TT: instance Show TextFormatting
- Idris.Core.TT: instance Show TypeInfo
- Idris.Core.TT: instance Show UConstraint
- Idris.Core.TT: instance Show UExp
- Idris.Core.TT: instance Show Universe
- Idris.Core.TT: instance Show a => Show (TC a)
- Idris.Core.TT: instance Show b => Show (Binder b)
- Idris.Core.TT: instance Show n => Show (AppStatus n)
- Idris.Core.TT: instance Sized Const
- Idris.Core.TT: instance Sized Err
- Idris.Core.TT: instance Sized ErrorReportPart
- Idris.Core.TT: instance Sized FC
- Idris.Core.TT: instance Sized Name
- Idris.Core.TT: instance Sized NameType
- Idris.Core.TT: instance Sized Raw
- Idris.Core.TT: instance Sized UExp
- Idris.Core.TT: instance Sized Universe
- Idris.Core.TT: instance Sized a => Sized (Binder a)
- Idris.Core.TT: instance Sized a => Sized (TT a)
- Idris.Core.TT: instance TermSize (TT Name)
- Idris.Core.TT: instance TermSize a => TermSize [a]
- Idris.Core.TT: instance Traversable Binder
- Idris.Core.TT: instance Typeable AppStatus
- Idris.Core.TT: instance Typeable ArithTy
- Idris.Core.TT: instance Typeable Binder
- Idris.Core.TT: instance Typeable Const
- Idris.Core.TT: instance Typeable ConstraintFC
- Idris.Core.TT: instance Typeable Err'
- Idris.Core.TT: instance Typeable ErrorReportPart
- Idris.Core.TT: instance Typeable FC
- Idris.Core.TT: instance Typeable ImplicitInfo
- Idris.Core.TT: instance Typeable IntTy
- Idris.Core.TT: instance Typeable Name
- Idris.Core.TT: instance Typeable NameType
- Idris.Core.TT: instance Typeable NativeTy
- Idris.Core.TT: instance Typeable Provenance
- Idris.Core.TT: instance Typeable Raw
- Idris.Core.TT: instance Typeable SpecialName
- Idris.Core.TT: instance Typeable TT
- Idris.Core.TT: instance Typeable UConstraint
- Idris.Core.TT: instance Typeable UExp
- Idris.Core.TT: instance Typeable Universe
- Idris.Core.TT: localnames :: Binder b -> [Name]
- Idris.Core.TT: mutual_types :: TypeInfo -> [Name]
- Idris.Core.TT: nt_arity :: NameType -> Int
- Idris.Core.TT: nt_tag :: NameType -> Int
- Idris.Core.TT: nt_unique :: NameType -> Bool
- Idris.Core.TT: param_pos :: TypeInfo -> [Int]
- Idris.Core.TT: tcinstance :: ImplicitInfo -> Bool
- Idris.Core.TT: uconstraint :: ConstraintFC -> UConstraint
- Idris.Core.TT: ufc :: ConstraintFC -> FC
- Idris.Core.TT: unwrapFC :: FC' -> FC
- Idris.Core.Typecheck: instance Eq UniqueUse
- Idris.Core.Unify: fail_fn :: FailContext -> Name
- Idris.Core.Unify: fail_param :: FailContext -> Name
- Idris.Core.Unify: fail_sourceloc :: FailContext -> FC
- Idris.Core.Unify: instance Eq FailAt
- Idris.Core.Unify: instance Eq FailContext
- Idris.Core.Unify: instance Show FailAt
- Idris.Core.Unify: instance Show FailContext
- Idris.Core.Unify: instance Show UInfo
- Idris.Core.WHNF: instance Show WEnv
- Idris.Coverage: instance Show Guardedness
- Idris.DataOpts: instance (Optimisable a, Optimisable b) => Optimisable (a, b)
- Idris.DataOpts: instance (Optimisable a, Optimisable b) => Optimisable (vs, a, b)
- Idris.DataOpts: instance Optimisable (Binder (TT Name))
- Idris.DataOpts: instance Optimisable (Binder Raw)
- Idris.DataOpts: instance Optimisable (TT Name)
- Idris.DataOpts: instance Optimisable Raw
- Idris.DataOpts: instance Optimisable a => Optimisable (Either a (a, a))
- Idris.DataOpts: instance Optimisable a => Optimisable [a]
- Idris.DeepSeq: instance NFData ArgOpt
- Idris.DeepSeq: instance NFData CGInfo
- Idris.DeepSeq: instance NFData ClassInfo
- Idris.DeepSeq: instance NFData CodeAttr
- Idris.DeepSeq: instance NFData Codegen
- Idris.DeepSeq: instance NFData ColourTheme
- Idris.DeepSeq: instance NFData ConsoleWidth
- Idris.DeepSeq: instance NFData DataOpt
- Idris.DeepSeq: instance NFData DocTerm
- Idris.DeepSeq: instance NFData DynamicLib
- Idris.DeepSeq: instance NFData FixDecl
- Idris.DeepSeq: instance NFData Fixity
- Idris.DeepSeq: instance NFData FnInfo
- Idris.DeepSeq: instance NFData FnOpt
- Idris.DeepSeq: instance NFData IBCWrite
- Idris.DeepSeq: instance NFData IOption
- Idris.DeepSeq: instance NFData IState
- Idris.DeepSeq: instance NFData IdrisColour
- Idris.DeepSeq: instance NFData LanguageExt
- Idris.DeepSeq: instance NFData ListType
- Idris.DeepSeq: instance NFData NumWrapper
- Idris.DeepSeq: instance NFData Opt
- Idris.DeepSeq: instance NFData OptInfo
- Idris.DeepSeq: instance NFData Optimisation
- Idris.DeepSeq: instance NFData Options
- Idris.DeepSeq: instance NFData OutputMode
- Idris.DeepSeq: instance NFData OutputType
- Idris.DeepSeq: instance NFData PAltType
- Idris.DeepSeq: instance NFData PTerm
- Idris.DeepSeq: instance NFData Plicity
- Idris.DeepSeq: instance NFData PrimFn
- Idris.DeepSeq: instance NFData PunInfo
- Idris.DeepSeq: instance NFData RecordInfo
- Idris.DeepSeq: instance NFData SSymbol
- Idris.DeepSeq: instance NFData SizeChange
- Idris.DeepSeq: instance NFData Static
- Idris.DeepSeq: instance NFData SynContext
- Idris.DeepSeq: instance NFData Syntax
- Idris.DeepSeq: instance NFData SyntaxInfo
- Idris.DeepSeq: instance NFData SyntaxRules
- Idris.DeepSeq: instance NFData TIData
- Idris.DeepSeq: instance NFData TypeInfo
- Idris.DeepSeq: instance NFData Using
- Idris.DeepSeq: instance NFData a => NFData (Block a)
- Idris.DeepSeq: instance NFData a => NFData (Docstring a)
- Idris.DeepSeq: instance NFData a => NFData (Inline a)
- Idris.DeepSeq: instance NFData t => NFData (DSL' t)
- Idris.DeepSeq: instance NFData t => NFData (PArg' t)
- Idris.DeepSeq: instance NFData t => NFData (PClause' t)
- Idris.DeepSeq: instance NFData t => NFData (PData' t)
- Idris.DeepSeq: instance NFData t => NFData (PDecl' t)
- Idris.DeepSeq: instance NFData t => NFData (PDo' t)
- Idris.DeepSeq: instance NFData t => NFData (PTactic' t)
- Idris.DeepSeq: instance NFData t => NFData (ProvideWhat' t)
- Idris.Docs: instance Functor Docs'
- Idris.Docs: instance Functor FunDoc'
- Idris.Docstrings: instance Foldable Block
- Idris.Docstrings: instance Foldable Docstring
- Idris.Docstrings: instance Foldable Inline
- Idris.Docstrings: instance Functor Block
- Idris.Docstrings: instance Functor Docstring
- Idris.Docstrings: instance Functor Inline
- Idris.Docstrings: instance Show DocTerm
- Idris.Docstrings: instance Show a => Show (Block a)
- Idris.Docstrings: instance Show a => Show (Docstring a)
- Idris.Docstrings: instance Show a => Show (Inline a)
- Idris.Docstrings: instance Traversable Block
- Idris.Docstrings: instance Traversable Docstring
- Idris.Docstrings: instance Traversable Inline
- Idris.Elab.Class: instance Show MArgTy
- Idris.Elab.Term: e_guarded :: ElabCtxt -> Bool
- Idris.Elab.Term: e_inarg :: ElabCtxt -> Bool
- Idris.Elab.Term: e_intype :: ElabCtxt -> Bool
- Idris.Elab.Term: e_isfn :: ElabCtxt -> Bool
- Idris.Elab.Term: e_nomatching :: ElabCtxt -> Bool
- Idris.Elab.Term: e_qq :: ElabCtxt -> Bool
- Idris.Elab.Term: instance Eq ElabMode
- Idris.Elab.Term: resultCaseDecls :: ElabResult -> [PDecl]
- Idris.Elab.Term: resultContext :: ElabResult -> Context
- Idris.Elab.Term: resultHighlighting :: ElabResult -> [(FC, OutputAnnotation)]
- Idris.Elab.Term: resultMetavars :: ElabResult -> [(Name, (Int, Maybe Name, Type, [Name]))]
- Idris.Elab.Term: resultTerm :: ElabResult -> Term
- Idris.Elab.Term: resultTyDecls :: ElabResult -> [RDeclInstructions]
- Idris.Erasure: instance Eq Arg
- Idris.Erasure: instance Ord Arg
- Idris.Erasure: instance Show Arg
- Idris.Erasure: instance Show VarInfo
- Idris.Help: instance Show CmdArg
- Idris.IBC: instance Binary Accessibility
- Idris.IBC: instance Binary ArgOpt
- Idris.IBC: instance Binary CGInfo
- Idris.IBC: instance Binary CaseAlt
- Idris.IBC: instance Binary CaseDefs
- Idris.IBC: instance Binary CaseInfo
- Idris.IBC: instance Binary CaseType
- Idris.IBC: instance Binary ClassInfo
- Idris.IBC: instance Binary CodeAttr
- Idris.IBC: instance Binary Codegen
- Idris.IBC: instance Binary DataOpt
- Idris.IBC: instance Binary Def
- Idris.IBC: instance Binary DocTerm
- Idris.IBC: instance Binary FixDecl
- Idris.IBC: instance Binary Fixity
- Idris.IBC: instance Binary FnInfo
- Idris.IBC: instance Binary FnOpt
- Idris.IBC: instance Binary ListType
- Idris.IBC: instance Binary MetaInformation
- Idris.IBC: instance Binary NumWrapper
- Idris.IBC: instance Binary OptInfo
- Idris.IBC: instance Binary Options
- Idris.IBC: instance Binary PAltType
- Idris.IBC: instance Binary PReason
- Idris.IBC: instance Binary PTerm
- Idris.IBC: instance Binary Plicity
- Idris.IBC: instance Binary PunInfo
- Idris.IBC: instance Binary RecordInfo
- Idris.IBC: instance Binary SC
- Idris.IBC: instance Binary SSymbol
- Idris.IBC: instance Binary SizeChange
- Idris.IBC: instance Binary Static
- Idris.IBC: instance Binary SynContext
- Idris.IBC: instance Binary Syntax
- Idris.IBC: instance Binary SyntaxInfo
- Idris.IBC: instance Binary Totality
- Idris.IBC: instance Binary TypeInfo
- Idris.IBC: instance Binary Using
- Idris.IBC: instance Binary a => Binary (Block a)
- Idris.IBC: instance Binary a => Binary (Docstring a)
- Idris.IBC: instance Binary a => Binary (Inline a)
- Idris.IBC: instance Binary t => Binary (DSL' t)
- Idris.IBC: instance Binary t => Binary (PArg' t)
- Idris.IBC: instance Binary t => Binary (PClause' t)
- Idris.IBC: instance Binary t => Binary (PData' t)
- Idris.IBC: instance Binary t => Binary (PDecl' t)
- Idris.IBC: instance Binary t => Binary (PDo' t)
- Idris.IBC: instance Binary t => Binary (PTactic' t)
- Idris.IBC: instance Binary t => Binary (ProvideWhat' t)
- Idris.IBC: instance Show IBCFile
- Idris.IdeMode: instance [incoherent] (SExpable a, SExpable b) => SExpable (a, b)
- Idris.IdeMode: instance [incoherent] (SExpable a, SExpable b, SExpable c) => SExpable (a, b, c)
- Idris.IdeMode: instance [incoherent] (SExpable a, SExpable b, SExpable c, SExpable d) => SExpable (a, b, c, d)
- Idris.IdeMode: instance [incoherent] (SExpable a, SExpable b, SExpable c, SExpable d, SExpable e) => SExpable (a, b, c, d, e)
- Idris.IdeMode: instance [incoherent] Eq SExp
- Idris.IdeMode: instance [incoherent] SExpable Bool
- Idris.IdeMode: instance [incoherent] SExpable FC
- Idris.IdeMode: instance [incoherent] SExpable Int
- Idris.IdeMode: instance [incoherent] SExpable Integer
- Idris.IdeMode: instance [incoherent] SExpable Name
- Idris.IdeMode: instance [incoherent] SExpable NameOutput
- Idris.IdeMode: instance [incoherent] SExpable OutputAnnotation
- Idris.IdeMode: instance [incoherent] SExpable SExp
- Idris.IdeMode: instance [incoherent] SExpable String
- Idris.IdeMode: instance [incoherent] SExpable a => SExpable (Maybe a)
- Idris.IdeMode: instance [incoherent] SExpable a => SExpable [a]
- Idris.IdeMode: instance [incoherent] Show Opt
- Idris.IdeMode: instance [incoherent] Show SExp
- Idris.Imports: instance Eq IFileType
- Idris.Imports: instance Show IFileType
- Idris.Output: instance MonadException m => MonadException (ExceptT Err m)
- Idris.ParseExpr: instance Show SynMatch
- Idris.ParseHelpers: instance [overlap ok] Alternative IdrisInnerParser
- Idris.ParseHelpers: instance [overlap ok] Applicative IdrisInnerParser
- Idris.ParseHelpers: instance [overlap ok] CharParsing IdrisInnerParser
- Idris.ParseHelpers: instance [overlap ok] DeltaParsing IdrisInnerParser
- Idris.ParseHelpers: instance [overlap ok] Functor IdrisInnerParser
- Idris.ParseHelpers: instance [overlap ok] HasLastTokenSpan IdrisParser
- Idris.ParseHelpers: instance [overlap ok] LookAheadParsing IdrisInnerParser
- Idris.ParseHelpers: instance [overlap ok] MarkParsing Delta IdrisInnerParser
- Idris.ParseHelpers: instance [overlap ok] Monad IdrisInnerParser
- Idris.ParseHelpers: instance [overlap ok] MonadPlus IdrisInnerParser
- Idris.ParseHelpers: instance [overlap ok] Monoid a => Monoid (IdrisInnerParser a)
- Idris.ParseHelpers: instance [overlap ok] Parsing IdrisInnerParser
- Idris.ParseHelpers: instance [overlap ok] TokenParsing IdrisInnerParser
- Idris.ParseHelpers: instance [overlap ok] TokenParsing IdrisParser
- Idris.ParseHelpers: runInnerParser :: IdrisInnerParser a -> Parser a
- Idris.Parser: import_location :: ImportInfo -> FC
- Idris.Parser: import_modname_location :: ImportInfo -> FC
- Idris.Parser: import_namespace :: ImportInfo -> [Text]
- Idris.Parser: import_path :: ImportInfo -> FilePath
- Idris.Parser: import_reexport :: ImportInfo -> Bool
- Idris.Parser: import_rename :: ImportInfo -> Maybe (String, FC)
- Idris.PartialEval: instance Eq PEArgType
- Idris.PartialEval: instance Show PEArgType
- Idris.Primitives: p_arity :: Prim -> Int
- Idris.Primitives: p_def :: Prim -> [Const] -> Maybe Const
- Idris.Primitives: p_lexp :: Prim -> (Int, PrimFn)
- Idris.Primitives: p_name :: Prim -> Name
- Idris.Primitives: p_total :: Prim -> Totality
- Idris.Primitives: p_type :: Prim -> Type
- Idris.Providers: instance Eq a => Eq (Provided a)
- Idris.Providers: instance Functor Provided
- Idris.Providers: instance Show a => Show (Provided a)
- Idris.Reflection: argName :: RFunArg -> Name
- Idris.Reflection: argPlicity :: RFunArg -> RPlicity
- Idris.Reflection: argTy :: RFunArg -> Raw
- Idris.Reflection: erasure :: RFunArg -> RErasure
- Idris.Reflection: instance Show RCtorArg
- Idris.Reflection: instance Show RDatatype
- Idris.Reflection: instance Show RErasure
- Idris.Reflection: instance Show RFunArg
- Idris.Reflection: instance Show RFunClause
- Idris.Reflection: instance Show RFunDefn
- Idris.Reflection: instance Show RPlicity
- Idris.Reflection: instance Show RTyConArg
- Idris.Reflection: instance Show RTyDecl
- Idris.TypeSearch: instance Eq AsymMods
- Idris.TypeSearch: instance Eq Score
- Idris.TypeSearch: instance Eq a => Eq (Sided a)
- Idris.TypeSearch: instance Monoid AsymMods
- Idris.TypeSearch: instance Monoid Score
- Idris.TypeSearch: instance Monoid a => Monoid (Sided a)
- Idris.TypeSearch: instance Ord Score
- Idris.TypeSearch: instance Show AsymMods
- Idris.TypeSearch: instance Show Score
- Idris.TypeSearch: instance Show State
- Idris.TypeSearch: instance Show a => Show (Sided a)
- Util.DynamicLinker: fun_handle :: ForeignFun -> ()
- Util.DynamicLinker: fun_name :: ForeignFun -> String
- Util.DynamicLinker: instance Eq DynamicLib
- Util.DynamicLinker: lib_handle :: DynamicLib -> ()
- Util.DynamicLinker: lib_name :: DynamicLib -> String
+ IRTS.Bytecode: instance GHC.Classes.Eq IRTS.Bytecode.Reg
+ IRTS.Bytecode: instance GHC.Show.Show IRTS.Bytecode.BC
+ IRTS.Bytecode: instance GHC.Show.Show IRTS.Bytecode.Reg
+ IRTS.CodegenCommon: [compileLibs] :: CodegenInfo -> [String]
+ IRTS.CodegenCommon: [compileObjs] :: CodegenInfo -> [String]
+ IRTS.CodegenCommon: [compilerFlags] :: CodegenInfo -> [String]
+ IRTS.CodegenCommon: [debugLevel] :: CodegenInfo -> DbgLevel
+ IRTS.CodegenCommon: [defunDecls] :: CodegenInfo -> [(Name, DDecl)]
+ IRTS.CodegenCommon: [exportDecls] :: CodegenInfo -> [ExportIFace]
+ IRTS.CodegenCommon: [importDirs] :: CodegenInfo -> [FilePath]
+ IRTS.CodegenCommon: [includes] :: CodegenInfo -> [FilePath]
+ IRTS.CodegenCommon: [interfaces] :: CodegenInfo -> Bool
+ IRTS.CodegenCommon: [liftDecls] :: CodegenInfo -> [(Name, LDecl)]
+ IRTS.CodegenCommon: [outputFile] :: CodegenInfo -> String
+ IRTS.CodegenCommon: [outputType] :: CodegenInfo -> OutputType
+ IRTS.CodegenCommon: [simpleDecls] :: CodegenInfo -> [(Name, SDecl)]
+ IRTS.CodegenCommon: [targetCPU] :: CodegenInfo -> String
+ IRTS.CodegenCommon: [targetTriple] :: CodegenInfo -> String
+ IRTS.CodegenCommon: instance GHC.Classes.Eq IRTS.CodegenCommon.DbgLevel
+ IRTS.CodegenCommon: instance GHC.Classes.Eq IRTS.CodegenCommon.OutputType
+ IRTS.CodegenCommon: instance GHC.Show.Show IRTS.CodegenCommon.OutputType
+ IRTS.CodegenJavaScript: instance GHC.Classes.Eq IRTS.CodegenJavaScript.JSTarget
+ IRTS.Compiler: instance GHC.Show.Show IRTS.Compiler.VarInfo
+ IRTS.Defunctionalise: instance GHC.Classes.Eq IRTS.Defunctionalise.DAlt
+ IRTS.Defunctionalise: instance GHC.Classes.Eq IRTS.Defunctionalise.DDecl
+ IRTS.Defunctionalise: instance GHC.Classes.Eq IRTS.Defunctionalise.DExp
+ IRTS.Defunctionalise: instance GHC.Show.Show IRTS.Defunctionalise.DAlt
+ IRTS.Defunctionalise: instance GHC.Show.Show IRTS.Defunctionalise.DDecl
+ IRTS.Defunctionalise: instance GHC.Show.Show IRTS.Defunctionalise.DExp
+ IRTS.JavaScript.AST: instance GHC.Classes.Eq IRTS.JavaScript.AST.JS
+ IRTS.JavaScript.AST: instance GHC.Classes.Eq IRTS.JavaScript.AST.JSAnnotation
+ IRTS.JavaScript.AST: instance GHC.Classes.Eq IRTS.JavaScript.AST.JSInteger
+ IRTS.JavaScript.AST: instance GHC.Classes.Eq IRTS.JavaScript.AST.JSNum
+ IRTS.JavaScript.AST: instance GHC.Classes.Eq IRTS.JavaScript.AST.JSType
+ IRTS.JavaScript.AST: instance GHC.Classes.Eq IRTS.JavaScript.AST.JSWord
+ IRTS.JavaScript.AST: instance GHC.Show.Show IRTS.JavaScript.AST.JSAnnotation
+ IRTS.Lang: instance GHC.Base.Functor IRTS.Lang.LAlt'
+ IRTS.Lang: instance GHC.Classes.Eq IRTS.Lang.Endianness
+ IRTS.Lang: instance GHC.Classes.Eq IRTS.Lang.Export
+ IRTS.Lang: instance GHC.Classes.Eq IRTS.Lang.ExportIFace
+ IRTS.Lang: instance GHC.Classes.Eq IRTS.Lang.FCallType
+ IRTS.Lang: instance GHC.Classes.Eq IRTS.Lang.FDesc
+ IRTS.Lang: instance GHC.Classes.Eq IRTS.Lang.FType
+ IRTS.Lang: instance GHC.Classes.Eq IRTS.Lang.LDecl
+ IRTS.Lang: instance GHC.Classes.Eq IRTS.Lang.LExp
+ IRTS.Lang: instance GHC.Classes.Eq IRTS.Lang.LOpt
+ IRTS.Lang: instance GHC.Classes.Eq IRTS.Lang.LVar
+ IRTS.Lang: instance GHC.Classes.Eq IRTS.Lang.PrimFn
+ IRTS.Lang: instance GHC.Classes.Eq e => GHC.Classes.Eq (IRTS.Lang.LAlt' e)
+ IRTS.Lang: instance GHC.Show.Show IRTS.Lang.Endianness
+ IRTS.Lang: instance GHC.Show.Show IRTS.Lang.Export
+ IRTS.Lang: instance GHC.Show.Show IRTS.Lang.ExportIFace
+ IRTS.Lang: instance GHC.Show.Show IRTS.Lang.FCallType
+ IRTS.Lang: instance GHC.Show.Show IRTS.Lang.FDesc
+ IRTS.Lang: instance GHC.Show.Show IRTS.Lang.FType
+ IRTS.Lang: instance GHC.Show.Show IRTS.Lang.LDecl
+ IRTS.Lang: instance GHC.Show.Show IRTS.Lang.LExp
+ IRTS.Lang: instance GHC.Show.Show IRTS.Lang.LOpt
+ IRTS.Lang: instance GHC.Show.Show IRTS.Lang.LVar
+ IRTS.Lang: instance GHC.Show.Show IRTS.Lang.PrimFn
+ IRTS.Lang: instance GHC.Show.Show e => GHC.Show.Show (IRTS.Lang.LAlt' e)
+ IRTS.Simplified: instance GHC.Show.Show IRTS.Simplified.SAlt
+ IRTS.Simplified: instance GHC.Show.Show IRTS.Simplified.SDecl
+ IRTS.Simplified: instance GHC.Show.Show IRTS.Simplified.SExp
+ Idris.ASTUtils: instance Control.Category.Category Idris.ASTUtils.Field
+ Idris.AbsSyntax: addDeprecated :: Name -> String -> Idris ()
+ Idris.AbsSyntax: getDeprecated :: Name -> Idris (Maybe String)
+ Idris.AbsSyntax: instance GHC.Base.Applicative (Idris.AbsSyntax.EitherErr a)
+ Idris.AbsSyntax: instance GHC.Base.Functor (Idris.AbsSyntax.EitherErr a)
+ Idris.AbsSyntax: instance GHC.Base.Monad (Idris.AbsSyntax.EitherErr a)
+ Idris.AbsSyntaxTree: DDeprecate :: Name -> String -> Directive
+ Idris.AbsSyntaxTree: IBCDeprecate :: Name -> String -> IBCWrite
+ Idris.AbsSyntaxTree: NoElimDeprecationWarnings :: Opt
+ Idris.AbsSyntaxTree: NoOldTacticDeprecationWarnings :: Opt
+ Idris.AbsSyntaxTree: [argopts] :: PArg' t -> [ArgOpt]
+ Idris.AbsSyntaxTree: [argsdef] :: CGInfo -> [Name]
+ Idris.AbsSyntaxTree: [argsused] :: CGInfo -> [Name]
+ Idris.AbsSyntaxTree: [brace_stack] :: IState -> [Maybe Int]
+ Idris.AbsSyntaxTree: [calls] :: CGInfo -> [(Name, [[Name]])]
+ Idris.AbsSyntaxTree: [case_decls] :: EState -> [(Name, PDecl)]
+ Idris.AbsSyntaxTree: [class_default_superclasses] :: ClassInfo -> [PDecl]
+ Idris.AbsSyntaxTree: [class_defaults] :: ClassInfo -> [(Name, (Name, PDecl))]
+ Idris.AbsSyntaxTree: [class_determiners] :: ClassInfo -> [Int]
+ Idris.AbsSyntaxTree: [class_instances] :: ClassInfo -> [(Name, Bool)]
+ Idris.AbsSyntaxTree: [class_methods] :: ClassInfo -> [(Name, (FnOpts, PTerm))]
+ Idris.AbsSyntaxTree: [class_params] :: ClassInfo -> [Name]
+ Idris.AbsSyntaxTree: [compiled_so] :: IState -> Maybe String
+ Idris.AbsSyntaxTree: [d_cons] :: PData' t -> [(Docstring (Either Err PTerm), [(Name, Docstring (Either Err PTerm))], Name, FC, t, FC, [Name])]
+ Idris.AbsSyntaxTree: [d_name] :: PData' t -> Name
+ Idris.AbsSyntaxTree: [d_name_fc] :: PData' t -> FC
+ Idris.AbsSyntaxTree: [d_tcon] :: PData' t -> t
+ Idris.AbsSyntaxTree: [decoration] :: SyntaxInfo -> Name -> Name
+ Idris.AbsSyntaxTree: [default_access] :: IState -> Accessibility
+ Idris.AbsSyntaxTree: [default_total] :: IState -> Bool
+ Idris.AbsSyntaxTree: [delayed_elab] :: EState -> [(Int, Elab' EState ())]
+ Idris.AbsSyntaxTree: [detaggable] :: OptInfo -> Bool
+ Idris.AbsSyntaxTree: [dsl_apply] :: DSL' t -> t
+ Idris.AbsSyntaxTree: [dsl_bind] :: DSL' t -> t
+ Idris.AbsSyntaxTree: [dsl_info] :: SyntaxInfo -> DSL
+ Idris.AbsSyntaxTree: [dsl_lambda] :: DSL' t -> Maybe t
+ Idris.AbsSyntaxTree: [dsl_let] :: DSL' t -> Maybe t
+ Idris.AbsSyntaxTree: [dsl_pi] :: DSL' t -> Maybe t
+ Idris.AbsSyntaxTree: [dsl_pure] :: DSL' t -> t
+ Idris.AbsSyntaxTree: [dsl_return] :: DSL' t -> t
+ Idris.AbsSyntaxTree: [dsl_var] :: DSL' t -> Maybe t
+ Idris.AbsSyntaxTree: [elabFC] :: ElabInfo -> Maybe FC
+ Idris.AbsSyntaxTree: [elab_stack] :: IState -> [(Name, Bool)]
+ Idris.AbsSyntaxTree: [errSpan] :: IState -> Maybe FC
+ Idris.AbsSyntaxTree: [fn_params] :: FnInfo -> [Int]
+ Idris.AbsSyntaxTree: [getScript] :: PArg' t -> t
+ Idris.AbsSyntaxTree: [getTm] :: PArg' t -> t
+ Idris.AbsSyntaxTree: [hide_list] :: IState -> [(Name, Maybe Accessibility)]
+ Idris.AbsSyntaxTree: [highlighting] :: EState -> [(FC, OutputAnnotation)]
+ Idris.AbsSyntaxTree: [ibc_write] :: IState -> [IBCWrite]
+ Idris.AbsSyntaxTree: [idris_autohints] :: IState -> Ctxt [Name]
+ Idris.AbsSyntaxTree: [idris_calledgraph] :: IState -> Ctxt [Name]
+ Idris.AbsSyntaxTree: [idris_callgraph] :: IState -> Ctxt CGInfo
+ Idris.AbsSyntaxTree: [idris_callswho] :: IState -> Maybe (Map Name [Name])
+ Idris.AbsSyntaxTree: [idris_cgflags] :: IState -> [(Codegen, String)]
+ Idris.AbsSyntaxTree: [idris_classes] :: IState -> Ctxt ClassInfo
+ Idris.AbsSyntaxTree: [idris_coercions] :: IState -> [Name]
+ Idris.AbsSyntaxTree: [idris_colourRepl] :: IState -> Bool
+ Idris.AbsSyntaxTree: [idris_colourTheme] :: IState -> ColourTheme
+ Idris.AbsSyntaxTree: [idris_consolewidth] :: IState -> ConsoleWidth
+ Idris.AbsSyntaxTree: [idris_constraints] :: IState -> Set ConstraintFC
+ Idris.AbsSyntaxTree: [idris_datatypes] :: IState -> Ctxt TypeInfo
+ Idris.AbsSyntaxTree: [idris_defertotcheck] :: IState -> [(FC, Name)]
+ Idris.AbsSyntaxTree: [idris_deprecated] :: IState -> Ctxt String
+ Idris.AbsSyntaxTree: [idris_docstrings] :: IState -> Ctxt (Docstring DocTerm, [(Name, Docstring DocTerm)])
+ Idris.AbsSyntaxTree: [idris_dsls] :: IState -> Ctxt DSL
+ Idris.AbsSyntaxTree: [idris_dynamic_libs] :: IState -> [DynamicLib]
+ Idris.AbsSyntaxTree: [idris_erasureUsed] :: IState -> [(Name, Int)]
+ Idris.AbsSyntaxTree: [idris_errRev] :: IState -> [(Term, Term)]
+ Idris.AbsSyntaxTree: [idris_errorhandlers] :: IState -> [Name]
+ Idris.AbsSyntaxTree: [idris_exports] :: IState -> [Name]
+ Idris.AbsSyntaxTree: [idris_externs] :: IState -> Set (Name, Int)
+ Idris.AbsSyntaxTree: [idris_flags] :: IState -> Ctxt [FnOpt]
+ Idris.AbsSyntaxTree: [idris_fninfo] :: IState -> Ctxt FnInfo
+ Idris.AbsSyntaxTree: [idris_function_errorhandlers] :: IState -> Ctxt (Map Name (Set Name))
+ Idris.AbsSyntaxTree: [idris_hdrs] :: IState -> [(Codegen, String)]
+ Idris.AbsSyntaxTree: [idris_highlightedRegions] :: IState -> [(FC, OutputAnnotation)]
+ Idris.AbsSyntaxTree: [idris_implicits] :: IState -> Ctxt [PArg]
+ Idris.AbsSyntaxTree: [idris_imported] :: IState -> [(FilePath, Bool)]
+ Idris.AbsSyntaxTree: [idris_infixes] :: IState -> [FixDecl]
+ Idris.AbsSyntaxTree: [idris_language_extensions] :: IState -> [LanguageExt]
+ Idris.AbsSyntaxTree: [idris_libs] :: IState -> [(Codegen, String)]
+ Idris.AbsSyntaxTree: [idris_lineapps] :: IState -> [((FilePath, Int), PTerm)]
+ Idris.AbsSyntaxTree: [idris_metavars] :: IState -> [(Name, (Maybe Name, Int, [Name], Bool))]
+ Idris.AbsSyntaxTree: [idris_moduledocs] :: IState -> Ctxt (Docstring DocTerm)
+ Idris.AbsSyntaxTree: [idris_nameIdx] :: IState -> (Int, Ctxt (Int, Name))
+ Idris.AbsSyntaxTree: [idris_name] :: IState -> Int
+ Idris.AbsSyntaxTree: [idris_namehints] :: IState -> Ctxt [Name]
+ Idris.AbsSyntaxTree: [idris_objs] :: IState -> [(Codegen, FilePath)]
+ Idris.AbsSyntaxTree: [idris_optimisation] :: IState -> Ctxt OptInfo
+ Idris.AbsSyntaxTree: [idris_options] :: IState -> IOption
+ Idris.AbsSyntaxTree: [idris_outputmode] :: IState -> OutputMode
+ Idris.AbsSyntaxTree: [idris_parsedSpan] :: IState -> Maybe FC
+ Idris.AbsSyntaxTree: [idris_parserHighlights] :: IState -> [(FC, OutputAnnotation)]
+ Idris.AbsSyntaxTree: [idris_patdefs] :: IState -> Ctxt ([([Name], Term, Term)], [PTerm])
+ Idris.AbsSyntaxTree: [idris_postulates] :: IState -> Set Name
+ Idris.AbsSyntaxTree: [idris_records] :: IState -> Ctxt RecordInfo
+ Idris.AbsSyntaxTree: [idris_repl_defs] :: IState -> [Name]
+ Idris.AbsSyntaxTree: [idris_scprims] :: IState -> [(Name, (Int, PrimFn))]
+ Idris.AbsSyntaxTree: [idris_statics] :: IState -> Ctxt [Bool]
+ Idris.AbsSyntaxTree: [idris_symbols] :: IState -> Map Name Name
+ Idris.AbsSyntaxTree: [idris_totcheck] :: IState -> [(FC, Name)]
+ Idris.AbsSyntaxTree: [idris_totcheckfail] :: IState -> [(FC, String)]
+ Idris.AbsSyntaxTree: [idris_transforms] :: IState -> Ctxt [(Term, Term)]
+ Idris.AbsSyntaxTree: [idris_tyinfodata] :: IState -> Ctxt TIData
+ Idris.AbsSyntaxTree: [idris_whocalls] :: IState -> Maybe (Map Name [Name])
+ Idris.AbsSyntaxTree: [imp_methods] :: SyntaxInfo -> [Name]
+ Idris.AbsSyntaxTree: [implicitAllowed] :: SyntaxInfo -> Bool
+ Idris.AbsSyntaxTree: [imported] :: IState -> [FilePath]
+ Idris.AbsSyntaxTree: [inPattern] :: SyntaxInfo -> Bool
+ Idris.AbsSyntaxTree: [inaccessible] :: OptInfo -> [(Int, Name)]
+ Idris.AbsSyntaxTree: [inblock] :: ElabInfo -> Ctxt [Name]
+ Idris.AbsSyntaxTree: [indent_stack] :: IState -> [Int]
+ Idris.AbsSyntaxTree: [index_first] :: DSL' t -> Maybe t
+ Idris.AbsSyntaxTree: [index_next] :: DSL' t -> Maybe t
+ Idris.AbsSyntaxTree: [instanceCtorName] :: ClassInfo -> Name
+ Idris.AbsSyntaxTree: [lastParse] :: IState -> Maybe Name
+ Idris.AbsSyntaxTree: [lastTokenSpan] :: IState -> Maybe FC
+ Idris.AbsSyntaxTree: [liftname] :: ElabInfo -> Name -> Name
+ Idris.AbsSyntaxTree: [machine_inf] :: PArg' t -> Bool
+ Idris.AbsSyntaxTree: [maxline] :: SyntaxInfo -> Maybe Int
+ Idris.AbsSyntaxTree: [module_aliases] :: IState -> Map [Text] [Text]
+ Idris.AbsSyntaxTree: [mut_nesting] :: SyntaxInfo -> Int
+ Idris.AbsSyntaxTree: [namespace] :: ElabInfo -> Maybe [String]
+ Idris.AbsSyntaxTree: [new_tyDecls] :: EState -> [RDeclInstructions]
+ Idris.AbsSyntaxTree: [no_imp] :: SyntaxInfo -> [Name]
+ Idris.AbsSyntaxTree: [opt_autoImport] :: IOption -> [FilePath]
+ Idris.AbsSyntaxTree: [opt_autoSolve] :: IOption -> Bool
+ Idris.AbsSyntaxTree: [opt_cmdline] :: IOption -> [Opt]
+ Idris.AbsSyntaxTree: [opt_codegen] :: IOption -> Codegen
+ Idris.AbsSyntaxTree: [opt_coverage] :: IOption -> Bool
+ Idris.AbsSyntaxTree: [opt_cpu] :: IOption -> String
+ Idris.AbsSyntaxTree: [opt_desugarnats] :: IOption -> Bool
+ Idris.AbsSyntaxTree: [opt_errContext] :: IOption -> Bool
+ Idris.AbsSyntaxTree: [opt_evaltypes] :: IOption -> Bool
+ Idris.AbsSyntaxTree: [opt_ibcsubdir] :: IOption -> FilePath
+ Idris.AbsSyntaxTree: [opt_importdirs] :: IOption -> [FilePath]
+ Idris.AbsSyntaxTree: [opt_logLevel] :: IOption -> Int
+ Idris.AbsSyntaxTree: [opt_nobanner] :: IOption -> Bool
+ Idris.AbsSyntaxTree: [opt_optimise] :: IOption -> [Optimisation]
+ Idris.AbsSyntaxTree: [opt_origerr] :: IOption -> Bool
+ Idris.AbsSyntaxTree: [opt_outputTy] :: IOption -> OutputType
+ Idris.AbsSyntaxTree: [opt_printdepth] :: IOption -> Maybe Int
+ Idris.AbsSyntaxTree: [opt_quiet] :: IOption -> Bool
+ Idris.AbsSyntaxTree: [opt_repl] :: IOption -> Bool
+ Idris.AbsSyntaxTree: [opt_showimp] :: IOption -> Bool
+ Idris.AbsSyntaxTree: [opt_triple] :: IOption -> String
+ Idris.AbsSyntaxTree: [opt_typecase] :: IOption -> Bool
+ Idris.AbsSyntaxTree: [opt_typeintype] :: IOption -> Bool
+ Idris.AbsSyntaxTree: [opt_verbose] :: IOption -> Bool
+ Idris.AbsSyntaxTree: [params] :: ElabInfo -> [(Name, PTerm)]
+ Idris.AbsSyntaxTree: [pargopts] :: Plicity -> [ArgOpt]
+ Idris.AbsSyntaxTree: [parserWarnings] :: IState -> [(FC, Err)]
+ Idris.AbsSyntaxTree: [pname] :: PArg' t -> Name
+ Idris.AbsSyntaxTree: [pparam] :: Plicity -> Bool
+ Idris.AbsSyntaxTree: [ppopt_depth] :: PPOption -> Maybe Int
+ Idris.AbsSyntaxTree: [ppopt_desugarnats] :: PPOption -> Bool
+ Idris.AbsSyntaxTree: [ppopt_impl] :: PPOption -> Bool
+ Idris.AbsSyntaxTree: [ppopt_pinames] :: PPOption -> Bool
+ Idris.AbsSyntaxTree: [prec] :: Fixity -> Int
+ Idris.AbsSyntaxTree: [priority] :: PArg' t -> Int
+ Idris.AbsSyntaxTree: [proof_list] :: IState -> [(Name, (Bool, [String]))]
+ Idris.AbsSyntaxTree: [pscoped] :: Plicity -> Maybe ImplicitInfo
+ Idris.AbsSyntaxTree: [pscript] :: Plicity -> PTerm
+ Idris.AbsSyntaxTree: [pstatic] :: Plicity -> Static
+ Idris.AbsSyntaxTree: [rec_elabDecl] :: ElabInfo -> ElabWhat -> ElabInfo -> PDecl -> Idris ()
+ Idris.AbsSyntaxTree: [record_constructor] :: RecordInfo -> Name
+ Idris.AbsSyntaxTree: [record_parameters] :: RecordInfo -> [(Name, PTerm)]
+ Idris.AbsSyntaxTree: [record_projections] :: RecordInfo -> [Name]
+ Idris.AbsSyntaxTree: [scg] :: CGInfo -> [SCGEntry]
+ Idris.AbsSyntaxTree: [syn_in_quasiquote] :: SyntaxInfo -> Int
+ Idris.AbsSyntaxTree: [syn_namespace] :: SyntaxInfo -> [String]
+ Idris.AbsSyntaxTree: [syn_params] :: SyntaxInfo -> [(Name, PTerm)]
+ Idris.AbsSyntaxTree: [syntaxRulesList] :: SyntaxRules -> [Syntax]
+ Idris.AbsSyntaxTree: [syntax_keywords] :: IState -> [String]
+ Idris.AbsSyntaxTree: [syntax_rules] :: IState -> SyntaxRules
+ Idris.AbsSyntaxTree: [tt_ctxt] :: IState -> Context
+ Idris.AbsSyntaxTree: [usedpos] :: CGInfo -> [(Int, [UsageReason])]
+ Idris.AbsSyntaxTree: [using] :: SyntaxInfo -> [Using]
+ Idris.AbsSyntaxTree: instance Data.Data.Data Idris.AbsSyntaxTree.ArgOpt
+ Idris.AbsSyntaxTree: instance Data.Data.Data Idris.AbsSyntaxTree.PAltType
+ Idris.AbsSyntaxTree: instance Data.Data.Data Idris.AbsSyntaxTree.PTerm
+ Idris.AbsSyntaxTree: instance Data.Data.Data Idris.AbsSyntaxTree.Plicity
+ Idris.AbsSyntaxTree: instance Data.Data.Data Idris.AbsSyntaxTree.PunInfo
+ Idris.AbsSyntaxTree: instance Data.Data.Data Idris.AbsSyntaxTree.Static
+ Idris.AbsSyntaxTree: instance Data.Data.Data Idris.AbsSyntaxTree.Using
+ Idris.AbsSyntaxTree: instance Data.Data.Data t => Data.Data.Data (Idris.AbsSyntaxTree.PArg' t)
+ Idris.AbsSyntaxTree: instance Data.Data.Data t => Data.Data.Data (Idris.AbsSyntaxTree.PDo' t)
+ Idris.AbsSyntaxTree: instance Data.Data.Data t => Data.Data.Data (Idris.AbsSyntaxTree.PTactic' t)
+ Idris.AbsSyntaxTree: instance Data.Foldable.Foldable Idris.AbsSyntaxTree.PTactic'
+ Idris.AbsSyntaxTree: instance Data.Traversable.Traversable Idris.AbsSyntaxTree.PTactic'
+ Idris.AbsSyntaxTree: instance GHC.Base.Functor Idris.AbsSyntaxTree.DSL'
+ Idris.AbsSyntaxTree: instance GHC.Base.Functor Idris.AbsSyntaxTree.PArg'
+ Idris.AbsSyntaxTree: instance GHC.Base.Functor Idris.AbsSyntaxTree.PClause'
+ Idris.AbsSyntaxTree: instance GHC.Base.Functor Idris.AbsSyntaxTree.PData'
+ Idris.AbsSyntaxTree: instance GHC.Base.Functor Idris.AbsSyntaxTree.PDecl'
+ Idris.AbsSyntaxTree: instance GHC.Base.Functor Idris.AbsSyntaxTree.PDo'
+ Idris.AbsSyntaxTree: instance GHC.Base.Functor Idris.AbsSyntaxTree.PTactic'
+ Idris.AbsSyntaxTree: instance GHC.Base.Functor Idris.AbsSyntaxTree.ProvideWhat'
+ Idris.AbsSyntaxTree: instance GHC.Classes.Eq Idris.AbsSyntaxTree.ArgOpt
+ Idris.AbsSyntaxTree: instance GHC.Classes.Eq Idris.AbsSyntaxTree.Codegen
+ Idris.AbsSyntaxTree: instance GHC.Classes.Eq Idris.AbsSyntaxTree.ConsoleWidth
+ Idris.AbsSyntaxTree: instance GHC.Classes.Eq Idris.AbsSyntaxTree.ElabShellCmd
+ Idris.AbsSyntaxTree: instance GHC.Classes.Eq Idris.AbsSyntaxTree.ElabWhat
+ Idris.AbsSyntaxTree: instance GHC.Classes.Eq Idris.AbsSyntaxTree.FixDecl
+ Idris.AbsSyntaxTree: instance GHC.Classes.Eq Idris.AbsSyntaxTree.Fixity
+ Idris.AbsSyntaxTree: instance GHC.Classes.Eq Idris.AbsSyntaxTree.FnOpt
+ Idris.AbsSyntaxTree: instance GHC.Classes.Eq Idris.AbsSyntaxTree.IOption
+ Idris.AbsSyntaxTree: instance GHC.Classes.Eq Idris.AbsSyntaxTree.LanguageExt
+ Idris.AbsSyntaxTree: instance GHC.Classes.Eq Idris.AbsSyntaxTree.Opt
+ Idris.AbsSyntaxTree: instance GHC.Classes.Eq Idris.AbsSyntaxTree.Optimisation
+ Idris.AbsSyntaxTree: instance GHC.Classes.Eq Idris.AbsSyntaxTree.PAltType
+ Idris.AbsSyntaxTree: instance GHC.Classes.Eq Idris.AbsSyntaxTree.PTerm
+ Idris.AbsSyntaxTree: instance GHC.Classes.Eq Idris.AbsSyntaxTree.Plicity
+ Idris.AbsSyntaxTree: instance GHC.Classes.Eq Idris.AbsSyntaxTree.PunInfo
+ Idris.AbsSyntaxTree: instance GHC.Classes.Eq Idris.AbsSyntaxTree.SSymbol
+ Idris.AbsSyntaxTree: instance GHC.Classes.Eq Idris.AbsSyntaxTree.SizeChange
+ Idris.AbsSyntaxTree: instance GHC.Classes.Eq Idris.AbsSyntaxTree.Static
+ Idris.AbsSyntaxTree: instance GHC.Classes.Eq Idris.AbsSyntaxTree.Using
+ Idris.AbsSyntaxTree: instance GHC.Classes.Eq t => GHC.Classes.Eq (Idris.AbsSyntaxTree.PArg' t)
+ Idris.AbsSyntaxTree: instance GHC.Classes.Eq t => GHC.Classes.Eq (Idris.AbsSyntaxTree.PDo' t)
+ Idris.AbsSyntaxTree: instance GHC.Classes.Eq t => GHC.Classes.Eq (Idris.AbsSyntaxTree.PTactic' t)
+ Idris.AbsSyntaxTree: instance GHC.Classes.Eq t => GHC.Classes.Eq (Idris.AbsSyntaxTree.ProvideWhat' t)
+ Idris.AbsSyntaxTree: instance GHC.Classes.Ord Idris.AbsSyntaxTree.FixDecl
+ Idris.AbsSyntaxTree: instance GHC.Classes.Ord Idris.AbsSyntaxTree.LanguageExt
+ Idris.AbsSyntaxTree: instance GHC.Read.Read Idris.AbsSyntaxTree.LanguageExt
+ Idris.AbsSyntaxTree: instance GHC.Show.Show Idris.AbsSyntaxTree.ArgOpt
+ Idris.AbsSyntaxTree: instance GHC.Show.Show Idris.AbsSyntaxTree.CGInfo
+ Idris.AbsSyntaxTree: instance GHC.Show.Show Idris.AbsSyntaxTree.ClassInfo
+ Idris.AbsSyntaxTree: instance GHC.Show.Show Idris.AbsSyntaxTree.Codegen
+ Idris.AbsSyntaxTree: instance GHC.Show.Show Idris.AbsSyntaxTree.ConsoleWidth
+ Idris.AbsSyntaxTree: instance GHC.Show.Show Idris.AbsSyntaxTree.ElabShellCmd
+ Idris.AbsSyntaxTree: instance GHC.Show.Show Idris.AbsSyntaxTree.ElabWhat
+ Idris.AbsSyntaxTree: instance GHC.Show.Show Idris.AbsSyntaxTree.FixDecl
+ Idris.AbsSyntaxTree: instance GHC.Show.Show Idris.AbsSyntaxTree.Fixity
+ Idris.AbsSyntaxTree: instance GHC.Show.Show Idris.AbsSyntaxTree.FnInfo
+ Idris.AbsSyntaxTree: instance GHC.Show.Show Idris.AbsSyntaxTree.FnOpt
+ Idris.AbsSyntaxTree: instance GHC.Show.Show Idris.AbsSyntaxTree.IBCWrite
+ Idris.AbsSyntaxTree: instance GHC.Show.Show Idris.AbsSyntaxTree.IOption
+ Idris.AbsSyntaxTree: instance GHC.Show.Show Idris.AbsSyntaxTree.IState
+ Idris.AbsSyntaxTree: instance GHC.Show.Show Idris.AbsSyntaxTree.LanguageExt
+ Idris.AbsSyntaxTree: instance GHC.Show.Show Idris.AbsSyntaxTree.Opt
+ Idris.AbsSyntaxTree: instance GHC.Show.Show Idris.AbsSyntaxTree.OptInfo
+ Idris.AbsSyntaxTree: instance GHC.Show.Show Idris.AbsSyntaxTree.Optimisation
+ Idris.AbsSyntaxTree: instance GHC.Show.Show Idris.AbsSyntaxTree.OutputMode
+ Idris.AbsSyntaxTree: instance GHC.Show.Show Idris.AbsSyntaxTree.PClause
+ Idris.AbsSyntaxTree: instance GHC.Show.Show Idris.AbsSyntaxTree.PData
+ Idris.AbsSyntaxTree: instance GHC.Show.Show Idris.AbsSyntaxTree.PDecl
+ Idris.AbsSyntaxTree: instance GHC.Show.Show Idris.AbsSyntaxTree.PPOption
+ Idris.AbsSyntaxTree: instance GHC.Show.Show Idris.AbsSyntaxTree.PTerm
+ Idris.AbsSyntaxTree: instance GHC.Show.Show Idris.AbsSyntaxTree.Plicity
+ Idris.AbsSyntaxTree: instance GHC.Show.Show Idris.AbsSyntaxTree.PunInfo
+ Idris.AbsSyntaxTree: instance GHC.Show.Show Idris.AbsSyntaxTree.RecordInfo
+ Idris.AbsSyntaxTree: instance GHC.Show.Show Idris.AbsSyntaxTree.SSymbol
+ Idris.AbsSyntaxTree: instance GHC.Show.Show Idris.AbsSyntaxTree.SizeChange
+ Idris.AbsSyntaxTree: instance GHC.Show.Show Idris.AbsSyntaxTree.Static
+ Idris.AbsSyntaxTree: instance GHC.Show.Show Idris.AbsSyntaxTree.SynContext
+ Idris.AbsSyntaxTree: instance GHC.Show.Show Idris.AbsSyntaxTree.Syntax
+ Idris.AbsSyntaxTree: instance GHC.Show.Show Idris.AbsSyntaxTree.SyntaxInfo
+ Idris.AbsSyntaxTree: instance GHC.Show.Show Idris.AbsSyntaxTree.TIData
+ Idris.AbsSyntaxTree: instance GHC.Show.Show Idris.AbsSyntaxTree.Using
+ Idris.AbsSyntaxTree: instance GHC.Show.Show t => GHC.Show.Show (Idris.AbsSyntaxTree.DSL' t)
+ Idris.AbsSyntaxTree: instance GHC.Show.Show t => GHC.Show.Show (Idris.AbsSyntaxTree.PArg' t)
+ Idris.AbsSyntaxTree: instance GHC.Show.Show t => GHC.Show.Show (Idris.AbsSyntaxTree.PTactic' t)
+ Idris.AbsSyntaxTree: instance GHC.Show.Show t => GHC.Show.Show (Idris.AbsSyntaxTree.ProvideWhat' t)
+ Idris.AbsSyntaxTree: instance Util.Pretty.Pretty Idris.AbsSyntaxTree.PTerm Idris.Core.TT.OutputAnnotation
+ Idris.AbsSyntaxTree: instance Util.Pretty.Sized Idris.AbsSyntaxTree.PTerm
+ Idris.AbsSyntaxTree: instance Util.Pretty.Sized a => Util.Pretty.Sized (Idris.AbsSyntaxTree.PArg' a)
+ Idris.AbsSyntaxTree: instance Util.Pretty.Sized a => Util.Pretty.Sized (Idris.AbsSyntaxTree.PDo' a)
+ Idris.AbsSyntaxTree: instance Util.Pretty.Sized a => Util.Pretty.Sized (Idris.AbsSyntaxTree.PTactic' a)
+ Idris.Apropos: instance (Idris.Apropos.Apropos a, Idris.Apropos.Apropos b) => Idris.Apropos.Apropos (a, b)
+ Idris.Apropos: instance Idris.Apropos.Apropos (Idris.Core.TT.Binder (Idris.Core.TT.TT Idris.Core.TT.Name))
+ Idris.Apropos: instance Idris.Apropos.Apropos (Idris.Core.TT.TT Idris.Core.TT.Name)
+ Idris.Apropos: instance Idris.Apropos.Apropos (Idris.Docstrings.Docstring a)
+ Idris.Apropos: instance Idris.Apropos.Apropos Idris.Core.Evaluate.Def
+ Idris.Apropos: instance Idris.Apropos.Apropos Idris.Core.TT.Const
+ Idris.Apropos: instance Idris.Apropos.Apropos Idris.Core.TT.Name
+ Idris.Apropos: instance Idris.Apropos.Apropos a => Idris.Apropos.Apropos (GHC.Base.Maybe a)
+ Idris.Apropos: instance Idris.Apropos.Apropos a => Idris.Apropos.Apropos [a]
+ Idris.Chaser: [mod_deps] :: ModuleTree -> [ModuleTree]
+ Idris.Chaser: [mod_needsRecheck] :: ModuleTree -> Bool
+ Idris.Chaser: [mod_path] :: ModuleTree -> IFileType
+ Idris.Chaser: [mod_time] :: ModuleTree -> UTCTime
+ Idris.Chaser: getImports :: [(FilePath, [ImportInfo])] -> [FilePath] -> Idris [(FilePath, [ImportInfo])]
+ Idris.Chaser: instance GHC.Show.Show Idris.Chaser.ModuleTree
+ Idris.Colours: [bold] :: IdrisColour -> Bool
+ Idris.Colours: [boundVarColour] :: ColourTheme -> IdrisColour
+ Idris.Colours: [colour] :: IdrisColour -> Maybe Color
+ Idris.Colours: [dataColour] :: ColourTheme -> IdrisColour
+ Idris.Colours: [functionColour] :: ColourTheme -> IdrisColour
+ Idris.Colours: [implicitColour] :: ColourTheme -> IdrisColour
+ Idris.Colours: [italic] :: IdrisColour -> Bool
+ Idris.Colours: [keywordColour] :: ColourTheme -> IdrisColour
+ Idris.Colours: [postulateColour] :: ColourTheme -> IdrisColour
+ Idris.Colours: [promptColour] :: ColourTheme -> IdrisColour
+ Idris.Colours: [typeColour] :: ColourTheme -> IdrisColour
+ Idris.Colours: [underline] :: IdrisColour -> Bool
+ Idris.Colours: [vivid] :: IdrisColour -> Bool
+ Idris.Colours: instance GHC.Classes.Eq Idris.Colours.ColourTheme
+ Idris.Colours: instance GHC.Classes.Eq Idris.Colours.ColourType
+ Idris.Colours: instance GHC.Classes.Eq Idris.Colours.IdrisColour
+ Idris.Colours: instance GHC.Enum.Bounded Idris.Colours.ColourType
+ Idris.Colours: instance GHC.Enum.Enum Idris.Colours.ColourType
+ Idris.Colours: instance GHC.Show.Show Idris.Colours.ColourTheme
+ Idris.Colours: instance GHC.Show.Show Idris.Colours.ColourType
+ Idris.Colours: instance GHC.Show.Show Idris.Colours.IdrisColour
+ Idris.Core.Binary: instance Data.Binary.Class.Binary (Idris.Core.TT.TT Idris.Core.TT.Name)
+ Idris.Core.Binary: instance Data.Binary.Class.Binary Idris.Core.TT.Const
+ Idris.Core.Binary: instance Data.Binary.Class.Binary Idris.Core.TT.ConstraintFC
+ Idris.Core.Binary: instance Data.Binary.Class.Binary Idris.Core.TT.ErrorReportPart
+ Idris.Core.Binary: instance Data.Binary.Class.Binary Idris.Core.TT.FC
+ Idris.Core.Binary: instance Data.Binary.Class.Binary Idris.Core.TT.FC'
+ Idris.Core.Binary: instance Data.Binary.Class.Binary Idris.Core.TT.ImplicitInfo
+ Idris.Core.Binary: instance Data.Binary.Class.Binary Idris.Core.TT.Name
+ Idris.Core.Binary: instance Data.Binary.Class.Binary Idris.Core.TT.NameType
+ Idris.Core.Binary: instance Data.Binary.Class.Binary Idris.Core.TT.Provenance
+ Idris.Core.Binary: instance Data.Binary.Class.Binary Idris.Core.TT.Raw
+ Idris.Core.Binary: instance Data.Binary.Class.Binary Idris.Core.TT.SpecialName
+ Idris.Core.Binary: instance Data.Binary.Class.Binary Idris.Core.TT.UConstraint
+ Idris.Core.Binary: instance Data.Binary.Class.Binary Idris.Core.TT.UExp
+ Idris.Core.Binary: instance Data.Binary.Class.Binary Idris.Core.TT.Universe
+ Idris.Core.Binary: instance Data.Binary.Class.Binary a => Data.Binary.Class.Binary (Idris.Core.TT.Err' a)
+ Idris.Core.Binary: instance Data.Binary.Class.Binary b => Data.Binary.Class.Binary (Idris.Core.TT.Binder b)
+ Idris.Core.CaseTree: instance GHC.Base.Functor Idris.Core.CaseTree.CaseAlt'
+ Idris.Core.CaseTree: instance GHC.Base.Functor Idris.Core.CaseTree.SC'
+ Idris.Core.CaseTree: instance GHC.Classes.Eq Idris.Core.CaseTree.CaseType
+ Idris.Core.CaseTree: instance GHC.Classes.Eq Idris.Core.CaseTree.ConType
+ Idris.Core.CaseTree: instance GHC.Classes.Eq Idris.Core.CaseTree.Phase
+ Idris.Core.CaseTree: instance GHC.Classes.Eq t => GHC.Classes.Eq (Idris.Core.CaseTree.CaseAlt' t)
+ Idris.Core.CaseTree: instance GHC.Classes.Eq t => GHC.Classes.Eq (Idris.Core.CaseTree.SC' t)
+ Idris.Core.CaseTree: instance GHC.Classes.Ord Idris.Core.CaseTree.CaseType
+ Idris.Core.CaseTree: instance GHC.Classes.Ord t => GHC.Classes.Ord (Idris.Core.CaseTree.CaseAlt' t)
+ Idris.Core.CaseTree: instance GHC.Classes.Ord t => GHC.Classes.Ord (Idris.Core.CaseTree.SC' t)
+ Idris.Core.CaseTree: instance GHC.Show.Show Idris.Core.CaseTree.CaseDef
+ Idris.Core.CaseTree: instance GHC.Show.Show Idris.Core.CaseTree.CaseType
+ Idris.Core.CaseTree: instance GHC.Show.Show Idris.Core.CaseTree.ConType
+ Idris.Core.CaseTree: instance GHC.Show.Show Idris.Core.CaseTree.Group
+ Idris.Core.CaseTree: instance GHC.Show.Show Idris.Core.CaseTree.Partition
+ Idris.Core.CaseTree: instance GHC.Show.Show Idris.Core.CaseTree.Pat
+ Idris.Core.CaseTree: instance GHC.Show.Show Idris.Core.CaseTree.Phase
+ Idris.Core.CaseTree: instance GHC.Show.Show t => GHC.Show.Show (Idris.Core.CaseTree.CaseAlt' t)
+ Idris.Core.CaseTree: instance GHC.Show.Show t => GHC.Show.Show (Idris.Core.CaseTree.SC' t)
+ Idris.Core.CaseTree: instance Idris.Core.TT.TermSize Idris.Core.CaseTree.CaseAlt
+ Idris.Core.CaseTree: instance Idris.Core.TT.TermSize Idris.Core.CaseTree.SC
+ Idris.Core.Constraints: instance GHC.Classes.Eq Idris.Core.Constraints.Domain
+ Idris.Core.Constraints: instance GHC.Classes.Eq Idris.Core.Constraints.Var
+ Idris.Core.Constraints: instance GHC.Classes.Ord Idris.Core.Constraints.Domain
+ Idris.Core.Constraints: instance GHC.Classes.Ord Idris.Core.Constraints.Var
+ Idris.Core.Constraints: instance GHC.Show.Show Idris.Core.Constraints.Domain
+ Idris.Core.Constraints: instance GHC.Show.Show Idris.Core.Constraints.Var
+ Idris.Core.DeepSeq: instance Control.DeepSeq.NFData GHC.Types.Ordering
+ Idris.Core.DeepSeq: instance Control.DeepSeq.NFData Idris.Core.Evaluate.Accessibility
+ Idris.Core.DeepSeq: instance Control.DeepSeq.NFData Idris.Core.Evaluate.CaseDefs
+ Idris.Core.DeepSeq: instance Control.DeepSeq.NFData Idris.Core.Evaluate.CaseInfo
+ Idris.Core.DeepSeq: instance Control.DeepSeq.NFData Idris.Core.Evaluate.Context
+ Idris.Core.DeepSeq: instance Control.DeepSeq.NFData Idris.Core.Evaluate.Def
+ Idris.Core.DeepSeq: instance Control.DeepSeq.NFData Idris.Core.Evaluate.MetaInformation
+ Idris.Core.DeepSeq: instance Control.DeepSeq.NFData Idris.Core.Evaluate.PReason
+ Idris.Core.DeepSeq: instance Control.DeepSeq.NFData Idris.Core.Evaluate.Totality
+ Idris.Core.DeepSeq: instance Control.DeepSeq.NFData Idris.Core.TT.ArithTy
+ Idris.Core.DeepSeq: instance Control.DeepSeq.NFData Idris.Core.TT.Const
+ Idris.Core.DeepSeq: instance Control.DeepSeq.NFData Idris.Core.TT.ConstraintFC
+ Idris.Core.DeepSeq: instance Control.DeepSeq.NFData Idris.Core.TT.Err
+ Idris.Core.DeepSeq: instance Control.DeepSeq.NFData Idris.Core.TT.ErrorReportPart
+ Idris.Core.DeepSeq: instance Control.DeepSeq.NFData Idris.Core.TT.FC
+ Idris.Core.DeepSeq: instance Control.DeepSeq.NFData Idris.Core.TT.FC'
+ Idris.Core.DeepSeq: instance Control.DeepSeq.NFData Idris.Core.TT.ImplicitInfo
+ Idris.Core.DeepSeq: instance Control.DeepSeq.NFData Idris.Core.TT.IntTy
+ Idris.Core.DeepSeq: instance Control.DeepSeq.NFData Idris.Core.TT.Name
+ Idris.Core.DeepSeq: instance Control.DeepSeq.NFData Idris.Core.TT.NameOutput
+ Idris.Core.DeepSeq: instance Control.DeepSeq.NFData Idris.Core.TT.NameType
+ Idris.Core.DeepSeq: instance Control.DeepSeq.NFData Idris.Core.TT.NativeTy
+ Idris.Core.DeepSeq: instance Control.DeepSeq.NFData Idris.Core.TT.OutputAnnotation
+ Idris.Core.DeepSeq: instance Control.DeepSeq.NFData Idris.Core.TT.Provenance
+ Idris.Core.DeepSeq: instance Control.DeepSeq.NFData Idris.Core.TT.Raw
+ Idris.Core.DeepSeq: instance Control.DeepSeq.NFData Idris.Core.TT.SpecialName
+ Idris.Core.DeepSeq: instance Control.DeepSeq.NFData Idris.Core.TT.TextFormatting
+ Idris.Core.DeepSeq: instance Control.DeepSeq.NFData Idris.Core.TT.UConstraint
+ Idris.Core.DeepSeq: instance Control.DeepSeq.NFData Idris.Core.TT.UExp
+ Idris.Core.DeepSeq: instance Control.DeepSeq.NFData Idris.Core.TT.Universe
+ Idris.Core.DeepSeq: instance Control.DeepSeq.NFData b => Control.DeepSeq.NFData (Idris.Core.TT.Binder b)
+ Idris.Core.DeepSeq: instance Control.DeepSeq.NFData n => Control.DeepSeq.NFData (Idris.Core.TT.TT n)
+ Idris.Core.DeepSeq: instance Control.DeepSeq.NFData t => Control.DeepSeq.NFData (Idris.Core.CaseTree.CaseAlt' t)
+ Idris.Core.DeepSeq: instance Control.DeepSeq.NFData t => Control.DeepSeq.NFData (Idris.Core.CaseTree.SC' t)
+ Idris.Core.Elaborate: instance GHC.Show.Show aux => GHC.Show.Show (Idris.Core.Elaborate.ElabState aux)
+ Idris.Core.Evaluate: [case_alwaysinline] :: CaseInfo -> Bool
+ Idris.Core.Evaluate: [case_inlinable] :: CaseInfo -> Bool
+ Idris.Core.Evaluate: [cases_compiletime] :: CaseDefs -> !([Name], SC)
+ Idris.Core.Evaluate: [cases_inlined] :: CaseDefs -> !([Name], SC)
+ Idris.Core.Evaluate: [cases_runtime] :: CaseDefs -> !([Name], SC)
+ Idris.Core.Evaluate: [cases_totcheck] :: CaseDefs -> !([Name], SC)
+ Idris.Core.Evaluate: [tc_dictionary] :: CaseInfo -> Bool
+ Idris.Core.Evaluate: instance GHC.Classes.Eq Idris.Core.Evaluate.Accessibility
+ Idris.Core.Evaluate: instance GHC.Classes.Eq Idris.Core.Evaluate.EvalOpt
+ Idris.Core.Evaluate: instance GHC.Classes.Eq Idris.Core.Evaluate.MetaInformation
+ Idris.Core.Evaluate: instance GHC.Classes.Eq Idris.Core.Evaluate.PReason
+ Idris.Core.Evaluate: instance GHC.Classes.Eq Idris.Core.Evaluate.Totality
+ Idris.Core.Evaluate: instance GHC.Classes.Eq Idris.Core.Evaluate.Value
+ Idris.Core.Evaluate: instance GHC.Show.Show (a -> b)
+ Idris.Core.Evaluate: instance GHC.Show.Show Idris.Core.Evaluate.Accessibility
+ Idris.Core.Evaluate: instance GHC.Show.Show Idris.Core.Evaluate.Context
+ Idris.Core.Evaluate: instance GHC.Show.Show Idris.Core.Evaluate.Def
+ Idris.Core.Evaluate: instance GHC.Show.Show Idris.Core.Evaluate.EvalOpt
+ Idris.Core.Evaluate: instance GHC.Show.Show Idris.Core.Evaluate.EvalState
+ Idris.Core.Evaluate: instance GHC.Show.Show Idris.Core.Evaluate.MetaInformation
+ Idris.Core.Evaluate: instance GHC.Show.Show Idris.Core.Evaluate.PReason
+ Idris.Core.Evaluate: instance GHC.Show.Show Idris.Core.Evaluate.Totality
+ Idris.Core.Evaluate: instance GHC.Show.Show Idris.Core.Evaluate.Value
+ Idris.Core.Evaluate: instance Idris.Core.Evaluate.Quote Idris.Core.Evaluate.Value
+ Idris.Core.Evaluate: normaliseBlocking :: Context -> Env -> [Name] -> TT Name -> TT Name
+ Idris.Core.ProofState: [autos] :: ProofState -> [(Name, ([FailContext], [Name]))]
+ Idris.Core.ProofState: [context] :: ProofState -> Context
+ Idris.Core.ProofState: [datatypes] :: ProofState -> Ctxt TypeInfo
+ Idris.Core.ProofState: [deferred] :: ProofState -> [Name]
+ Idris.Core.ProofState: [done] :: ProofState -> Bool
+ Idris.Core.ProofState: [dontunify] :: ProofState -> [Name]
+ Idris.Core.ProofState: [dotted] :: ProofState -> [(Name, [Name])]
+ Idris.Core.ProofState: [goalType] :: Goal -> Binder Term
+ Idris.Core.ProofState: [holes] :: ProofState -> [Name]
+ Idris.Core.ProofState: [injective] :: ProofState -> [Name]
+ Idris.Core.ProofState: [instances] :: ProofState -> [Name]
+ Idris.Core.ProofState: [nextname] :: ProofState -> Int
+ Idris.Core.ProofState: [notunified] :: ProofState -> [(Name, Term)]
+ Idris.Core.ProofState: [plog] :: ProofState -> String
+ Idris.Core.ProofState: [premises] :: Goal -> Env
+ Idris.Core.ProofState: [previous] :: ProofState -> Maybe ProofState
+ Idris.Core.ProofState: [problems] :: ProofState -> Fails
+ Idris.Core.ProofState: [psnames] :: ProofState -> [Name]
+ Idris.Core.ProofState: [pterm] :: ProofState -> ProofTerm
+ Idris.Core.ProofState: [ptype] :: ProofState -> Type
+ Idris.Core.ProofState: [recents] :: ProofState -> [Name]
+ Idris.Core.ProofState: [solved] :: ProofState -> Maybe (Name, Term)
+ Idris.Core.ProofState: [thname] :: ProofState -> Name
+ Idris.Core.ProofState: [unified] :: ProofState -> (Name, [(Name, Term)])
+ Idris.Core.ProofState: [unifylog] :: ProofState -> Bool
+ Idris.Core.ProofState: [usedns] :: ProofState -> [Name]
+ Idris.Core.ProofState: [while_elaborating] :: ProofState -> [FailContext]
+ Idris.Core.ProofState: instance GHC.Show.Show Idris.Core.ProofState.ProofState
+ Idris.Core.ProofState: instance GHC.Show.Show Idris.Core.ProofState.Tactic
+ Idris.Core.ProofState: instance Util.Pretty.Pretty Idris.Core.ProofState.ProofState Idris.Core.TT.OutputAnnotation
+ Idris.Core.ProofTerm: [goalType] :: Goal -> Binder Term
+ Idris.Core.ProofTerm: [premises] :: Goal -> Env
+ Idris.Core.ProofTerm: instance GHC.Show.Show Idris.Core.ProofTerm.BinderPath
+ Idris.Core.ProofTerm: instance GHC.Show.Show Idris.Core.ProofTerm.ProofTerm
+ Idris.Core.ProofTerm: instance GHC.Show.Show Idris.Core.ProofTerm.TermPath
+ Idris.Core.TT: ElabScriptStaging :: Name -> Err' t
+ Idris.Core.TT: FancyMsg :: [ErrorReportPart] -> Err' t
+ Idris.Core.TT: [_fc_end] :: FC -> (Int, Int)
+ Idris.Core.TT: [_fc_fname] :: FC -> String
+ Idris.Core.TT: [_fc_start] :: FC -> (Int, Int)
+ Idris.Core.TT: [binderImpl] :: Binder b -> Maybe ImplicitInfo
+ Idris.Core.TT: [binderKind] :: Binder b -> !b
+ Idris.Core.TT: [binderTy] :: Binder b -> !b
+ Idris.Core.TT: [binderVal] :: Binder b -> b
+ Idris.Core.TT: [codata] :: TypeInfo -> Bool
+ Idris.Core.TT: [con_names] :: TypeInfo -> [Name]
+ Idris.Core.TT: [d_cons] :: Datatype n -> [(n, TT n)]
+ Idris.Core.TT: [d_type] :: Datatype n -> (TT n)
+ Idris.Core.TT: [d_typename] :: Datatype n -> n
+ Idris.Core.TT: [d_typetag] :: Datatype n -> Int
+ Idris.Core.TT: [d_unique] :: Datatype n -> Bool
+ Idris.Core.TT: [data_opts] :: TypeInfo -> DataOpts
+ Idris.Core.TT: [envlen] :: Binder b -> Int
+ Idris.Core.TT: [localnames] :: Binder b -> [Name]
+ Idris.Core.TT: [mutual_types] :: TypeInfo -> [Name]
+ Idris.Core.TT: [nt_arity] :: NameType -> Int
+ Idris.Core.TT: [nt_tag] :: NameType -> Int
+ Idris.Core.TT: [nt_unique] :: NameType -> Bool
+ Idris.Core.TT: [param_pos] :: TypeInfo -> [Int]
+ Idris.Core.TT: [tcinstance] :: ImplicitInfo -> Bool
+ Idris.Core.TT: [toplevel_imp] :: ImplicitInfo -> Bool
+ Idris.Core.TT: [uconstraint] :: ConstraintFC -> UConstraint
+ Idris.Core.TT: [ufc] :: ConstraintFC -> FC
+ Idris.Core.TT: [unwrapFC] :: FC' -> FC
+ Idris.Core.TT: instance (GHC.Classes.Eq n, GHC.Show.Show n) => GHC.Show.Show (Idris.Core.TT.Datatype n)
+ Idris.Core.TT: instance (GHC.Classes.Eq n, GHC.Show.Show n) => GHC.Show.Show (Idris.Core.TT.TT n)
+ Idris.Core.TT: instance Data.Data.Data Idris.Core.TT.ArithTy
+ Idris.Core.TT: instance Data.Data.Data Idris.Core.TT.Const
+ Idris.Core.TT: instance Data.Data.Data Idris.Core.TT.ConstraintFC
+ Idris.Core.TT: instance Data.Data.Data Idris.Core.TT.ErrorReportPart
+ Idris.Core.TT: instance Data.Data.Data Idris.Core.TT.FC
+ Idris.Core.TT: instance Data.Data.Data Idris.Core.TT.FC'
+ Idris.Core.TT: instance Data.Data.Data Idris.Core.TT.ImplicitInfo
+ Idris.Core.TT: instance Data.Data.Data Idris.Core.TT.IntTy
+ Idris.Core.TT: instance Data.Data.Data Idris.Core.TT.Name
+ Idris.Core.TT: instance Data.Data.Data Idris.Core.TT.NameType
+ Idris.Core.TT: instance Data.Data.Data Idris.Core.TT.NativeTy
+ Idris.Core.TT: instance Data.Data.Data Idris.Core.TT.Provenance
+ Idris.Core.TT: instance Data.Data.Data Idris.Core.TT.Raw
+ Idris.Core.TT: instance Data.Data.Data Idris.Core.TT.SpecialName
+ Idris.Core.TT: instance Data.Data.Data Idris.Core.TT.UConstraint
+ Idris.Core.TT: instance Data.Data.Data Idris.Core.TT.UExp
+ Idris.Core.TT: instance Data.Data.Data Idris.Core.TT.Universe
+ Idris.Core.TT: instance Data.Data.Data b => Data.Data.Data (Idris.Core.TT.Binder b)
+ Idris.Core.TT: instance Data.Data.Data n => Data.Data.Data (Idris.Core.TT.AppStatus n)
+ Idris.Core.TT: instance Data.Data.Data n => Data.Data.Data (Idris.Core.TT.TT n)
+ Idris.Core.TT: instance Data.Data.Data t => Data.Data.Data (Idris.Core.TT.Err' t)
+ Idris.Core.TT: instance Data.Foldable.Foldable Idris.Core.TT.Binder
+ Idris.Core.TT: instance Data.Traversable.Traversable Idris.Core.TT.Binder
+ Idris.Core.TT: instance GHC.Base.Alternative Idris.Core.TT.TC
+ Idris.Core.TT: instance GHC.Base.Applicative Idris.Core.TT.TC
+ Idris.Core.TT: instance GHC.Base.Functor Idris.Core.TT.AppStatus
+ Idris.Core.TT: instance GHC.Base.Functor Idris.Core.TT.Binder
+ Idris.Core.TT: instance GHC.Base.Functor Idris.Core.TT.Datatype
+ Idris.Core.TT: instance GHC.Base.Functor Idris.Core.TT.Err'
+ Idris.Core.TT: instance GHC.Base.Functor Idris.Core.TT.TC
+ Idris.Core.TT: instance GHC.Base.Functor Idris.Core.TT.TT
+ Idris.Core.TT: instance GHC.Base.Monad Idris.Core.TT.TC
+ Idris.Core.TT: instance GHC.Base.MonadPlus Idris.Core.TT.TC
+ Idris.Core.TT: instance GHC.Classes.Eq Idris.Core.TT.ArithTy
+ Idris.Core.TT: instance GHC.Classes.Eq Idris.Core.TT.Const
+ Idris.Core.TT: instance GHC.Classes.Eq Idris.Core.TT.ConstraintFC
+ Idris.Core.TT: instance GHC.Classes.Eq Idris.Core.TT.DataOpt
+ Idris.Core.TT: instance GHC.Classes.Eq Idris.Core.TT.ErrorReportPart
+ Idris.Core.TT: instance GHC.Classes.Eq Idris.Core.TT.FC
+ Idris.Core.TT: instance GHC.Classes.Eq Idris.Core.TT.FC'
+ Idris.Core.TT: instance GHC.Classes.Eq Idris.Core.TT.ImplicitInfo
+ Idris.Core.TT: instance GHC.Classes.Eq Idris.Core.TT.IntTy
+ Idris.Core.TT: instance GHC.Classes.Eq Idris.Core.TT.Name
+ Idris.Core.TT: instance GHC.Classes.Eq Idris.Core.TT.NameOutput
+ Idris.Core.TT: instance GHC.Classes.Eq Idris.Core.TT.NameType
+ Idris.Core.TT: instance GHC.Classes.Eq Idris.Core.TT.NativeTy
+ Idris.Core.TT: instance GHC.Classes.Eq Idris.Core.TT.Option
+ Idris.Core.TT: instance GHC.Classes.Eq Idris.Core.TT.OutputAnnotation
+ Idris.Core.TT: instance GHC.Classes.Eq Idris.Core.TT.Provenance
+ Idris.Core.TT: instance GHC.Classes.Eq Idris.Core.TT.Raw
+ Idris.Core.TT: instance GHC.Classes.Eq Idris.Core.TT.SpecialName
+ Idris.Core.TT: instance GHC.Classes.Eq Idris.Core.TT.TextFormatting
+ Idris.Core.TT: instance GHC.Classes.Eq Idris.Core.TT.UConstraint
+ Idris.Core.TT: instance GHC.Classes.Eq Idris.Core.TT.UExp
+ Idris.Core.TT: instance GHC.Classes.Eq Idris.Core.TT.Universe
+ Idris.Core.TT: instance GHC.Classes.Eq a => GHC.Classes.Eq (Idris.Core.TT.TC a)
+ Idris.Core.TT: instance GHC.Classes.Eq b => GHC.Classes.Eq (Idris.Core.TT.Binder b)
+ Idris.Core.TT: instance GHC.Classes.Eq n => GHC.Classes.Eq (Idris.Core.TT.AppStatus n)
+ Idris.Core.TT: instance GHC.Classes.Eq n => GHC.Classes.Eq (Idris.Core.TT.Datatype n)
+ Idris.Core.TT: instance GHC.Classes.Eq n => GHC.Classes.Eq (Idris.Core.TT.TT n)
+ Idris.Core.TT: instance GHC.Classes.Eq t => GHC.Classes.Eq (Idris.Core.TT.Err' t)
+ Idris.Core.TT: instance GHC.Classes.Ord Idris.Core.TT.ArithTy
+ Idris.Core.TT: instance GHC.Classes.Ord Idris.Core.TT.Const
+ Idris.Core.TT: instance GHC.Classes.Ord Idris.Core.TT.ConstraintFC
+ Idris.Core.TT: instance GHC.Classes.Ord Idris.Core.TT.FC
+ Idris.Core.TT: instance GHC.Classes.Ord Idris.Core.TT.FC'
+ Idris.Core.TT: instance GHC.Classes.Ord Idris.Core.TT.ImplicitInfo
+ Idris.Core.TT: instance GHC.Classes.Ord Idris.Core.TT.IntTy
+ Idris.Core.TT: instance GHC.Classes.Ord Idris.Core.TT.Name
+ Idris.Core.TT: instance GHC.Classes.Ord Idris.Core.TT.NameType
+ Idris.Core.TT: instance GHC.Classes.Ord Idris.Core.TT.NativeTy
+ Idris.Core.TT: instance GHC.Classes.Ord Idris.Core.TT.SpecialName
+ Idris.Core.TT: instance GHC.Classes.Ord Idris.Core.TT.UConstraint
+ Idris.Core.TT: instance GHC.Classes.Ord Idris.Core.TT.UExp
+ Idris.Core.TT: instance GHC.Classes.Ord Idris.Core.TT.Universe
+ Idris.Core.TT: instance GHC.Classes.Ord b => GHC.Classes.Ord (Idris.Core.TT.Binder b)
+ Idris.Core.TT: instance GHC.Classes.Ord n => GHC.Classes.Ord (Idris.Core.TT.AppStatus n)
+ Idris.Core.TT: instance GHC.Classes.Ord n => GHC.Classes.Ord (Idris.Core.TT.TT n)
+ Idris.Core.TT: instance GHC.Enum.Enum Idris.Core.TT.NativeTy
+ Idris.Core.TT: instance GHC.Show.Show Idris.Core.TT.ArithTy
+ Idris.Core.TT: instance GHC.Show.Show Idris.Core.TT.Const
+ Idris.Core.TT: instance GHC.Show.Show Idris.Core.TT.ConstraintFC
+ Idris.Core.TT: instance GHC.Show.Show Idris.Core.TT.DataOpt
+ Idris.Core.TT: instance GHC.Show.Show Idris.Core.TT.Err
+ Idris.Core.TT: instance GHC.Show.Show Idris.Core.TT.ErrorReportPart
+ Idris.Core.TT: instance GHC.Show.Show Idris.Core.TT.FC
+ Idris.Core.TT: instance GHC.Show.Show Idris.Core.TT.FC'
+ Idris.Core.TT: instance GHC.Show.Show Idris.Core.TT.ImplicitInfo
+ Idris.Core.TT: instance GHC.Show.Show Idris.Core.TT.IntTy
+ Idris.Core.TT: instance GHC.Show.Show Idris.Core.TT.Name
+ Idris.Core.TT: instance GHC.Show.Show Idris.Core.TT.NameOutput
+ Idris.Core.TT: instance GHC.Show.Show Idris.Core.TT.NameType
+ Idris.Core.TT: instance GHC.Show.Show Idris.Core.TT.NativeTy
+ Idris.Core.TT: instance GHC.Show.Show Idris.Core.TT.OutputAnnotation
+ Idris.Core.TT: instance GHC.Show.Show Idris.Core.TT.Provenance
+ Idris.Core.TT: instance GHC.Show.Show Idris.Core.TT.Raw
+ Idris.Core.TT: instance GHC.Show.Show Idris.Core.TT.SpecialName
+ Idris.Core.TT: instance GHC.Show.Show Idris.Core.TT.TextFormatting
+ Idris.Core.TT: instance GHC.Show.Show Idris.Core.TT.TypeInfo
+ Idris.Core.TT: instance GHC.Show.Show Idris.Core.TT.UConstraint
+ Idris.Core.TT: instance GHC.Show.Show Idris.Core.TT.UExp
+ Idris.Core.TT: instance GHC.Show.Show Idris.Core.TT.Universe
+ Idris.Core.TT: instance GHC.Show.Show a => GHC.Show.Show (Idris.Core.TT.TC a)
+ Idris.Core.TT: instance GHC.Show.Show b => GHC.Show.Show (Idris.Core.TT.Binder b)
+ Idris.Core.TT: instance GHC.Show.Show n => GHC.Show.Show (Idris.Core.TT.AppStatus n)
+ Idris.Core.TT: instance Idris.Core.TT.TermSize (Idris.Core.TT.TT Idris.Core.TT.Name)
+ Idris.Core.TT: instance Idris.Core.TT.TermSize a => Idris.Core.TT.TermSize [a]
+ Idris.Core.TT: instance Util.Pretty.Pretty Idris.Core.TT.ArithTy Idris.Core.TT.OutputAnnotation
+ Idris.Core.TT: instance Util.Pretty.Pretty Idris.Core.TT.Const Idris.Core.TT.OutputAnnotation
+ Idris.Core.TT: instance Util.Pretty.Pretty Idris.Core.TT.Err Idris.Core.TT.OutputAnnotation
+ Idris.Core.TT: instance Util.Pretty.Pretty Idris.Core.TT.Name Idris.Core.TT.OutputAnnotation
+ Idris.Core.TT: instance Util.Pretty.Pretty Idris.Core.TT.NameType Idris.Core.TT.OutputAnnotation
+ Idris.Core.TT: instance Util.Pretty.Pretty Idris.Core.TT.NativeTy Idris.Core.TT.OutputAnnotation
+ Idris.Core.TT: instance Util.Pretty.Pretty Idris.Core.TT.Raw Idris.Core.TT.OutputAnnotation
+ Idris.Core.TT: instance Util.Pretty.Pretty [Idris.Core.TT.Name] Idris.Core.TT.OutputAnnotation
+ Idris.Core.TT: instance Util.Pretty.Pretty a Idris.Core.TT.OutputAnnotation => Util.Pretty.Pretty (Idris.Core.TT.TC a) Idris.Core.TT.OutputAnnotation
+ Idris.Core.TT: instance Util.Pretty.Pretty a o => Util.Pretty.Pretty (Idris.Core.TT.TT a) o
+ Idris.Core.TT: instance Util.Pretty.Sized Idris.Core.TT.Const
+ Idris.Core.TT: instance Util.Pretty.Sized Idris.Core.TT.Err
+ Idris.Core.TT: instance Util.Pretty.Sized Idris.Core.TT.ErrorReportPart
+ Idris.Core.TT: instance Util.Pretty.Sized Idris.Core.TT.FC
+ Idris.Core.TT: instance Util.Pretty.Sized Idris.Core.TT.Name
+ Idris.Core.TT: instance Util.Pretty.Sized Idris.Core.TT.NameType
+ Idris.Core.TT: instance Util.Pretty.Sized Idris.Core.TT.Raw
+ Idris.Core.TT: instance Util.Pretty.Sized Idris.Core.TT.UExp
+ Idris.Core.TT: instance Util.Pretty.Sized Idris.Core.TT.Universe
+ Idris.Core.TT: instance Util.Pretty.Sized a => Util.Pretty.Sized (Idris.Core.TT.Binder a)
+ Idris.Core.TT: instance Util.Pretty.Sized a => Util.Pretty.Sized (Idris.Core.TT.TT a)
+ Idris.Core.Typecheck: instance GHC.Classes.Eq Idris.Core.Typecheck.UniqueUse
+ Idris.Core.Unify: [fail_fn] :: FailContext -> Name
+ Idris.Core.Unify: [fail_param] :: FailContext -> Name
+ Idris.Core.Unify: [fail_sourceloc] :: FailContext -> FC
+ Idris.Core.Unify: instance GHC.Classes.Eq Idris.Core.Unify.FailAt
+ Idris.Core.Unify: instance GHC.Classes.Eq Idris.Core.Unify.FailContext
+ Idris.Core.Unify: instance GHC.Show.Show Idris.Core.Unify.FailAt
+ Idris.Core.Unify: instance GHC.Show.Show Idris.Core.Unify.FailContext
+ Idris.Core.Unify: instance GHC.Show.Show Idris.Core.Unify.UInfo
+ Idris.Core.WHNF: instance GHC.Show.Show Idris.Core.WHNF.WEnv
+ Idris.Coverage: instance GHC.Show.Show Idris.Coverage.Guardedness
+ Idris.DataOpts: instance (Idris.DataOpts.Optimisable a, Idris.DataOpts.Optimisable b) => Idris.DataOpts.Optimisable (a, b)
+ Idris.DataOpts: instance (Idris.DataOpts.Optimisable a, Idris.DataOpts.Optimisable b) => Idris.DataOpts.Optimisable (vs, a, b)
+ Idris.DataOpts: instance Idris.DataOpts.Optimisable (Idris.Core.TT.Binder (Idris.Core.TT.TT Idris.Core.TT.Name))
+ Idris.DataOpts: instance Idris.DataOpts.Optimisable (Idris.Core.TT.Binder Idris.Core.TT.Raw)
+ Idris.DataOpts: instance Idris.DataOpts.Optimisable (Idris.Core.TT.TT Idris.Core.TT.Name)
+ Idris.DataOpts: instance Idris.DataOpts.Optimisable Idris.Core.TT.Raw
+ Idris.DataOpts: instance Idris.DataOpts.Optimisable a => Idris.DataOpts.Optimisable (Data.Either.Either a (a, a))
+ Idris.DataOpts: instance Idris.DataOpts.Optimisable a => Idris.DataOpts.Optimisable [a]
+ Idris.DeepSeq: instance Control.DeepSeq.NFData Cheapskate.Types.CodeAttr
+ Idris.DeepSeq: instance Control.DeepSeq.NFData Cheapskate.Types.ListType
+ Idris.DeepSeq: instance Control.DeepSeq.NFData Cheapskate.Types.NumWrapper
+ Idris.DeepSeq: instance Control.DeepSeq.NFData Cheapskate.Types.Options
+ Idris.DeepSeq: instance Control.DeepSeq.NFData IRTS.CodegenCommon.OutputType
+ Idris.DeepSeq: instance Control.DeepSeq.NFData IRTS.Lang.PrimFn
+ Idris.DeepSeq: instance Control.DeepSeq.NFData Idris.AbsSyntaxTree.ArgOpt
+ Idris.DeepSeq: instance Control.DeepSeq.NFData Idris.AbsSyntaxTree.CGInfo
+ Idris.DeepSeq: instance Control.DeepSeq.NFData Idris.AbsSyntaxTree.ClassInfo
+ Idris.DeepSeq: instance Control.DeepSeq.NFData Idris.AbsSyntaxTree.Codegen
+ Idris.DeepSeq: instance Control.DeepSeq.NFData Idris.AbsSyntaxTree.ConsoleWidth
+ Idris.DeepSeq: instance Control.DeepSeq.NFData Idris.AbsSyntaxTree.FixDecl
+ Idris.DeepSeq: instance Control.DeepSeq.NFData Idris.AbsSyntaxTree.Fixity
+ Idris.DeepSeq: instance Control.DeepSeq.NFData Idris.AbsSyntaxTree.FnInfo
+ Idris.DeepSeq: instance Control.DeepSeq.NFData Idris.AbsSyntaxTree.FnOpt
+ Idris.DeepSeq: instance Control.DeepSeq.NFData Idris.AbsSyntaxTree.IBCWrite
+ Idris.DeepSeq: instance Control.DeepSeq.NFData Idris.AbsSyntaxTree.IOption
+ Idris.DeepSeq: instance Control.DeepSeq.NFData Idris.AbsSyntaxTree.IState
+ Idris.DeepSeq: instance Control.DeepSeq.NFData Idris.AbsSyntaxTree.LanguageExt
+ Idris.DeepSeq: instance Control.DeepSeq.NFData Idris.AbsSyntaxTree.Opt
+ Idris.DeepSeq: instance Control.DeepSeq.NFData Idris.AbsSyntaxTree.OptInfo
+ Idris.DeepSeq: instance Control.DeepSeq.NFData Idris.AbsSyntaxTree.Optimisation
+ Idris.DeepSeq: instance Control.DeepSeq.NFData Idris.AbsSyntaxTree.OutputMode
+ Idris.DeepSeq: instance Control.DeepSeq.NFData Idris.AbsSyntaxTree.PAltType
+ Idris.DeepSeq: instance Control.DeepSeq.NFData Idris.AbsSyntaxTree.PTerm
+ Idris.DeepSeq: instance Control.DeepSeq.NFData Idris.AbsSyntaxTree.Plicity
+ Idris.DeepSeq: instance Control.DeepSeq.NFData Idris.AbsSyntaxTree.PunInfo
+ Idris.DeepSeq: instance Control.DeepSeq.NFData Idris.AbsSyntaxTree.RecordInfo
+ Idris.DeepSeq: instance Control.DeepSeq.NFData Idris.AbsSyntaxTree.SSymbol
+ Idris.DeepSeq: instance Control.DeepSeq.NFData Idris.AbsSyntaxTree.SizeChange
+ Idris.DeepSeq: instance Control.DeepSeq.NFData Idris.AbsSyntaxTree.Static
+ Idris.DeepSeq: instance Control.DeepSeq.NFData Idris.AbsSyntaxTree.SynContext
+ Idris.DeepSeq: instance Control.DeepSeq.NFData Idris.AbsSyntaxTree.Syntax
+ Idris.DeepSeq: instance Control.DeepSeq.NFData Idris.AbsSyntaxTree.SyntaxInfo
+ Idris.DeepSeq: instance Control.DeepSeq.NFData Idris.AbsSyntaxTree.SyntaxRules
+ Idris.DeepSeq: instance Control.DeepSeq.NFData Idris.AbsSyntaxTree.TIData
+ Idris.DeepSeq: instance Control.DeepSeq.NFData Idris.AbsSyntaxTree.Using
+ Idris.DeepSeq: instance Control.DeepSeq.NFData Idris.Colours.ColourTheme
+ Idris.DeepSeq: instance Control.DeepSeq.NFData Idris.Colours.IdrisColour
+ Idris.DeepSeq: instance Control.DeepSeq.NFData Idris.Core.TT.DataOpt
+ Idris.DeepSeq: instance Control.DeepSeq.NFData Idris.Core.TT.TypeInfo
+ Idris.DeepSeq: instance Control.DeepSeq.NFData Idris.Docstrings.DocTerm
+ Idris.DeepSeq: instance Control.DeepSeq.NFData Util.DynamicLinker.DynamicLib
+ Idris.DeepSeq: instance Control.DeepSeq.NFData a => Control.DeepSeq.NFData (Idris.Docstrings.Block a)
+ Idris.DeepSeq: instance Control.DeepSeq.NFData a => Control.DeepSeq.NFData (Idris.Docstrings.Docstring a)
+ Idris.DeepSeq: instance Control.DeepSeq.NFData a => Control.DeepSeq.NFData (Idris.Docstrings.Inline a)
+ Idris.DeepSeq: instance Control.DeepSeq.NFData t => Control.DeepSeq.NFData (Idris.AbsSyntaxTree.DSL' t)
+ Idris.DeepSeq: instance Control.DeepSeq.NFData t => Control.DeepSeq.NFData (Idris.AbsSyntaxTree.PArg' t)
+ Idris.DeepSeq: instance Control.DeepSeq.NFData t => Control.DeepSeq.NFData (Idris.AbsSyntaxTree.PClause' t)
+ Idris.DeepSeq: instance Control.DeepSeq.NFData t => Control.DeepSeq.NFData (Idris.AbsSyntaxTree.PData' t)
+ Idris.DeepSeq: instance Control.DeepSeq.NFData t => Control.DeepSeq.NFData (Idris.AbsSyntaxTree.PDecl' t)
+ Idris.DeepSeq: instance Control.DeepSeq.NFData t => Control.DeepSeq.NFData (Idris.AbsSyntaxTree.PDo' t)
+ Idris.DeepSeq: instance Control.DeepSeq.NFData t => Control.DeepSeq.NFData (Idris.AbsSyntaxTree.PTactic' t)
+ Idris.DeepSeq: instance Control.DeepSeq.NFData t => Control.DeepSeq.NFData (Idris.AbsSyntaxTree.ProvideWhat' t)
+ Idris.Docs: instance GHC.Base.Functor Idris.Docs.Docs'
+ Idris.Docs: instance GHC.Base.Functor Idris.Docs.FunDoc'
+ Idris.Docstrings: instance Data.Foldable.Foldable Idris.Docstrings.Block
+ Idris.Docstrings: instance Data.Foldable.Foldable Idris.Docstrings.Docstring
+ Idris.Docstrings: instance Data.Foldable.Foldable Idris.Docstrings.Inline
+ Idris.Docstrings: instance Data.Traversable.Traversable Idris.Docstrings.Block
+ Idris.Docstrings: instance Data.Traversable.Traversable Idris.Docstrings.Docstring
+ Idris.Docstrings: instance Data.Traversable.Traversable Idris.Docstrings.Inline
+ Idris.Docstrings: instance GHC.Base.Functor Idris.Docstrings.Block
+ Idris.Docstrings: instance GHC.Base.Functor Idris.Docstrings.Docstring
+ Idris.Docstrings: instance GHC.Base.Functor Idris.Docstrings.Inline
+ Idris.Docstrings: instance GHC.Show.Show Idris.Docstrings.DocTerm
+ Idris.Docstrings: instance GHC.Show.Show a => GHC.Show.Show (Idris.Docstrings.Block a)
+ Idris.Docstrings: instance GHC.Show.Show a => GHC.Show.Show (Idris.Docstrings.Docstring a)
+ Idris.Docstrings: instance GHC.Show.Show a => GHC.Show.Show (Idris.Docstrings.Inline a)
+ Idris.Elab.Class: instance GHC.Show.Show Idris.Elab.Class.MArgTy
+ Idris.Elab.Term: [e_guarded] :: ElabCtxt -> Bool
+ Idris.Elab.Term: [e_inarg] :: ElabCtxt -> Bool
+ Idris.Elab.Term: [e_intype] :: ElabCtxt -> Bool
+ Idris.Elab.Term: [e_isfn] :: ElabCtxt -> Bool
+ Idris.Elab.Term: [e_nomatching] :: ElabCtxt -> Bool
+ Idris.Elab.Term: [e_qq] :: ElabCtxt -> Bool
+ Idris.Elab.Term: [resultCaseDecls] :: ElabResult -> [PDecl]
+ Idris.Elab.Term: [resultContext] :: ElabResult -> Context
+ Idris.Elab.Term: [resultHighlighting] :: ElabResult -> [(FC, OutputAnnotation)]
+ Idris.Elab.Term: [resultMetavars] :: ElabResult -> [(Name, (Int, Maybe Name, Type, [Name]))]
+ Idris.Elab.Term: [resultTerm] :: ElabResult -> Term
+ Idris.Elab.Term: [resultTyDecls] :: ElabResult -> [RDeclInstructions]
+ Idris.Elab.Term: instance GHC.Classes.Eq Idris.Elab.Term.ElabMode
+ Idris.Elab.Term: tcRecoverable :: ElabMode -> Err -> Bool
+ Idris.Elab.Utils: checkDeprecated :: FC -> Name -> Idris ()
+ Idris.Erasure: instance GHC.Classes.Eq Idris.Erasure.Arg
+ Idris.Erasure: instance GHC.Classes.Ord Idris.Erasure.Arg
+ Idris.Erasure: instance GHC.Show.Show Idris.Erasure.Arg
+ Idris.Erasure: instance GHC.Show.Show Idris.Erasure.VarInfo
+ Idris.Help: instance GHC.Show.Show Idris.Help.CmdArg
+ Idris.IBC: instance Data.Binary.Class.Binary Cheapskate.Types.CodeAttr
+ Idris.IBC: instance Data.Binary.Class.Binary Cheapskate.Types.ListType
+ Idris.IBC: instance Data.Binary.Class.Binary Cheapskate.Types.NumWrapper
+ Idris.IBC: instance Data.Binary.Class.Binary Cheapskate.Types.Options
+ Idris.IBC: instance Data.Binary.Class.Binary Idris.AbsSyntaxTree.ArgOpt
+ Idris.IBC: instance Data.Binary.Class.Binary Idris.AbsSyntaxTree.CGInfo
+ Idris.IBC: instance Data.Binary.Class.Binary Idris.AbsSyntaxTree.ClassInfo
+ Idris.IBC: instance Data.Binary.Class.Binary Idris.AbsSyntaxTree.Codegen
+ Idris.IBC: instance Data.Binary.Class.Binary Idris.AbsSyntaxTree.FixDecl
+ Idris.IBC: instance Data.Binary.Class.Binary Idris.AbsSyntaxTree.Fixity
+ Idris.IBC: instance Data.Binary.Class.Binary Idris.AbsSyntaxTree.FnInfo
+ Idris.IBC: instance Data.Binary.Class.Binary Idris.AbsSyntaxTree.FnOpt
+ Idris.IBC: instance Data.Binary.Class.Binary Idris.AbsSyntaxTree.OptInfo
+ Idris.IBC: instance Data.Binary.Class.Binary Idris.AbsSyntaxTree.PAltType
+ Idris.IBC: instance Data.Binary.Class.Binary Idris.AbsSyntaxTree.PTerm
+ Idris.IBC: instance Data.Binary.Class.Binary Idris.AbsSyntaxTree.Plicity
+ Idris.IBC: instance Data.Binary.Class.Binary Idris.AbsSyntaxTree.PunInfo
+ Idris.IBC: instance Data.Binary.Class.Binary Idris.AbsSyntaxTree.RecordInfo
+ Idris.IBC: instance Data.Binary.Class.Binary Idris.AbsSyntaxTree.SSymbol
+ Idris.IBC: instance Data.Binary.Class.Binary Idris.AbsSyntaxTree.SizeChange
+ Idris.IBC: instance Data.Binary.Class.Binary Idris.AbsSyntaxTree.Static
+ Idris.IBC: instance Data.Binary.Class.Binary Idris.AbsSyntaxTree.SynContext
+ Idris.IBC: instance Data.Binary.Class.Binary Idris.AbsSyntaxTree.Syntax
+ Idris.IBC: instance Data.Binary.Class.Binary Idris.AbsSyntaxTree.SyntaxInfo
+ Idris.IBC: instance Data.Binary.Class.Binary Idris.AbsSyntaxTree.Using
+ Idris.IBC: instance Data.Binary.Class.Binary Idris.Core.CaseTree.CaseAlt
+ Idris.IBC: instance Data.Binary.Class.Binary Idris.Core.CaseTree.CaseType
+ Idris.IBC: instance Data.Binary.Class.Binary Idris.Core.CaseTree.SC
+ Idris.IBC: instance Data.Binary.Class.Binary Idris.Core.Evaluate.Accessibility
+ Idris.IBC: instance Data.Binary.Class.Binary Idris.Core.Evaluate.CaseDefs
+ Idris.IBC: instance Data.Binary.Class.Binary Idris.Core.Evaluate.CaseInfo
+ Idris.IBC: instance Data.Binary.Class.Binary Idris.Core.Evaluate.Def
+ Idris.IBC: instance Data.Binary.Class.Binary Idris.Core.Evaluate.MetaInformation
+ Idris.IBC: instance Data.Binary.Class.Binary Idris.Core.Evaluate.PReason
+ Idris.IBC: instance Data.Binary.Class.Binary Idris.Core.Evaluate.Totality
+ Idris.IBC: instance Data.Binary.Class.Binary Idris.Core.TT.DataOpt
+ Idris.IBC: instance Data.Binary.Class.Binary Idris.Core.TT.TypeInfo
+ Idris.IBC: instance Data.Binary.Class.Binary Idris.Docstrings.DocTerm
+ Idris.IBC: instance Data.Binary.Class.Binary a => Data.Binary.Class.Binary (Idris.Docstrings.Block a)
+ Idris.IBC: instance Data.Binary.Class.Binary a => Data.Binary.Class.Binary (Idris.Docstrings.Docstring a)
+ Idris.IBC: instance Data.Binary.Class.Binary a => Data.Binary.Class.Binary (Idris.Docstrings.Inline a)
+ Idris.IBC: instance Data.Binary.Class.Binary t => Data.Binary.Class.Binary (Idris.AbsSyntaxTree.DSL' t)
+ Idris.IBC: instance Data.Binary.Class.Binary t => Data.Binary.Class.Binary (Idris.AbsSyntaxTree.PArg' t)
+ Idris.IBC: instance Data.Binary.Class.Binary t => Data.Binary.Class.Binary (Idris.AbsSyntaxTree.PClause' t)
+ Idris.IBC: instance Data.Binary.Class.Binary t => Data.Binary.Class.Binary (Idris.AbsSyntaxTree.PData' t)
+ Idris.IBC: instance Data.Binary.Class.Binary t => Data.Binary.Class.Binary (Idris.AbsSyntaxTree.PDecl' t)
+ Idris.IBC: instance Data.Binary.Class.Binary t => Data.Binary.Class.Binary (Idris.AbsSyntaxTree.PDo' t)
+ Idris.IBC: instance Data.Binary.Class.Binary t => Data.Binary.Class.Binary (Idris.AbsSyntaxTree.PTactic' t)
+ Idris.IBC: instance Data.Binary.Class.Binary t => Data.Binary.Class.Binary (Idris.AbsSyntaxTree.ProvideWhat' t)
+ Idris.IBC: instance GHC.Show.Show Idris.IBC.IBCFile
+ Idris.IdeMode: instance (Idris.IdeMode.SExpable a, Idris.IdeMode.SExpable b) => Idris.IdeMode.SExpable (a, b)
+ Idris.IdeMode: instance (Idris.IdeMode.SExpable a, Idris.IdeMode.SExpable b, Idris.IdeMode.SExpable c) => Idris.IdeMode.SExpable (a, b, c)
+ Idris.IdeMode: instance (Idris.IdeMode.SExpable a, Idris.IdeMode.SExpable b, Idris.IdeMode.SExpable c, Idris.IdeMode.SExpable d) => Idris.IdeMode.SExpable (a, b, c, d)
+ Idris.IdeMode: instance (Idris.IdeMode.SExpable a, Idris.IdeMode.SExpable b, Idris.IdeMode.SExpable c, Idris.IdeMode.SExpable d, Idris.IdeMode.SExpable e) => Idris.IdeMode.SExpable (a, b, c, d, e)
+ Idris.IdeMode: instance GHC.Classes.Eq Idris.IdeMode.SExp
+ Idris.IdeMode: instance GHC.Show.Show Idris.IdeMode.Opt
+ Idris.IdeMode: instance GHC.Show.Show Idris.IdeMode.SExp
+ Idris.IdeMode: instance Idris.IdeMode.SExpable GHC.Base.String
+ Idris.IdeMode: instance Idris.IdeMode.SExpable GHC.Integer.Type.Integer
+ Idris.IdeMode: instance Idris.IdeMode.SExpable GHC.Types.Bool
+ Idris.IdeMode: instance Idris.IdeMode.SExpable GHC.Types.Int
+ Idris.IdeMode: instance Idris.IdeMode.SExpable Idris.Core.TT.FC
+ Idris.IdeMode: instance Idris.IdeMode.SExpable Idris.Core.TT.Name
+ Idris.IdeMode: instance Idris.IdeMode.SExpable Idris.Core.TT.NameOutput
+ Idris.IdeMode: instance Idris.IdeMode.SExpable Idris.Core.TT.OutputAnnotation
+ Idris.IdeMode: instance Idris.IdeMode.SExpable Idris.IdeMode.SExp
+ Idris.IdeMode: instance Idris.IdeMode.SExpable a => Idris.IdeMode.SExpable (GHC.Base.Maybe a)
+ Idris.IdeMode: instance Idris.IdeMode.SExpable a => Idris.IdeMode.SExpable [a]
+ Idris.Imports: instance GHC.Classes.Eq Idris.Imports.IFileType
+ Idris.Imports: instance GHC.Show.Show Idris.Imports.IFileType
+ Idris.Output: instance System.Console.Haskeline.MonadException.MonadException m => System.Console.Haskeline.MonadException.MonadException (Control.Monad.Trans.Except.ExceptT Idris.Core.TT.Err m)
+ Idris.ParseExpr: instance GHC.Show.Show Idris.ParseExpr.SynMatch
+ Idris.ParseExpr: warnTacticDeprecation :: FC -> IdrisParser ()
+ Idris.ParseHelpers: [runInnerParser] :: IdrisInnerParser a -> Parser a
+ Idris.ParseHelpers: instance GHC.Base.Alternative Idris.ParseHelpers.IdrisInnerParser
+ Idris.ParseHelpers: instance GHC.Base.Applicative Idris.ParseHelpers.IdrisInnerParser
+ Idris.ParseHelpers: instance GHC.Base.Functor Idris.ParseHelpers.IdrisInnerParser
+ Idris.ParseHelpers: instance GHC.Base.Monad Idris.ParseHelpers.IdrisInnerParser
+ Idris.ParseHelpers: instance GHC.Base.MonadPlus Idris.ParseHelpers.IdrisInnerParser
+ Idris.ParseHelpers: instance GHC.Base.Monoid a => GHC.Base.Monoid (Idris.ParseHelpers.IdrisInnerParser a)
+ Idris.ParseHelpers: instance Idris.ParseHelpers.HasLastTokenSpan Idris.ParseHelpers.IdrisParser
+ Idris.ParseHelpers: instance Text.Parser.Char.CharParsing Idris.ParseHelpers.IdrisInnerParser
+ Idris.ParseHelpers: instance Text.Parser.Combinators.Parsing Idris.ParseHelpers.IdrisInnerParser
+ Idris.ParseHelpers: instance Text.Parser.LookAhead.LookAheadParsing Idris.ParseHelpers.IdrisInnerParser
+ Idris.ParseHelpers: instance Text.Parser.Token.TokenParsing Idris.ParseHelpers.IdrisInnerParser
+ Idris.ParseHelpers: instance Text.Parser.Token.TokenParsing Idris.ParseHelpers.IdrisParser
+ Idris.ParseHelpers: instance Text.Trifecta.Combinators.DeltaParsing Idris.ParseHelpers.IdrisInnerParser
+ Idris.ParseHelpers: instance Text.Trifecta.Combinators.MarkParsing Text.Trifecta.Delta.Delta Idris.ParseHelpers.IdrisInnerParser
+ Idris.Parser: [import_location] :: ImportInfo -> FC
+ Idris.Parser: [import_modname_location] :: ImportInfo -> FC
+ Idris.Parser: [import_namespace] :: ImportInfo -> [Text]
+ Idris.Parser: [import_path] :: ImportInfo -> FilePath
+ Idris.Parser: [import_reexport] :: ImportInfo -> Bool
+ Idris.Parser: [import_rename] :: ImportInfo -> Maybe (String, FC)
+ Idris.PartialEval: instance GHC.Classes.Eq Idris.PartialEval.PEArgType
+ Idris.PartialEval: instance GHC.Show.Show Idris.PartialEval.PEArgType
+ Idris.Primitives: [p_arity] :: Prim -> Int
+ Idris.Primitives: [p_def] :: Prim -> [Const] -> Maybe Const
+ Idris.Primitives: [p_lexp] :: Prim -> (Int, PrimFn)
+ Idris.Primitives: [p_name] :: Prim -> Name
+ Idris.Primitives: [p_total] :: Prim -> Totality
+ Idris.Primitives: [p_type] :: Prim -> Type
+ Idris.Providers: instance GHC.Base.Functor Idris.Providers.Provided
+ Idris.Providers: instance GHC.Classes.Eq a => GHC.Classes.Eq (Idris.Providers.Provided a)
+ Idris.Providers: instance GHC.Show.Show a => GHC.Show.Show (Idris.Providers.Provided a)
+ Idris.REPLParser: setOptions :: [(String, Opt)]
+ Idris.Reflection: [argName] :: RFunArg -> Name
+ Idris.Reflection: [argPlicity] :: RFunArg -> RPlicity
+ Idris.Reflection: [argTy] :: RFunArg -> Raw
+ Idris.Reflection: [erasure] :: RFunArg -> RErasure
+ Idris.Reflection: instance GHC.Show.Show Idris.Reflection.RCtorArg
+ Idris.Reflection: instance GHC.Show.Show Idris.Reflection.RDatatype
+ Idris.Reflection: instance GHC.Show.Show Idris.Reflection.RErasure
+ Idris.Reflection: instance GHC.Show.Show Idris.Reflection.RFunArg
+ Idris.Reflection: instance GHC.Show.Show Idris.Reflection.RFunClause
+ Idris.Reflection: instance GHC.Show.Show Idris.Reflection.RFunDefn
+ Idris.Reflection: instance GHC.Show.Show Idris.Reflection.RPlicity
+ Idris.Reflection: instance GHC.Show.Show Idris.Reflection.RTyConArg
+ Idris.Reflection: instance GHC.Show.Show Idris.Reflection.RTyDecl
+ Idris.Reflection: reflectList :: Raw -> [Raw] -> Raw
+ Idris.Reflection: reifyFC :: Term -> ElabD FC
+ Idris.TypeSearch: instance GHC.Base.Monoid Idris.TypeSearch.AsymMods
+ Idris.TypeSearch: instance GHC.Base.Monoid Idris.TypeSearch.Score
+ Idris.TypeSearch: instance GHC.Base.Monoid a => GHC.Base.Monoid (Idris.TypeSearch.Sided a)
+ Idris.TypeSearch: instance GHC.Classes.Eq Idris.TypeSearch.AsymMods
+ Idris.TypeSearch: instance GHC.Classes.Eq Idris.TypeSearch.Score
+ Idris.TypeSearch: instance GHC.Classes.Eq a => GHC.Classes.Eq (Idris.TypeSearch.Sided a)
+ Idris.TypeSearch: instance GHC.Classes.Ord Idris.TypeSearch.Score
+ Idris.TypeSearch: instance GHC.Show.Show Idris.TypeSearch.AsymMods
+ Idris.TypeSearch: instance GHC.Show.Show Idris.TypeSearch.Score
+ Idris.TypeSearch: instance GHC.Show.Show Idris.TypeSearch.State
+ Idris.TypeSearch: instance GHC.Show.Show a => GHC.Show.Show (Idris.TypeSearch.Sided a)
+ Util.DynamicLinker: [fun_handle] :: ForeignFun -> ()
+ Util.DynamicLinker: [fun_name] :: ForeignFun -> String
+ Util.DynamicLinker: [lib_handle] :: DynamicLib -> ()
+ Util.DynamicLinker: [lib_name] :: DynamicLib -> String
+ Util.DynamicLinker: instance GHC.Classes.Eq Util.DynamicLinker.DynamicLib
- IRTS.Lang: usedArg :: Eq t => [t] -> t -> [t]
+ IRTS.Lang: usedArg :: (Eq t1, Foldable t) => t t1 -> t1 -> [t1]
- Idris.AbsSyntaxTree: IState :: Context -> Set ConstraintFC -> [FixDecl] -> Ctxt [PArg] -> Ctxt [Bool] -> Ctxt ClassInfo -> Ctxt RecordInfo -> Ctxt DSL -> Ctxt OptInfo -> Ctxt TypeInfo -> Ctxt [Name] -> Ctxt ([([Name], Term, Term)], [PTerm]) -> Ctxt [FnOpt] -> Ctxt CGInfo -> Ctxt [Name] -> Ctxt (Docstring DocTerm, [(Name, Docstring DocTerm)]) -> Ctxt (Docstring DocTerm) -> Ctxt TIData -> Ctxt FnInfo -> Ctxt [(Term, Term)] -> Ctxt [Name] -> [(FC, Name)] -> [(FC, Name)] -> [(FC, String)] -> IOption -> Int -> [((FilePath, Int), PTerm)] -> [(Name, (Maybe Name, Int, [Name], Bool))] -> [Name] -> [(Term, Term)] -> SyntaxRules -> [String] -> [FilePath] -> [(Name, (Int, PrimFn))] -> [(Codegen, FilePath)] -> [(Codegen, String)] -> [(Codegen, String)] -> [(Codegen, String)] -> [(FilePath, Bool)] -> [(Name, (Bool, [String]))] -> Maybe FC -> [(FC, Err)] -> Maybe Name -> [Int] -> [Maybe Int] -> Maybe FC -> Maybe FC -> [(Name, Maybe Accessibility)] -> Accessibility -> Bool -> [IBCWrite] -> Maybe String -> [DynamicLib] -> [LanguageExt] -> OutputMode -> Bool -> ColourTheme -> [Name] -> (Int, Ctxt (Int, Name)) -> Ctxt (Map Name (Set Name)) -> Map [Text] [Text] -> ConsoleWidth -> Set Name -> Set (Name, Int) -> [(Name, Int)] -> Maybe (Map Name [Name]) -> Maybe (Map Name [Name]) -> [Name] -> [(Name, Bool)] -> Map Name Name -> [Name] -> [(FC, OutputAnnotation)] -> [(FC, OutputAnnotation)] -> IState
+ Idris.AbsSyntaxTree: IState :: Context -> Set ConstraintFC -> [FixDecl] -> Ctxt [PArg] -> Ctxt [Bool] -> Ctxt ClassInfo -> Ctxt RecordInfo -> Ctxt DSL -> Ctxt OptInfo -> Ctxt TypeInfo -> Ctxt [Name] -> Ctxt ([([Name], Term, Term)], [PTerm]) -> Ctxt [FnOpt] -> Ctxt CGInfo -> Ctxt [Name] -> Ctxt (Docstring DocTerm, [(Name, Docstring DocTerm)]) -> Ctxt (Docstring DocTerm) -> Ctxt TIData -> Ctxt FnInfo -> Ctxt [(Term, Term)] -> Ctxt [Name] -> [(FC, Name)] -> [(FC, Name)] -> [(FC, String)] -> IOption -> Int -> [((FilePath, Int), PTerm)] -> [(Name, (Maybe Name, Int, [Name], Bool))] -> [Name] -> [(Term, Term)] -> SyntaxRules -> [String] -> [FilePath] -> [(Name, (Int, PrimFn))] -> [(Codegen, FilePath)] -> [(Codegen, String)] -> [(Codegen, String)] -> [(Codegen, String)] -> [(FilePath, Bool)] -> [(Name, (Bool, [String]))] -> Maybe FC -> [(FC, Err)] -> Maybe Name -> [Int] -> [Maybe Int] -> Maybe FC -> Maybe FC -> [(Name, Maybe Accessibility)] -> Accessibility -> Bool -> [IBCWrite] -> Maybe String -> [DynamicLib] -> [LanguageExt] -> OutputMode -> Bool -> ColourTheme -> [Name] -> (Int, Ctxt (Int, Name)) -> Ctxt (Map Name (Set Name)) -> Map [Text] [Text] -> ConsoleWidth -> Set Name -> Set (Name, Int) -> [(Name, Int)] -> Maybe (Map Name [Name]) -> Maybe (Map Name [Name]) -> [Name] -> [(Name, Bool)] -> Map Name Name -> [Name] -> [(FC, OutputAnnotation)] -> [(FC, OutputAnnotation)] -> Ctxt String -> IState
- Idris.CaseSplit: getClause :: Int -> Name -> FilePath -> Idris String
+ Idris.CaseSplit: getClause :: Int -> Name -> Name -> FilePath -> Idris String
- Idris.CaseSplit: replaceSplits :: String -> [[(Name, PTerm)]] -> Idris [String]
+ Idris.CaseSplit: replaceSplits :: String -> [[(Name, PTerm)]] -> Bool -> Idris [String]
- Idris.CaseSplit: splitOnLine :: Int -> Name -> FilePath -> Idris [[(Name, PTerm)]]
+ Idris.CaseSplit: splitOnLine :: Int -> Name -> FilePath -> Idris (Bool, [[(Name, PTerm)]])
- Idris.Chaser: buildTree :: [FilePath] -> FilePath -> Idris [ModuleTree]
+ Idris.Chaser: buildTree :: [FilePath] -> [(FilePath, [ImportInfo])] -> FilePath -> Idris [ModuleTree]
- Idris.Core.Elaborate: errAt :: String -> Name -> Elab' aux a -> Elab' aux a
+ Idris.Core.Elaborate: errAt :: String -> Name -> Maybe Type -> Elab' aux a -> Elab' aux a
- Idris.Core.ProofState: dropGiven :: Eq a => [a] -> [(a, TT a)] -> [a] -> [(a, TT a)]
+ Idris.Core.ProofState: dropGiven :: (Eq a, Foldable t, Foldable t1) => t1 a -> [(a, TT a)] -> t a -> [(a, TT a)]
- Idris.Core.ProofState: keepGiven :: Eq a => [a] -> [(a, TT a)] -> [a] -> [(a, TT a)]
+ Idris.Core.ProofState: keepGiven :: (Eq a, Foldable t, Foldable t1) => t1 a -> [(a, TT a)] -> t a -> [(a, TT a)]
- Idris.Core.TT: CaseN :: !Name -> SpecialName
+ Idris.Core.TT: CaseN :: !FC' -> !Name -> SpecialName
- Idris.Core.TT: Elaborating :: String -> Name -> (Err' t) -> Err' t
+ Idris.Core.TT: Elaborating :: String -> Name -> (Maybe t) -> (Err' t) -> Err' t
- Idris.Core.TT: Impl :: Bool -> ImplicitInfo
+ Idris.Core.TT: Impl :: Bool -> Bool -> ImplicitInfo
- Idris.Core.TT: showEnvDbg :: (Show a, Eq a) => [(a, Binder (TT a))] -> TT a -> [Char]
+ Idris.Core.TT: showEnvDbg :: (Eq a, Show a) => [(a, Binder (TT a))] -> TT a -> [Char]
- Idris.Elab.Clause: propagateParams :: IState -> [Name] -> Type -> PTerm -> PTerm
+ Idris.Elab.Clause: propagateParams :: IState -> [Name] -> Type -> [Name] -> PTerm -> PTerm
- Idris.Elab.Term: buildTC :: IState -> ElabInfo -> ElabMode -> FnOpts -> Name -> PTerm -> ElabD ElabResult
+ Idris.Elab.Term: buildTC :: IState -> ElabInfo -> ElabMode -> FnOpts -> Name -> [Name] -> PTerm -> ElabD ElabResult
- Idris.Elab.Utils: getFlexInType :: IState -> [Name] -> [Name] -> TT Name -> [Name]
+ Idris.Elab.Utils: getFlexInType :: Foldable t => IState -> [Name] -> t Name -> TT Name -> [Name]
- Idris.Elab.Utils: paramNames :: Eq t => [TT t] -> [t] -> [Int] -> [t]
+ Idris.Elab.Utils: paramNames :: (Eq t, Foldable t1) => [TT t] -> t1 t -> [Int] -> [t]
- Idris.ParseExpr: bindsymbol :: (DeltaParsing m, LookAheadParsing m) => [ArgOpt] -> Static -> t -> m Plicity
+ Idris.ParseExpr: bindsymbol :: (LookAheadParsing m, DeltaParsing m) => [ArgOpt] -> Static -> t -> m Plicity
- Idris.ParseHelpers: identifier :: MonadicParsing m => m (String, FC)
+ Idris.ParseHelpers: identifier :: (MonadicParsing m) => m (String, FC)
- Util.System: tempfile :: IO (FilePath, Handle)
+ Util.System: tempfile :: String -> IO (FilePath, Handle)
Files
- CHANGELOG +33/−4
- CONTRIBUTING.md +1/−1
- CONTRIBUTORS +2/−0
- Makefile +1/−1
- idris.cabal +27/−4
- jsrts/Runtime-browser.js +4/−0
- libs/Makefile +6/−1
- libs/base/Control/Catchable.idr +4/−4
- libs/base/Control/IOExcept.idr +10/−19
- libs/base/Data/Fin.idr +2/−20
- libs/base/Data/HVect.idr +9/−9
- libs/base/Data/String.idr +54/−0
- libs/base/Data/Vect.idr +5/−5
- libs/base/Debug/Error.idr +1/−1
- libs/base/Language/Reflection/Utils.idr +13/−19
- libs/base/base.ipkg +2/−2
- libs/contrib/Data/Heap.idr +10/−19
- libs/contrib/Network/Socket.idr +0/−4
- libs/effects/Effect/Exception.idr +2/−1
- libs/effects/Effect/File.idr +74/−29
- libs/effects/Effect/Logging/Category.idr +0/−3
- libs/effects/Effect/Perf.idr +230/−0
- libs/effects/Effect/Random.idr +7/−7
- libs/effects/Effects.idr +34/−27
- libs/effects/effects.ipkg +1/−0
- libs/prelude/IO.idr +15/−6
- libs/prelude/Language/Reflection.idr +90/−55
- libs/prelude/Language/Reflection/Elab.idr +203/−152
- libs/prelude/Prelude.idr +1/−0
- libs/prelude/Prelude/Applicative.idr +4/−0
- libs/prelude/Prelude/File.idr +81/−44
- libs/prelude/Prelude/Functor.idr +10/−8
- libs/prelude/Prelude/Interactive.idr +41/−14
- libs/prelude/Prelude/Monad.idr +1/−1
- libs/prelude/Prelude/Nat.idr +10/−10
- libs/prelude/Prelude/Show.idr +5/−0
- libs/prelude/Prelude/Stream.idr +9/−0
- libs/prelude/prelude.ipkg +1/−1
- libs/pruviloj/Makefile +21/−0
- libs/pruviloj/Pruviloj.idr +8/−0
- libs/pruviloj/Pruviloj/Core.idr +268/−0
- libs/pruviloj/Pruviloj/Derive/DecEq.idr +198/−0
- libs/pruviloj/Pruviloj/Derive/Eliminators.idr +268/−0
- libs/pruviloj/Pruviloj/Disjoint.idr +85/−0
- libs/pruviloj/Pruviloj/Induction.idr +157/−0
- libs/pruviloj/Pruviloj/Injective.idr +122/−0
- libs/pruviloj/Pruviloj/Internals.idr +154/−0
- libs/pruviloj/Pruviloj/Internals/TyConInfo.idr +108/−0
- libs/pruviloj/Pruviloj/Renamers.idr +42/−0
- libs/pruviloj/pruviloj.ipkg +13/−0
- rts/idris_main.c +1/−0
- rts/idris_rts.c +16/−0
- rts/idris_rts.h +8/−0
- rts/idris_stdfgn.c +20/−0
- rts/idris_stdfgn.h +2/−0
- src/IRTS/CodegenC.hs +3/−3
- src/IRTS/CodegenJavaScript.hs +14/−6
- src/IRTS/Compiler.hs +2/−2
- src/Idris/AbsSyntax.hs +27/−7
- src/Idris/AbsSyntaxTree.hs +11/−5
- src/Idris/CaseSplit.hs +59/−32
- src/Idris/Chaser.hs +80/−37
- src/Idris/CmdOptions.hs +2/−0
- src/Idris/Completion.hs +2/−8
- src/Idris/Core/Binary.hs +27/−22
- src/Idris/Core/DeepSeq.hs +9/−6
- src/Idris/Core/Elaborate.hs +6/−6
- src/Idris/Core/Evaluate.hs +10/−1
- src/Idris/Core/Execute.hs +11/−0
- src/Idris/Core/ProofState.hs +16/−8
- src/Idris/Core/TT.hs +52/−25
- src/Idris/Core/Typecheck.hs +0/−3
- src/Idris/Core/Unify.hs +1/−1
- src/Idris/Core/WHNF.hs +8/−8
- src/Idris/Coverage.hs +2/−2
- src/Idris/DSL.hs +1/−1
- src/Idris/DataOpts.hs +0/−1
- src/Idris/DeepSeq.hs +6/−3
- src/Idris/Delaborate.hs +18/−4
- src/Idris/Directives.hs +4/−1
- src/Idris/Elab/Class.hs +1/−1
- src/Idris/Elab/Clause.hs +78/−58
- src/Idris/Elab/Data.hs +19/−9
- src/Idris/Elab/Instance.hs +1/−1
- src/Idris/Elab/Record.hs +1/−1
- src/Idris/Elab/Term.hs +163/−104
- src/Idris/Elab/Transform.hs +1/−1
- src/Idris/Elab/Type.hs +5/−4
- src/Idris/Elab/Utils.hs +16/−0
- src/Idris/Elab/Value.hs +2/−1
- src/Idris/IBC.hs +11/−4
- src/Idris/Interactive.hs +34/−17
- src/Idris/ParseData.hs +12/−2
- src/Idris/ParseExpr.hs +13/−3
- src/Idris/ParseHelpers.hs +2/−1
- src/Idris/Parser.hs +32/−12
- src/Idris/ProofSearch.hs +16/−9
- src/Idris/Prover.hs +24/−20
- src/Idris/REPL.hs +44/−24
- src/Idris/REPLParser.hs +26/−13
- src/Idris/Reflection.hs +36/−40
- src/Pkg/PParser.hs +81/−31
- src/Pkg/Package.hs +3/−6
- src/Util/System.hs +4/−3
- test/basic002/expected +4/−0
- test/basic002/run +1/−1
- test/basic002/test006.idr +8/−8
- test/basic006/expected +4/−1
- test/basic009/expected +4/−1
- test/basic010/Main.idr +13/−13
- test/basic010/expected +3/−3
- test/basic016/CycleA.idr +4/−0
- test/basic016/CycleB.idr +5/−0
- test/basic016/CycleC.idr +4/−0
- test/basic016/expected +1/−0
- test/basic016/run +3/−0
- test/docs003/expected +5/−3
- test/dsl001/test001.idr +10/−10
- test/dsl002/Resimp.idr +15/−15
- test/dsl002/test014.idr +6/−5
- test/effects003/expected +2/−0
- test/effects003/hangman.idr +5/−1
- test/effects003/run +1/−1
- test/error003/expected +4/−1
- test/error004/expected +8/−2
- test/error005/expected +20/−5
- test/ffi004/test026.idr +2/−1
- test/interactive001/expected +6/−0
- test/interactive001/input +2/−0
- test/interactive001/test032.idr +9/−0
- test/interactive010/expected +22/−0
- test/interactive010/input +10/−0
- test/interactive010/run +2/−0
- test/io001/test004.idr +4/−4
- test/meta002/AgdaStyleReflection.idr +247/−0
- test/meta002/Deriving.idr +31/−0
- test/meta002/Tacs.idr +12/−4
- test/meta002/expected +9/−2
- test/meta002/run +3/−1
- test/pkg001/Main.idr +8/−0
- test/pkg001/expected +0/−0
- test/pkg001/run +3/−0
- test/pkg001/test.ipkg +7/−0
- test/proof001/expected +4/−0
- test/proof001/run +1/−1
- test/proof002/expected +9/−1
- test/proof003/Parity.idr +6/−6
- test/proof003/expected +12/−0
- test/proof003/run +1/−1
- test/proof003/test015.idr +22/−22
- test/proof005/DefaultArgSubstitutionSuccess.idr +4/−4
- test/proof006/DefaultArgSubstitutionSyntax.idr +4/−4
- test/proof007/expected +3/−1
- test/proof008/expected +2/−0
- test/proof008/run +1/−1
- test/proof009/expected +1/−0
- test/proofsearch002/Process.idr +3/−3
- test/pruviloj001/expected +0/−0
- test/pruviloj001/pruviloj001.idr +69/−0
- test/pruviloj001/run +3/−0
- test/quasiquote003/expected +4/−1
- test/quasiquote004/expected +9/−1
- test/quasiquote006/expected +9/−3
- test/reg001/reg001.idr +6/−1
- test/reg006/expected +1/−1
- test/reg007/expected +4/−1
- test/reg017/expected +4/−0
- test/reg017/run +1/−1
- test/reg023/expected +4/−1
- test/reg028/expected +2/−0
- test/reg035/reg035a.lidr +5/−5
- test/reg041/expected +1/−1
- test/reg041/ott.idr +23/−23
- test/reg044/expected +6/−1
- test/reg046/reg046.idr +7/−7
- test/reg047/reg047.idr +2/−2
- test/reg047/reg047a.idr +3/−3
- test/reg049/expected +4/−1
- test/sourceLocation001/expected +8/−0
- test/sourceLocation001/run +1/−1
- test/syntax001/expected +8/−2
- test/totality002/expected +2/−0
- test/totality002/test017.idr +6/−6
- test/totality003/run +2/−2
- test/totality004/totality004.idr +7/−7
- test/totality004/totality004a.idr +7/−7
- test/totality008/expected +1/−1
- test/totality008/totality008.idr +4/−4
- test/totality009/expected +8/−8
- test/tutorial002/expected +6/−0
- test/tutorial002/run +1/−1
- test/tutorial002/tutorial002.idr +15/−15
- test/tutorial004/expected +4/−0
- test/tutorial004/run +1/−1
- test/tutorial006/expected +8/−3
- test/tutorial006/tutorial006b.idr +6/−6
CHANGELOG view
@@ -9,31 +9,60 @@ for defining new names. `{n} still quotes n to an existing name in scope. * A new primitive operator prim__strSubstr for more efficient extraction of substrings. External code generators should implement this.+* The previous syntax for tactic proofs and the previous interactive prover+ are now deprecated in favour of reflected elaboration. They will be removed+ at some point in the future. * Changed scoping rules for unbound implicits: any name which would be a valid unbound implicit is now *always* an unbound implicit. This is much more resilient to changes in inputs, but does require that function names be explicitly qualified when in argument position.+* Name binding in patterns follows the same rule as name binding for implicits+ in types: names which begin with lower case letters, not applied to any+ arguments, are treated as bound pattern variables.+* Added %deprecate directive, which gives a warning and a message when a + deprecated name is referenced. Library updates --------------- * The 'Neg' class now represents numeric types which can be negative. As-such, the (-) operator and 'abs' have been moved there from 'Num'.+ such, the (-) operator and 'abs' have been moved there from 'Num'. * A special version of (-) on 'Nat' requires that the second argument is-smaller than or equal to the first. 'minus' retains the old behaviour,-returning Z if there is an underflow.+ smaller than or equal to the first. 'minus' retains the old behaviour,+ returning Z if there is an underflow.+* The (+), (-), and (*) operations on Fin have been removed. * New Logging Effects have been added to facilitate logging of effectful programmes.+* Elaborator reflection is now a part of the prelude. It is no longer+ necessary to import Language.Reflection.Elab.+* The `PERF` effect allows for simple performance metrics to be collected+ from Effectful programs.+* Some constructors that never actually occurred have been removed from+ the TT and Raw reflection datatypes in Language.Reflection.+* File IO operations (for example openFile/fread/fwrite) now return + 'Either FileError ty' where the return type was previously 'ty' to indicate+ that they may fail. Tool updates ------------ * Records are now shown as records in :doc, rather than as the underlying datatype+* iPKG files have a new option `pkgs` which takes a comma-separated list+ of package names that the idris project depends on. This reduces bloat+ in the `opts` option with multiple package declarations.+* iPKG files now allow `executable = "your filename here"` in addition to+ the existing `executable = yourFilenameHere` style. While the unquoted+ version is limited to filenames that look like namespaced Idris identifiers+ (`your.filename.here`), the quoted version accepts any valid filename.+* Add definition command (\d in Vim, Ctrl-Alt-A in Atom, C-c C-s in Emacs) now+ adds missing clauses if there is already a definition. Miscellaneous updates ---------------------+* Disable the deprecation warnings for %elim and old-style tactic scripts+ with the --no-elim-deprecation-warnings and --no-tactic-deprecation-warnings+ flags. -[None so far] New in 0.9.19: --------------
CONTRIBUTING.md view
@@ -166,4 +166,4 @@ * [General GitHub Documentation](https://help.github.com/). -Adapted from the most excellent contributing files from the [Puppet project](https://github.com/puppetlabs/puppet) and [Factroy Girl Rails](https://github.com/thoughtbot/factory_girl_rails/blob/master/CONTRIBUTING.md)+Adapted from the most excellent contributing files from the [Puppet project](https://github.com/puppetlabs/puppet) and [Factory Girl Rails](https://github.com/thoughtbot/factory_girl_rails/blob/master/CONTRIBUTING.md)
CONTRIBUTORS view
@@ -15,6 +15,7 @@ Guglielmo Fachini Simon Fowler Google+Zack Grannan Cezar Ionescu Heath Johns Irene Knapp@@ -35,6 +36,7 @@ Seo Sanghyeon Benjamin Saunders Alexander Shabalin+Jeremy W. Sherman Timo Petteri Sinnemäki JP Smith startling
Makefile view
@@ -43,7 +43,7 @@ $(CABAL) install $(CABALFLAGS) linecount:- wc -l src/Idris/*.hs src/Idris/Core/*.hs src/IRTS/*.hs src/Pkg/*.hs+ wc -l src/Idris/*.hs src/Idris/Elab/*.hs src/Idris/Core/*.hs src/IRTS/*.hs src/Pkg/*.hs src/Util/*.hs #Note: this doesn't yet link to Hackage properly doc: dist/setup-config
idris.cabal view
@@ -1,5 +1,5 @@ Name: idris-Version: 0.9.19.1+Version: 0.9.20 License: BSD3 License-file: LICENSE Author: Edwin Brady@@ -140,9 +140,16 @@ libs/effects/Makefile libs/effects/effects.ipkg libs/effects/Effect/*.idr- libs/effects/Effect/Logging/*.idr+ libs/effects/Effect/Logging/*.idr libs/effects/*.idr + libs/pruviloj/Makefile+ libs/pruviloj/pruviloj.ipkg+ libs/pruviloj/*.idr+ libs/pruviloj/Pruviloj/*.idr+ libs/pruviloj/Pruviloj/Derive/*.idr+ libs/pruviloj/Pruviloj/Internals/*.idr+ test/Makefile test/runtest.pl test/reg001/run@@ -349,6 +356,9 @@ test/basic015/run test/basic015/*.idr test/basic015/expected+ test/basic016/run+ test/basic016/*.idr+ test/basic016/expected test/bignum001/run test/bignum001/*.idr@@ -528,6 +538,9 @@ test/interactive009/input test/interactive009/*.idr test/interactive009/expected+ test/interactive010/expected+ test/interactive010/input+ test/interactive010/run test/io001/run test/io001/*.idr@@ -560,6 +573,11 @@ test/primitives003/*.idr test/primitives003/expected + test/pkg001/run+ test/pkg001/test.ipkg+ test/pkg001/*.idr+ test/pkg001/expected+ test/proof001/run test/proof001/*.idr test/proof001/expected@@ -591,7 +609,7 @@ test/proof010/run test/proof010/*.idr test/proof010/expected- + test/proofsearch001/run test/proofsearch001/*.idr test/proofsearch001/expected@@ -602,6 +620,10 @@ test/proofsearch003/*.idr test/proofsearch003/expected + test/pruviloj001/run+ test/pruviloj001/*.idr+ test/pruviloj001/expected+ test/quasiquote001/run test/quasiquote001/*.idr test/quasiquote001/expected@@ -938,7 +960,7 @@ , uniplate >=1.6 && < 1.7 , unordered-containers < 0.3 , utf8-string < 1.1- , vector < 0.11+ , vector < 0.12 , vector-binary-instances < 0.3 , zip-archive > 0.2.3.5 && < 0.2.4 , zlib < 0.6@@ -974,6 +996,7 @@ cpp-options: -DIDRIS_FFI if flag(GMP) build-depends: libffi < 0.2+ extra-libraries: gmp cpp-options: -DIDRIS_GMP if flag(curses) build-depends: hscurses < 1.5
jsrts/Runtime-browser.js view
@@ -1,3 +1,7 @@+var i$getLine = function() {+ return prompt("Prelude.getLine");+}+ var i$putStr = function(s) { console.log(s); };
libs/Makefile view
@@ -3,6 +3,7 @@ $(MAKE) -C base build $(MAKE) -C contrib build $(MAKE) -C effects build+ $(MAKE) -C pruviloj build install:@@ -10,24 +11,28 @@ $(MAKE) -C base install $(MAKE) -C contrib install $(MAKE) -C effects install+ $(MAKE) -C pruviloj install clean: $(MAKE) -C prelude clean $(MAKE) -C base clean $(MAKE) -C contrib clean $(MAKE) -C effects clean+ $(MAKE) -C pruviloj clean doc: $(MAKE) -C prelude doc $(MAKE) -C base doc $(MAKE) -C contrib doc $(MAKE) -C effects doc+ $(MAKE) -C pruviloj doc doc_clean: $(MAKE) -C prelude doc_clean $(MAKE) -C base doc_clean $(MAKE) -C contrib doc_clean- $(MAKE) -C effects doc_clean+ $(MAKE) -C effects doc_clean+ $(MAKE) -C pruviloj doc_clean .PHONY: build install clean doc doc_clean
libs/base/Control/Catchable.idr view
@@ -16,14 +16,14 @@ catch (Left err) h = h err catch (Right x) h = (Right x) - throw x = Left x+ throw = Left instance Catchable (IOExcept err) err where- catch (ioM prog) h = ioM (do p' <- prog+ catch (IOM prog) h = IOM (do p' <- prog case p' of- Left e => let ioM he = h e in he+ Left e => let IOM he = h e in he Right val => return (Right val))- throw x = ioM (return (Left x))+ throw = ioe_fail instance Catchable List () where catch [] h = h ()
libs/base/Control/IOExcept.idr view
@@ -2,34 +2,25 @@ -- An IO monad with exception handling -data IOExcept : Type -> Type -> Type where- ioM : IO (Either err a) -> IOExcept err a+record IOExcept err a where+ constructor IOM+ runIOExcept : IO (Either err a) instance Functor (IOExcept e) where- map f (ioM fn) = ioM (map (map f) fn)+ map f (IOM fn) = IOM (map (map f) fn) instance Applicative (IOExcept e) where- pure x = ioM (pure (pure x))- (ioM f) <*> (ioM a) = ioM (do f' <- f; a' <- a- return (f' <*> a'))+ pure x = IOM (pure (pure x))+ (IOM f) <*> (IOM a) = IOM [| f <*> a |] instance Monad (IOExcept e) where- (ioM x) >>= k = ioM (do x' <- x;- case x' of- Right a => let (ioM ka) = k a in- ka- Left err => return (Left err))+ (IOM x) >>= f = IOM $ x >>= either (pure . Left) (runIOExcept . f) ioe_lift : IO a -> IOExcept err a-ioe_lift op = ioM (do op' <- op- return (Right op'))+ioe_lift op = IOM $ map Right op ioe_fail : err -> IOExcept err a-ioe_fail e = ioM (return (Left e))+ioe_fail e = IOM $ pure (Left e) ioe_run : IOExcept err a -> (err -> IO b) -> (a -> IO b) -> IO b-ioe_run (ioM act) err ok = do act' <- act- case act' of- Left e => err e- Right v => ok v-+ioe_run (IOM act) err ok = either err ok !act
libs/base/Data/Fin.idr view
@@ -42,7 +42,7 @@ finToNatInjective (FS m) FZ Refl impossible finToNatInjective FZ (FS n) Refl impossible finToNatInjective (FS m) (FS n) prf =- cong (finToNatInjective m n (succInjective (finToNat m) (finToNat n) prf)) + cong (finToNatInjective m n (succInjective (finToNat m) (finToNat n) prf)) instance Cast (Fin n) Nat where cast x = finToNat x@@ -94,31 +94,13 @@ compare FZ (FS _) = LT compare (FS _) FZ = GT compare (FS x) (FS y) = compare x y- + instance MinBound (Fin (S n)) where minBound = FZ instance MaxBound (Fin (S n)) where maxBound = last --||| Add two Fins, extending the bound-(+) : Fin n -> Fin m -> Fin (n + m)-(+) {n=S n} {m=m} FZ f' = rewrite plusCommutative n m in weaken (weakenN n f')-(+) (FS f) f' = FS (f + f')--||| Substract two Fins, keeping the bound of the minuend-(-) : Fin n -> Fin m -> Fin n-FZ - _ = FZ-f - FZ = f-(FS f) - (FS f') = weaken $ f - f'--||| Multiply two Fins, extending the bound-(*) : Fin n -> Fin m -> Fin (n * m)-(*) {n=Z} f f' = FinZElim f-(*) {m=Z} f f' = FinZElim f'-(*) {n=S n} {m=S m} FZ f' = FZ-(*) {n=S n} {m=S m} (FS f) f' = f' + (f * f') -- Construct a Fin from an integer literal which must fit in the given Fin
libs/base/Data/HVect.idr view
@@ -73,17 +73,17 @@ ||| Extract an arbitrary element of the correct type. ||| @ t the goal type-get : {auto p : Elem t ts} -> HVect ts -> t-get {p = Here} (x::xs) = x-get {p = There p'} (x::xs) = get {p = p'} xs+get : HVect ts -> {auto p : Elem t ts} -> t+get (x :: xs) {p = Here} = x+get (x :: xs) {p = There p'} = get {p = p'} xs ||| Replace an element with the correct type.-put : {auto p : Elem t ts} -> t -> HVect ts -> HVect ts-put {p = Here} y (x::xs) = y :: xs-put {p = There p'} y (x::xs) = x :: put {p = p'} y xs+put : t -> HVect ts -> {auto p : Elem t ts} -> HVect ts+put y (x::xs) {p = Here} = y :: xs+put y (x::xs) {p = There p'} = x :: put {p = p'} y xs ||| Update an element with the correct type.-update : {auto p : Elem t ts} -> (t -> u) -> HVect ts -> HVect (replaceByElem ts p u)-update {p = Here} f (x::xs) = f x :: xs-update {p = There p'} f (x::xs) = x :: update {p = p'} f xs+update : (t -> u) -> HVect ts -> {auto p : Elem t ts} -> HVect (replaceByElem ts p u)+update f (x::xs) {p = Here} = f x :: xs+update f (x::xs) {p = There p'} = x :: update {p = p'} f xs
+ libs/base/Data/String.idr view
@@ -0,0 +1,54 @@+module Data.String++||| Convert a positive number string to a Num.+|||+||| ```idris example+||| parsePositive "123"+||| ```+||| ```idris example+||| parsePositive {a=Int} " +123"+||| ```+parsePositive : Num a => String -> Maybe a+parsePositive s = parsePosTrimmed (trim s) + where+ parsePosTrimmed s with (strM s)+ parsePosTrimmed "" | StrNil = Nothing+ parsePosTrimmed (strCons x xs) | (StrCons x xs) = + if (x == '+') + then map fromInteger (parsePosAux (unpack xs) 0)+ else map fromInteger (parsePosAux (unpack xs) (cast (ord x - ord '0')))+ where+ parsePosAux : List Char -> Integer -> Maybe Integer+ parsePosAux [] acc = Just acc+ parsePosAux (c :: cs) acc = + if (c >= '0' && c <= '9') + then parsePosAux cs ((acc * 10) + (cast ((ord c) - (ord '0'))))+ else Nothing+++||| Convert a number string to a Num.+|||+||| ```idris example+||| parseInteger " 123"+||| ```+||| ```idris example+||| parseInteger {a=Int} " -123"+||| ```+parseInteger : (Num a, Neg a) => String -> Maybe a+parseInteger s = parseIntTrimmed (trim s) + where+ parseIntTrimmed s with (strM s)+ parseIntTrimmed "" | StrNil = Nothing+ parseIntTrimmed (strCons x xs) | (StrCons x xs) = + if (x == '-') + then map (\y => negate (fromInteger y)) (parseIntegerAux (unpack xs) 0)+ else if (x == '+') + then map fromInteger (parseIntegerAux (unpack xs) (cast {from=Int} 0))+ else map fromInteger (parseIntegerAux (unpack xs) (cast (ord x - ord '0')))+ where+ parseIntegerAux : List Char -> Integer -> Maybe Integer+ parseIntegerAux [] acc = Just acc+ parseIntegerAux (c :: cs) acc = + if (c >= '0' && c <= '9') + then parseIntegerAux cs ((acc * 10) + (cast ((ord c) - (ord '0'))))+ else Nothing
libs/base/Data/Vect.idr view
@@ -614,11 +614,11 @@ ||| @xs the vector with the desired length -- Needs to be Maybe rather than Dec, because if 'n' is unequal to m, we -- only know we don't know how to make a Vect n a, not that one can't exist.-isLength : {m : Nat} -> -- expected at run-time- (len : Nat) -> (xs : Vect m a) -> Maybe (Vect len a)-isLength {m} len xs with (decEq m len)- isLength {m = m} m xs | (Yes Refl) = Just xs- isLength {m = m} len xs | (No contra) = Nothing+exactLength : {m : Nat} -> -- expected at run-time+ (len : Nat) -> (xs : Vect m a) -> Maybe (Vect len a)+exactLength {m} len xs with (decEq m len)+ exactLength {m = m} m xs | (Yes Refl) = Just xs+ exactLength {m = m} len xs | (No contra) = Nothing ||| If the given Vect is at least the required length, return a Vect with ||| at least that length in its type, otherwise return Nothing
libs/base/Debug/Error.idr view
@@ -8,7 +8,7 @@ ||| @ loc The source location to display for the error ||| @ message The error to print partial-error : {default tactics {sourceLocation} loc : SourceLocation} ->+error : {default (%runElab sourceLocation) loc : SourceLocation} -> (message : String) -> a error {loc = FileLoc filename (line, col) _} message =
libs/base/Language/Reflection/Utils.idr view
@@ -55,13 +55,18 @@ binderTy (Lam t) = t binderTy (Pi t _) = t binderTy (Let t1 t2) = t1-binderTy (NLet t1 t2) = t1 binderTy (Hole t) = t binderTy (GHole t) = t binderTy (Guess t1 t2) = t1 binderTy (PVar t) = t binderTy (PVTy t) = t +instance Show SourceLocation where+ showPrec d (FileLoc filename line col) = showCon d "FileLoc" $ showArg filename ++ showArg line ++ showArg col++instance Eq SourceLocation where+ (FileLoc fn s e) == (FileLoc fn' s' e') = fn == fn' && s == s' && e == e'+ mutual instance Show SpecialName where showPrec d (WhereN i n1 n2) = showCon d "WhereN" $ showArg i ++@@ -70,7 +75,7 @@ showPrec d (InstanceN i ss) = showCon d "InstanceN" $ showArg i ++ showArg ss showPrec d (ParentN n s) = showCon d "ParentN" $ showArg n ++ showArg s showPrec d (MethodN n) = showCon d "MethodN" $ showArg n- showPrec d (CaseN n) = showCon d "CaseN" $ showArg n+ showPrec d (CaseN fc n) = showCon d "CaseN" $ showArg fc ++ showArg n showPrec d (ElimN n) = showCon d "ElimN" $ showArg n showPrec d (InstanceCtorN n) = showCon d "InstanceCtorN" $ showArg n showPrec d (MetaN parent meta) = showCon d "MetaN" $ showArg parent ++ showArg meta@@ -80,14 +85,12 @@ showPrec d (NS n ns) = showCon d "NS" $ showArg n ++ showArg ns showPrec d (MN i str) = showCon d "MN" $ showArg i ++ showArg str showPrec d (SN sn) = showCon d "SN" $ assert_total (showArg sn)- showPrec d NErased = "NErased" mutual instance Eq TTName where (UN str1) == (UN str2) = str1 == str2 (NS n ns) == (NS n' ns') = n == n' && ns == ns' (MN i str) == (MN i' str') = i == i' && str == str'- NErased == NErased = True (SN sn) == (SN sn') = assert_total $ sn == sn' x == y = False @@ -97,7 +100,7 @@ (InstanceN i ss) == (InstanceN i' ss') = i == i' && ss == ss' (ParentN n s) == (ParentN n' s') = n == n' && s == s' (MethodN n) == (MethodN n') = n == n'- (CaseN n) == (CaseN n') = n == n'+ (CaseN fc n) == (CaseN fc' n') = fc == fc' && n == n' (ElimN n) == (ElimN n') = n == n' (InstanceCtorN n) == (InstanceCtorN n') = n == n' (MetaN parent meta) == (MetaN parent' meta') = parent == parent' && meta == meta'@@ -196,7 +199,6 @@ showPrec d (Lam t) = showCon d "Lam" $ showArg t showPrec d (Pi t1 t2) = showCon d "Pi" $ showArg t1 ++ showArg t2 showPrec d (Let t1 t2) = showCon d "Let" $ showArg t1 ++ showArg t2- showPrec d (NLet t1 t2) = showCon d "NLet" $ showArg t1 ++ showArg t2 showPrec d (Hole t) = showCon d "Hole" $ showArg t showPrec d (GHole t) = showCon d "GHole" $ showArg t showPrec d (Guess t1 t2) = showCon d "Guess" $ showArg t1 ++ showArg t2@@ -207,7 +209,6 @@ (Lam t) == (Lam t') = t == t' (Pi t k) == (Pi t' k') = t == t' && k == k' (Let t1 t2) == (Let t1' t2') = t1 == t1' && t2 == t2'- (NLet t1 t2) == (NLet t1' t2') = t1 == t1' && t2 == t2' (Hole t) == (Hole t') = t == t' (GHole t) == (GHole t') = t == t' (Guess t1 t2) == (Guess t1' t2') = t1 == t1' && t2 == t2'@@ -223,9 +224,7 @@ my_show d (Bind n b t) = showCon d "Bind" $ showArg n ++ showArg b ++ showArg t my_show d (App t1 t2) = showCon d "App" $ showArg t1 ++ showArg t2 my_show d (TConst c) = showCon d "TConst" $ showArg c- my_show d (Proj tm i) = showCon d "Proj" $ showArg tm ++ showArg i my_show d Erased = "Erased"- my_show d Impossible = "Impossible" my_show d (TType u) = showCon d "TType" $ showArg u instance Eq TT where@@ -236,9 +235,7 @@ equalp (Bind n b t) (Bind n' b' t') = n == n' && b == b' && t == t' equalp (App t1 t2) (App t1' t2') = t1 == t1' && t2 == t2' equalp (TConst c) (TConst c') = c == c'- equalp (Proj tm i) (Proj tm' i') = tm == tm' && i == i' equalp Erased Erased = True- equalp Impossible Impossible = True equalp (TType u) (TType u') = u == u' equalp x y = False @@ -260,17 +257,17 @@ LT => Nothing GT => atIndex xs (n-1) - %assert_total fe : List TTName -> TT -> Maybe Raw fe env (P _ n _) = Just $ Var n- fe env (V i) = map Var (atIndex env i)- fe env (Bind n b sc) = [| RBind (pure n) (traverse (fe env) b) (fe (n::env) sc) |]+ fe env (V i) = [| Var (atIndex env i) |]+ fe env (Bind n b sc) = [| RBind (pure n)+ (assert_total $ traverse (fe env) b)+ (fe (n::env) sc) |] fe env (App f a) = [| RApp (fe env f) (fe env a) |] fe env (TConst c) = Just $ RConstant c- fe env (Proj tm i) = Nothing -- runtime only, not useful for metaprogramming fe env (TType i) = Just RType+ fe env (UType uni) = Just (RUType uni) fe env Erased = Just $ RConstant Forgot- fe env Impossible = Nothing instance Show Raw where showPrec = my_show@@ -279,11 +276,8 @@ my_show d (RBind n b tm) = showCon d "RBind" $ showArg n ++ showArg b ++ " " ++ my_show App tm my_show d (RApp tm tm') = showCon d "RApp" $ " " ++ my_show App tm ++ " " ++ my_show App tm' my_show d RType = "RType"- my_show d (RForce tm) = showCon d "RForce" $ " " ++ my_show App tm my_show d (RConstant c) = showCon d "RConstant" $ showArg c -instance Show SourceLocation where- showPrec d (FileLoc filename line col) = showCon d "FileLoc" $ showArg filename ++ showArg line ++ showArg col instance Show Err where showPrec d (Msg x) = showCon d "Msg" $ showArg x
libs/base/base.ipkg view
@@ -1,6 +1,6 @@ package base -opts = "--nobasepkgs --total -i ../prelude"+opts = "--nobasepkgs --total --no-elim-deprecation-warnings -i ../prelude" modules = System, Debug.Error, Debug.Trace,@@ -17,7 +17,7 @@ Data.HVect, Data.Vect.Quantifiers, Data.Complex, Data.Erased, Data.List,- Data.So,+ Data.So, Data.String, Control.Isomorphism, Control.Monad.Identity,
libs/contrib/Data/Heap.idr view
@@ -133,21 +133,21 @@ -- Properties -------------------------------------------------------------------------------- -total absurdBoolDischarge : False = True -> Void-absurdBoolDischarge p = replace {P = disjointTy} p ()- where- total disjointTy : Bool -> Type- disjointTy False = ()- disjointTy True = Void+total+absurdBoolDischarge : False = True -> Void+absurdBoolDischarge Refl impossible -total isEmptySizeZero : (h : MaxiphobicHeap a) -> (isEmpty h = True) -> size h = Z+total+isEmptySizeZero : (h : MaxiphobicHeap a) -> (isEmpty h = True) -> size h = Z isEmptySizeZero Empty p = Refl-isEmptySizeZero (Node s l e r) p = ?isEmptySizeZeroNodeAbsurd+isEmptySizeZero (Node s l e r) Refl impossible -total emptyHeapValid : Ord a => isValidHeap (empty {a}) = True+total+emptyHeapValid : Ord a => isValidHeap (empty {a}) = True emptyHeapValid = Refl -total singletonHeapValid : Ord a => (e : a) -> isValidHeap $ singleton e = True+total+singletonHeapValid : Ord a => (e : a) -> isValidHeap $ singleton e = True singletonHeapValid e = Refl {-@@ -161,16 +161,7 @@ ?mergePreservesValidHeapsBody -} ------------------------------------------------------------------------------------ Proofs--------------------------------------------------------------------------------- -isEmptySizeZeroNodeAbsurd = proof {- intros;- refine void;- refine absurdBoolDischarge;- exact p;-} -------------------------------------------------------------------------------- -- Debug
libs/contrib/Network/Socket.idr view
@@ -143,10 +143,6 @@ socketType : SocketType protocalNumber : ProtocolNumber -||| Get the C error number-getErrno : IO Int-getErrno = foreign FFI_C "idrnet_errno" (IO Int)- ||| Creates a UNIX socket with the given family, socket type and protocol ||| number. Returns either a socket or an error. socket : SocketFamily -> SocketType -> ProtocolNumber -> IO (Either SocketError Socket)
libs/effects/Effect/Exception.idr view
@@ -18,7 +18,7 @@ believe_me (exit 1) instance Handler (Exception a) (IOExcept a) where- handle _ (Raise e) k = ioM (return (Left e))+ handle _ (Raise e) k = ioe_fail e instance Handler (Exception a) (Either a) where handle _ (Raise e) k = Left e@@ -28,3 +28,4 @@ raise : a -> Eff b [EXCEPTION a] raise err = call $ Raise err+
libs/effects/Effect/File.idr view
@@ -8,8 +8,8 @@ ||| A Dependent type to describe File Handles. File handles are ||| parameterised with the current state of the file: Closed; Open for ||| reading; and Open for writing.-||| -||| @ m The file mode. +|||+||| @ m The file mode. data OpenFile : (m : Mode) -> Type where FH : File -> OpenFile m @@ -21,27 +21,27 @@ ||| Here the protocol for resource access is defined as an effect. ||| The state transitions diagram for the protocol is as follows:-||| +||| ||| digraph G {-||| +||| ||| empty; read; write; // States-||| +||| ||| empty -> read [label="Open R"]; ||| read -> empty [label="Close"]; ||| read -> read [label="ReadLine"]; ||| read -> read [label="EOF"];-||| +||| ||| empty -> write [label="Open W"]; ||| write -> empty [label="Close"]; ||| write -> write [label="WriteLine"];-||| +||| ||| } data FileIO : Effect where ||| Open a file with the specified mode.- ||| + ||| ||| Opening a file successful moves the state from 'empty' to the ||| specified mode. If not successful the state is still 'empty'.- ||| + ||| ||| @ fname The file name to be opened. ||| @ m The file mode. Open : (fname: String)@@ -51,22 +51,22 @@ False => ()) ||| Close a file.- ||| + ||| ||| Closing a file moves the state from Open to closed.- Close : sig FileIO () (OpenFile m) () + Close : sig FileIO () (OpenFile m) () ||| Read a line from the file.- ||| + ||| ||| Only files that are open for reading can be read. ReadLine : sig FileIO String (OpenFile Read)- + ||| Write a string to a file.- ||| + ||| ||| Only file that are open for writing can be written to. WriteString : String -> sig FileIO () (OpenFile Write) ||| End of file?- ||| + ||| ||| Only files open for reading can be tested for EOF EOF : sig FileIO Bool (OpenFile Read) @@ -74,29 +74,33 @@ --- An implementation of the resource access protocol for the IO Context. instance Handler FileIO IO where- handle () (Open fname m) k = do h <- openFile fname m- valid <- validFile h- if valid then k True (FH h) - else k False ()+ handle () (Open fname m) k = do Right h <- openFile fname m+ | Left err => k False ()+ k True (FH h) handle (FH h) Close k = do closeFile h k () ()- handle (FH h) ReadLine k = do str <- fread h+ handle (FH h) ReadLine k = do Right str <- fread h+ -- Need proper error handling!+ | Left err => k "" (FH h) k str (FH h)- handle (FH h) (WriteString str) k = do fwrite h str+ handle (FH h) (WriteString str) k = do Right () <- fwrite h str+ | Left err => k () (FH h) k () (FH h) handle (FH h) EOF k = do e <- feof h k e (FH h) instance Handler FileIO (IOExcept a) where- handle () (Open fname m) k = do h <- ioe_lift $ openFile fname m- valid <- ioe_lift $ validFile h- if valid then k True (FH h)- else k False ()+ handle () (Open fname m) k = do Right h <- ioe_lift $ openFile fname m+ | Left err => k False ()+ k True (FH h) handle (FH h) Close k = do ioe_lift $ closeFile h k () ()- handle (FH h) ReadLine k = do str <- ioe_lift $ fread h+ handle (FH h) ReadLine k = do Right str <- ioe_lift $ fread h+ -- Need proper error handling!+ | Left err => k "" (FH h) k str (FH h)- handle (FH h) (WriteString str) k = do ioe_lift $ fwrite h str+ handle (FH h) (WriteString str) k = do Right () <- ioe_lift $ fwrite h str+ | Left err => k () (FH h) k () (FH h) handle (FH h) EOF k = do e <- ioe_lift $ feof h k e (FH h)@@ -112,12 +116,12 @@ -- ||| Open a file with the specified mode.-||| +||| ||| @ fname The file name to be opened. ||| @ m The file mode. open : (fname : String) -> (m : Mode)- -> Eff Bool [FILE_IO ()] + -> Eff Bool [FILE_IO ()] (\res => [FILE_IO (case res of True => OpenFile m False => ())])@@ -144,4 +148,45 @@ eof : Eff Bool [FILE_IO (OpenFile Read)] eof = call $ EOF +||| Read a complete file, returning a user defined error if+||| unsuccesful.+|||+readFile : (errFunc : String -> e)+ -> (fname : String)+ -> Eff (Either e String) [FILE_IO ()]+readFile errFunc fname = do+ case !(open fname Read) of+ False => pure $ Left (errFunc fname)+ True => do+ src <- readAcc ""+ close+ pure $ Right src+ where+ readAcc : String -> Eff String [FILE_IO (OpenFile Read)]+ readAcc acc = if (not !(eof))+ then readAcc (acc ++ !(readLine))+ else pure acc++||| Write a file containing the provided string, returning a user+||| defined error if unsuccesful.+|||+writeFile : (errFunc : String -> e)+ -> (fname : String)+ -> (content : String)+ -> Eff (Either e ()) [FILE_IO ()]+writeFile errFunc fname content = do+ case !(open fname Write) of+ True => do+ writeString content+ close+ pure $ Right ()+ False => pure $ Left (errFunc fname)+++namespace Default+ readFile : String -> Eff (Either String String) [FILE_IO ()]+ readFile = File.readFile id++ writeFile : String -> String -> Eff (Either String ()) [FILE_IO ()]+ writeFile = File.writeFile id -- --------------------------------------------------------------------- [ EOF ]
libs/effects/Effect/Logging/Category.idr view
@@ -25,9 +25,6 @@ getLevel : LogLevel n getCategories : List a -instance (Show a) => Show (LogRes a) where- show (MkLogRes l cs) = unwords ["Log Settings:", show l, show cs]- instance Default (LogRes a) where default = MkLogRes OFF Nil
+ libs/effects/Effect/Perf.idr view
@@ -0,0 +1,230 @@+-- ---------------------------------------------------------------- [ Perf.idr ]+-- Module : Perf.idr+-- Copyright : (c) Jan de Muijnck-Hughes+-- License : see LICENSE+-- --------------------------------------------------------------------- [ EOH ]+||| A naive performance effect for gathering data about the+||| performance of effectful programmes.+module Effect.Perf++import System++import Effects+import Effect.Default++%access public++-- ---------------------------------------------------- [ Timer Data Structure ]++||| A Simple timer.+record Timer where+ constructor MkTimer+ desc : String+ start : Integer+ stop : Integer+ splits : List (Integer, Maybe String)++displayTimer : Timer -> String+displayTimer (MkTimer d a z bcd) = unlines+ [ unwords ["Timer:", d]+ , unwords ["\tStart:\t", show a, (displaySplits bcd)]+ , unwords ["\tStop:\t", show z]+ , unwords ["\tDifference:\t", show (z - a)]+ ]+ where+ displaySplit : (Integer, Maybe String) -> String+ displaySplit (v, Nothing) = with List unwords ["\tSplit:\t",show v]+ displaySplit (v, Just msg) = with List unwords ["\tSplit:\t",show v, show msg]++ displaySplits : List (Integer, Maybe String) -> String+ displaySplits Nil = ""+ displaySplits ss = "\n" ++ unlines (map displaySplit $ reverse ss)+++defaultTimer : String -> Timer+defaultTimer n = MkTimer n 0 0 Nil++-- ---------------------------------------------------------------- [ Resource ]++||| Performance Metrics to keep during program lifetime.+record PMetrics where+ constructor MkPMetrics+ canPerf : Bool+ livePerf : Bool+ counters : List (String, Nat)+ timers : List (String, Timer)+ stime : Integer+ stamps : List (String, Integer)+++instance Default PMetrics where+ default = MkPMetrics False False Nil Nil 0 Nil++displayPerfMetrics : PMetrics -> String+displayPerfMetrics (MkPMetrics c l cs ts _ ss) =+ unlines [ "Perf Data:"+ , unlines $ map displayMarker cs+ , unlines $ map (\(x,y) => displayTimer y) ts+ , unlines $ map displayMarker ss]+ where+ displayMarker : Show a => Pair String a -> String+ displayMarker (d,v) = unwords [show v, "\t<==\t", show d]++-- ------------------------------------------------------- [ Utility functions ]++incCounter' : String -> PMetrics -> PMetrics+incCounter' x st = record {counters = cs} st+ where+ cs : List (String, Nat)+ cs = map (\(y,c) => if x == y then (y,S c) else (y,c)) (counters st)+++data TOpt = START | STOP | SPLIT++displayTimerOpt : TOpt -> String+displayTimerOpt START = "Starting"+displayTimerOpt STOP = "Stopping"+displayTimerOpt SPLIT = "Splitting"++timerStuff' : TOpt -> Integer -> String -> Maybe String -> PMetrics -> PMetrics+timerStuff' opt val x msg st = record {timers = ts} st+ where+ doThing : (String,Timer) -> (String,Timer)+ doThing (y,t) =+ if not (x == y)+ then (y, t)+ else case opt of+ START => MkPair y $ record {start = val} t+ STOP => MkPair y $ record {stop = val} t+ SPLIT => MkPair y $ record {splits = (val, msg) :: splits t} t++ ts : List (String, Timer)+ ts = map doThing (timers st)+++perfLog : PMetrics -> String -> IO ()+perfLog res msg =+ if livePerf res+ then putStrLn $ unwords ["PERF:", msg]+ else return ()++-- ------------------------------------------------------- [ Effect Definition ]++data Perf : Effect where+ GetMetrics : sig Perf (PMetrics) (PMetrics)+ TurnOn : Bool -> sig Perf () (PMetrics) (PMetrics)+ MkCounter : String -> sig Perf () (PMetrics) (PMetrics)+ IncCounter : String -> sig Perf () (PMetrics) (PMetrics)+ Timestamp : String -> sig Perf () (PMetrics) (PMetrics)+ MkStopWatch : String -> sig Perf () (PMetrics) (PMetrics)+ TimerStuff : TOpt -> String -> Maybe String -> sig Perf () (PMetrics) (PMetrics)++-- ---------------------------------------------------------- [ Handler for IO ]++instance Handler Perf IO where+ handle res (TurnOn b) k = do+ v <- time+ let res' = record {canPerf = True, livePerf = b, stime = v} res+ perfLog res' $ unwords [ "Turning on Perf with at", show v]+ k () (res')++ handle res (GetMetrics) k = k res res++ handle res (MkCounter n) k = do+ if not (canPerf res)+ then k () res+ else do+ let res' = record {counters = (n,Z) :: counters res} res+ perfLog res' $ unwords ["Creating counter:", show n]+ k () (res')++ handle res (IncCounter n) k = do+ if not (canPerf res)+ then k () res+ else do+ let res' = incCounter' n res+ perfLog res' $ unwords ["Incriminating counter:", show n]+ k () (res')++ handle res (MkStopWatch n) k = do+ if not (canPerf res)+ then k () res+ else do+ let res' = record {timers = (n, defaultTimer n) :: timers res} res+ perfLog res' $ unwords ["Creating Timer:", show n]+ k () (res')++ handle res (TimerStuff opt n msg) k = do+ v <- time+ if not (canPerf res)+ then k () res+ else do+ let res' = timerStuff' opt v n msg res+ perfLog res' $ unwords [displayTimerOpt opt, "timer", show n, "at", show v, fromMaybe "" msg]+ k () (res')++ handle res (Timestamp s) k = do+ v <- time+ let stamp = v - (stime res)+ if not (canPerf res)+ then k () res+ else do+ let res' = record {stamps = (s,stamp) :: stamps res} res+ perfLog res' $ unlines [ "Creating Timestamp:"+ , "\tTIMESTAMP:", show v+ , "\tMESSAGE:", show s]+ k () (res')++-- ------------------------------------------------------- [ Effect Descriptor ]++PERF : EFFECT+PERF = MkEff PMetrics Perf++-- --------------------------------------------------------------------- [ API ]++||| Turn on performance metrics.+collectPMetricsOnly : Eff () [PERF]+collectPMetricsOnly = call $ TurnOn False++collectPMetrics : Bool -> Eff () [PERF]+collectPMetrics b = call $ TurnOn b++||| Turn on performance metrics and show during operation+collectPMetricsAndShow : Eff () [PERF]+collectPMetricsAndShow = call $ TurnOn True++||| Return gatheres metrics+getPerfMetrics : Eff PMetrics [PERF]+getPerfMetrics = call $ GetMetrics++||| Create a counter+mkCounter : String -> Eff () [PERF]+mkCounter n = call $ MkCounter n++||| Increment the counter+incCounter : String -> Eff () [PERF]+incCounter n = call $ IncCounter n++mkTimer : String -> Eff () [PERF]+mkTimer n = call $ MkStopWatch n++||| Stop a timer+stopTimer : String -> Eff () [PERF]+stopTimer n = call $ TimerStuff STOP n Nothing++||| Start a timer+startTimer : String -> Eff () [PERF]+startTimer n = call $ TimerStuff START n Nothing++||| Split a timer+splitTimer : String -> Eff () [PERF]+splitTimer n = call $ TimerStuff SPLIT n Nothing++splitTimerMsg : String -> String -> Eff () [PERF]+splitTimerMsg n msg = call $ TimerStuff SPLIT n (Just msg)++||| Create a time stamp.+timestamp : String -> Eff () [PERF]+timestamp msg = call $ Timestamp msg++-- --------------------------------------------------------------------- [ EOF ]
libs/effects/Effect/Random.idr view
@@ -4,28 +4,28 @@ import Data.Vect data Random : Effect where - getRandom : sig Random Integer Integer- setSeed : Integer -> sig Random () Integer+ GetRandom : sig Random Integer Integer+ SetSeed : Integer -> sig Random () Integer instance Handler Random m where- handle seed getRandom k+ handle seed GetRandom k = let seed' = assert_total ((1664525 * seed + 1013904223) `prim__sremBigInt` (pow 2 32)) in k seed' seed'- handle seed (setSeed n) k = k () n+ handle seed (SetSeed n) k = k () n RND : EFFECT RND = MkEff Integer Random ||| Generates a random Integer in a given range rndInt : Integer -> Integer -> Eff Integer [RND]-rndInt lower upper = do v <- call $ getRandom+rndInt lower upper = do v <- call $ GetRandom return ((v `prim__sremBigInt` (upper - lower)) + lower) ||| Generate a random number in Fin (S `k`) ||| ||| Note that rndFin k takes values 0, 1, ..., k. rndFin : (k : Nat) -> Eff (Fin (S k)) [RND]-rndFin k = do let v = assert_total $ !(call getRandom) `prim__sremBigInt` (cast (S k))+rndFin k = do let v = assert_total $ !(call GetRandom) `prim__sremBigInt` (cast (S k)) return (toFin v) where toFin : Integer -> Fin (S k) toFin x = case integerToFin x (S k) of@@ -43,5 +43,5 @@ ||| Sets the random seed srand : Integer -> Eff () [RND]-srand n = call $ setSeed n+srand n = call $ SetSeed n
libs/effects/Effects.idr view
@@ -12,9 +12,9 @@ ||| The Effect type describes effectful computations. ||| ||| This type is parameterised by:-||| + The input resource. ||| + The return type of the computation.-||| + The computation to run on the resource.+||| + The input resource.+||| + The computation to run on the resource given the return value. Effect : Type Effect = (x : Type) -> Type -> (x -> Type) -> Type @@ -159,17 +159,17 @@ data EffM : (m : Type -> Type) -> (x : Type) -> (es : List EFFECT) -> (ce : x -> List EFFECT) -> Type where- value : (val : a) -> EffM m a (xs val) xs- ebind : EffM m a xs xs' ->+ Value : (val : a) -> EffM m a (xs val) xs+ EBind : EffM m a xs xs' -> ((val : a) -> EffM m b (xs' val) xs'') -> EffM m b xs xs''- callP : (prf : EffElem e a xs) ->+ CallP : (prf : EffElem e a xs) -> (eff : e t a b) -> EffM m t xs (\v => updateResTy v xs prf eff) - liftP : (prf : SubList ys xs) ->+ LiftP : (prf : SubList ys xs) -> EffM m t ys ys' -> EffM m t xs (\v => updateWith (ys' v) xs prf) - new : Handler e' m => (e : EFFECT) -> resTy ->+ New : Handler e' m => (e : EFFECT) -> resTy -> {auto prf : e = MkEff resTy e'} -> EffM m t (e :: es) (\v => e :: es) -> EffM m t es (\v => es)@@ -211,12 +211,12 @@ %no_implicit (>>=) : EffM m a xs xs' -> ((val : a) -> EffM m b (xs' val) xs'') -> EffM m b xs xs''-(>>=) = ebind+(>>=) = EBind -- namespace SimpleBind -- (>>=) : Eff m a xs (\v => xs) -> -- ((val : a) -> Eff m b xs xs') -> Eff m b xs xs'--- (>>=) = ebind+-- (>>=) = EBind ||| Run a subprogram which results in an effect state the same as the input. staticEff : EffM m a xs (\v => xs) -> EffM m a xs (\v => xs)@@ -228,17 +228,17 @@ toEff xs' = id return : a -> EffM m a xs (\v => xs)-return x = value x+return x = Value x -- ------------------------------------------------------ [ for idiom brackets ] infixl 2 <*> pure : a -> EffM m a xs (\v => xs)-pure = value+pure = Value pureM : (val : a) -> EffM m a (xs val) xs-pureM = value+pureM = Value (<*>) : EffM m (a -> b) xs (\v => xs) -> EffM m a xs (\v => xs) -> EffM m b xs (\v => xs)@@ -246,6 +246,17 @@ arg <- v return (fn arg) +(*>) : EffM m a xs (\v => xs) ->+ EffM m b xs (\v => xs) -> EffM m b xs (\v => xs)+a *> b = do a+ b+ +new : Handler e' m => (e : EFFECT) -> resTy ->+ {auto prf : e = MkEff resTy e'} ->+ EffM m t (e :: es) (\v => e :: es) ->+ EffM m t es (\v => es)+new = New+ -- ---------------------------------------------------------- [ an interpreter ] private@@ -254,28 +265,23 @@ ((v : a) -> Env m (updateResTy v xs p eff) -> m t) -> m t execEff (val :: env) Here eff' k = handle val eff' (\v, res => k v (res :: env))--- FIXME: Teach the elaborator to propagate parameters here-execEff {e} {a} {res} {resk} (val :: env) (There p) eff k- = execEff {e} {a} {res} {resk} env p eff (\v, env' => k v (val :: env'))+execEff (val :: env) (There p) eff k+ = execEff env p eff (\v, env' => k v (val :: env')) -- Q: Instead of m b, implement as StateT (Env m xs') m b, so that state -- updates can be propagated even through failing computations? eff : Env m xs -> EffM m a xs xs' -> ((x : a) -> Env m (xs' x) -> m b) -> m b-eff env (value x) k = k x env-eff env (prog `ebind` c) k+eff env (Value x) k = k x env+eff env (prog `EBind` c) k = eff env prog (\p', env' => eff env' (c p') k)-eff env (callP prf effP) k = execEff env prf effP k-eff env (liftP prf effP) k+eff env (CallP prf effP) k = execEff env prf effP k+eff env (LiftP prf effP) k = let env' = dropEnv env prf in eff env' effP (\p', envk => k p' (rebuildEnv envk prf env))-eff env (new (MkEff resTy newEff) res {prf=Refl} effP) k+eff env (New (MkEff resTy newEff) res {prf=Refl} effP) k = eff (res :: env) effP (\p', (val :: envk) => k p' envk)--- FIXME:--- xs is needed explicitly because otherwise the pattern binding for--- 'l' appears too late. Solution seems to be to reorder patterns at the--- end so that everything is in scope when it needs to be.-eff {xs = [l ::: x]} env (l :- prog) k+eff env (l :- prog) k = let env' = unlabel env in eff env' prog (\p', envk => k p' (relabel l envk)) @@ -291,17 +297,18 @@ [default, default, default, default, default, default, default], [default, default, default, default, default, default, default, default] |) +%no_implicit call : {a, b: _} -> {e : Effect} -> (eff : e t a b) -> {auto prf : EffElem e a xs} -> EffM m t xs (\v => updateResTy v xs prf eff)-call e {prf} = callP prf e+call e {prf} = CallP prf e implicit lift : EffM m t ys ys' -> {auto prf : SubList ys xs} -> EffM m t xs (\v => updateWith (ys' v) xs prf)-lift e {prf} = liftP prf e+lift e {prf} = LiftP prf e -- --------------------------------------------------------- [ Running Effects ]
libs/effects/effects.ipkg view
@@ -18,3 +18,4 @@ , Effect.Logging.Level , Effect.Logging.Default , Effect.Logging.Category+ , Effect.Perf
libs/prelude/IO.idr view
@@ -8,7 +8,7 @@ ||| Idris's primitive IO, for building abstractions on top of abstract data PrimIO : Type -> Type where- prim__IO : a -> PrimIO a+ Prim__IO : a -> PrimIO a ||| A token representing the world, for use in `IO` abstract data World = TheWorld prim__WorldType@@ -93,14 +93,14 @@ abstract prim_io_bind : PrimIO a -> (a -> PrimIO b) -> PrimIO b-prim_io_bind (prim__IO v) k = k v+prim_io_bind (Prim__IO v) k = k v unsafePerformPrimIO : PrimIO a -> a -- compiled as primitive abstract prim_io_return : a -> PrimIO a-prim_io_return x = prim__IO x+prim_io_return x = Prim__IO x abstract io_bind : IO' l a -> (a -> IO' l b) -> IO' l b@@ -116,11 +116,11 @@ liftPrimIO : (World -> PrimIO a) -> IO' l a liftPrimIO = MkIO -call__IO : IO' l a -> PrimIO a+call__IO : IO' ffi a -> PrimIO a call__IO (MkIO f) = f (TheWorld prim__TheWorld) -- Concrete type makes it easier to elaborate at top level-run__IO : IO' l () -> PrimIO ()+run__IO : IO' ffi () -> PrimIO () run__IO f = call__IO f unsafePerformIO : IO' ffi a -> a@@ -171,10 +171,14 @@ ||| A descriptor for the C FFI. See the constructors of `C_Types` ||| and `C_IntTypes` for the concrete types that are available.+ %error_reverse FFI_C : FFI FFI_C = MkFFI C_Types String String -IO : Type -> Type+||| Interactive programs, describing I/O actions and returning a value.+||| @res The result type of the program +%error_reverse+IO : (res : Type) -> Type IO = IO' FFI_C -- Cannot be relaxed as is used by type providers and they expect IO a@@ -195,6 +199,9 @@ forceGC : IO () forceGC = foreign FFI_C "idris_forceGC" (Ptr -> IO ()) prim__vm + getErrno : IO Int+ getErrno = foreign FFI_C "idris_errno" (IO Int)+ --------- The Javascript/Node FFI @@ -228,9 +235,11 @@ ||| The JavaScript FFI. The strings naming functions in this API are ||| JavaScript code snippets, into which the arguments are substituted ||| for the placeholders `%0`, `%1`, etc.+%error_reverse FFI_JS : FFI FFI_JS = MkFFI JS_Types String String +%error_reverse JS_IO : Type -> Type JS_IO = IO' FFI_JS
libs/prelude/Language/Reflection.idr view
@@ -11,6 +11,22 @@ %access public +||| A source location in an Idris file+record SourceLocation where+ ||| Either a source span or a source location. `start` and `end`+ ||| will be the same if it's a point location.+ constructor FileLoc++ ||| The file name of the source location+ filename : String+ ||| The line and column of the beginning of the source span+ start : (Int, Int)+ ||| The line and column of the end of the source span+ end : (Int, Int)++%name SourceLocation loc++ mutual data TTName = ||| A user-provided name@@ -24,9 +40,7 @@ MN Int String | ||| Special names, to make conflicts impossible and language features ||| predictable- SN SpecialName |- ||| Name of something which is never used in scope- NErased+ SN SpecialName %name TTName n, n' data SpecialName = WhereN Int TTName TTName@@ -34,7 +48,7 @@ | InstanceN TTName (List String) | ParentN TTName String | MethodN TTName- | CaseN TTName+ | CaseN SourceLocation TTName | ElimN TTName | InstanceCtorN TTName | MetaN TTName TTName@@ -116,22 +130,62 @@ ||| Types annotations for bound variables in different ||| binding contexts-data Binder a = Lam a- | Pi a a- | Let a a- | NLet a a- | Hole a- | GHole a- | Guess a a- | PVar a- | PVTy a+|||+||| @ tmTy the terms that can occur inside the binder, as type+||| annotations or bound values+data Binder : (tmTy : Type) -> Type where+ ||| Lambdas+ |||+ ||| @ ty the type of the argument+ Lam : (ty : a) -> Binder a++ ||| Function types.+ |||+ ||| @ kind The kind of arrow. Only relevant when dealing with+ ||| uniqueness, so you can usually pretend that this+ ||| field doesn't exist. For ordinary functions, use the+ ||| type of types here.+ Pi : (ty, kind : a) -> Binder a++ ||| A let binder+ |||+ ||| @ ty the type of the bound variable+ ||| @ val the bound value+ Let : (ty, val : a) -> Binder a++ ||| A hole that can occur during elaboration, and must be filled+ |||+ ||| @ ty the type of the value that will eventually be put into the hole+ Hole : (ty : a) -> Binder a++ ||| A hole that will later become a top-level metavariable+ GHole : (ty : a) -> Binder a++ ||| A hole with a solution in it. Computationally inert.+ |||+ ||| @ ty the type of the value in the hole+ ||| @ val the value in the hole+ Guess : (ty, val : a) -> Binder a++ ||| A pattern variable. These bindings surround the terms that make+ ||| up the left and right sides of pattern-matching definition+ ||| clauses.+ |||+ ||| @ ty the type of the pattern variable+ PVar : (ty : a) -> Binder a++ ||| The type of a pattern binding. This is to `PVar` as `Pi` is to+ ||| `Lam`.+ |||+ ||| @ ty the type of the pattern variable+ PVTy : (ty : a) -> Binder a+ %name Binder b, b' instance Functor Binder where map f (Lam x) = Lam (f x) map f (Pi x k) = Pi (f x) (f k) map f (Let x y) = Let (f x) (f y)- map f (NLet x y) = NLet (f x) (f y) map f (Hole x) = Hole (f x) map f (GHole x) = GHole (f x) map f (Guess x y) = Guess (f x) (f y)@@ -142,7 +196,6 @@ foldr f z (Lam x) = f x z foldr f z (Pi x k) = f x (f k z) foldr f z (Let x y) = f x (f y z)- foldr f z (NLet x y) = f x (f y z) foldr f z (Hole x) = f x z foldr f z (GHole x) = f x z foldr f z (Guess x y) = f x (f y z)@@ -153,14 +206,13 @@ traverse f (Lam x) = [| Lam (f x) |] traverse f (Pi x k) = [| Pi (f x) (f k) |] traverse f (Let x y) = [| Let (f x) (f y) |]- traverse f (NLet x y) = [| NLet (f x) (f y) |] traverse f (Hole x) = [| Hole (f x) |] traverse f (GHole x) = [| GHole (f x) |] traverse f (Guess x y) = [| Guess (f x) (f y) |] traverse f (PVar x) = [| PVar (f x) |] traverse f (PVTy x) = [| PVTy (f x) |] -||| Universes+||| The various universes involved in the uniqueness mechanism data Universe = NullType | UniqueType | AllTypes ||| Reflection of the well typed core language@@ -175,14 +227,11 @@ App TT TT | ||| Embed a constant TConst Const |- ||| Argument projection; runtime only- Proj TT Int | ||| Erased terms Erased |- ||| Impossible terms- Impossible | ||| The type of types along (with universe constraints) TType TTUExp |+ ||| Alternative universes for dealing with uniqueness UType Universe %name TT tm, tm' @@ -196,17 +245,12 @@ RApp Raw Raw | ||| The type of types RType |+ ||| Alternative universes for dealing with uniqueness RUType Universe |- RForce Raw | ||| Embed a constant RConstant Const %name Raw tm, tm' -data SourceLocation : Type where- FileLoc : (filename : String) -> (start : (Int, Int)) -> (end : (Int, Int)) -> SourceLocation--%name SourceLocation loc- ||| Error reports are a list of report parts data ErrorReportPart = ||| A human-readable string@@ -221,7 +265,7 @@ SubReport (List ErrorReportPart) %name ErrorReportPart part, p -||| A representation of Idris's tactics that can be returned from custom+||| A representation of Idris's old tactics that can be returned from custom ||| tactic implementations. Generate these using `applyTactic`. data Tactic = ||| Try the first tactic and resort to the second one on failure@@ -280,6 +324,7 @@ Fail (List ErrorReportPart) | ||| Attempt to fill the hole with source code information SourceFC+ %name Tactic tac, tac' @@ -409,6 +454,21 @@ quote [] = `(List.Nil {elem=~(quotedTy {a})}) quote (x :: xs) = `(List.(::) {elem=~(quotedTy {a})} ~(quote x) ~(quote xs)) +instance Quotable SourceLocation TT where+ quotedTy = `(SourceLocation)+ quote (FileLoc fn (sl, sc) (el, ec)) =+ `(FileLoc ~(quote fn)+ (~(quote sl), ~(quote sc))+ (~(quote el), ~(quote ec)))++instance Quotable SourceLocation Raw where+ quotedTy = `(SourceLocation)+ quote (FileLoc fn (sl, sc) (el, ec)) =+ `(FileLoc ~(quote {t=Raw} fn)+ (~(quote {t=Raw} sl), ~(quote {t=Raw} sc))+ (~(quote {t=Raw} el), ~(quote {t=Raw} ec)))++ mutual instance Quotable TTName TT where quotedTy = `(TTName)@@ -416,7 +476,6 @@ quote (NS n xs) = `(NS ~(quote n) ~(quote xs)) quote (MN x y) = `(MN ~(quote x) ~(quote y)) quote (SN sn) = `(SN ~(assert_total $ quote sn))- quote NErased = `(NErased) instance Quotable SpecialName TT where quotedTy = `(SpecialName)@@ -425,7 +484,7 @@ quote (InstanceN i ss) = `(InstanceN ~(quote i) ~(quote ss)) quote (ParentN n s) = `(ParentN ~(quote n) ~(quote s)) quote (MethodN n) = `(MethodN ~(quote n))- quote (CaseN n) = `(CaseN ~(quote n))+ quote (CaseN fc n) = `(CaseN ~(quote fc) ~(quote n)) quote (ElimN n) = `(ElimN ~(quote n)) quote (InstanceCtorN n) = `(InstanceCtorN ~(quote n)) quote (MetaN parent meta) = `(MetaN ~(quote parent) ~(quote meta))@@ -437,7 +496,6 @@ quote (NS n xs) = `(NS ~(quote {t=Raw} n) ~(quote {t=Raw} xs)) quote (MN x y) = `(MN ~(quote {t=Raw} x) ~(quote {t=Raw} y)) quote (SN sn) = `(SN ~(assert_total $ quote sn))- quote NErased = `(NErased) instance Quotable SpecialName Raw where quotedTy = `(SpecialName)@@ -446,7 +504,7 @@ quote (InstanceN i ss) = `(InstanceN ~(quote i) ~(quote ss)) quote (ParentN n s) = `(ParentN ~(quote n) ~(quote s)) quote (MethodN n) = `(MethodN ~(quote n))- quote (CaseN n) = `(CaseN ~(quote n))+ quote (CaseN fc n) = `(CaseN ~(quote fc) ~(quote n)) quote (ElimN n) = `(ElimN ~(quote n)) quote (InstanceCtorN n) = `(InstanceCtorN ~(quote n)) quote (MetaN parent meta) = `(MetaN ~(quote parent) ~(quote meta))@@ -556,9 +614,7 @@ quote (Bind n b tm) = `(Bind ~(quote n) ~(assert_total (quote b)) ~(quote tm)) quote (App f x) = `(App ~(quote f) ~(quote x)) quote (TConst c) = `(TConst ~(quote c))- quote (Proj tm x) = `(Proj ~(quote tm) ~(quote x)) quote Erased = `(Erased)- quote Impossible = `(Impossible) quote (TType uexp) = `(TType ~(quote uexp)) quote (UType u) = `(UType ~(quote u)) @@ -569,8 +625,6 @@ ~(assert_total (quote k))) quote (Let x y) = `(Let {a=TT} ~(assert_total (quote x)) ~(assert_total (quote y)))- quote (NLet x y) = `(NLet {a=TT} ~(assert_total (quote x))- ~(assert_total (quote y))) quote (Hole x) = `(Hole {a=TT} ~(assert_total (quote x))) quote (GHole x) = `(GHole {a=TT} ~(assert_total (quote x))) quote (Guess x y) = `(Guess {a=TT} ~(assert_total (quote x))@@ -585,14 +639,12 @@ quoteRawTT (RApp tm tm') = `(RApp ~(quoteRawTT tm) ~(quoteRawTT tm')) quoteRawTT RType = `(RType) quoteRawTT (RUType u) = `(RUType ~(quote u))- quoteRawTT (RForce tm) = `(RForce ~(quoteRawTT tm)) quoteRawTT (RConstant c) = `(RConstant ~(quote c)) quoteRawBinderTT : Binder Raw -> TT quoteRawBinderTT (Lam x) = `(Lam {a=Raw} ~(quoteRawTT x)) quoteRawBinderTT (Pi x k) = `(Pi {a=Raw} ~(quoteRawTT x) ~(quoteRawTT k)) quoteRawBinderTT (Let x y) = `(Let {a=Raw} ~(quoteRawTT x) ~(quoteRawTT y))- quoteRawBinderTT (NLet x y) = `(NLet {a=Raw} ~(quoteRawTT x) ~(quoteRawTT y)) quoteRawBinderTT (Hole x) = `(Hole {a=Raw} ~(quoteRawTT x)) quoteRawBinderTT (GHole x) = `(GHole {a=Raw} ~(quoteRawTT x)) quoteRawBinderTT (Guess x y) = `(Guess {a=Raw} ~(quoteRawTT x) ~(quoteRawTT y))@@ -614,14 +666,12 @@ quoteRawRaw (RApp tm tm') = `(RApp ~(quoteRawRaw tm) ~(quoteRawRaw tm')) quoteRawRaw RType = `(RType) quoteRawRaw (RUType u) = `(RUType ~(quote u))- quoteRawRaw (RForce tm) = `(RForce ~(quoteRawRaw tm)) quoteRawRaw (RConstant c) = `(RConstant ~(quote c)) quoteRawBinderRaw : Binder Raw -> Raw quoteRawBinderRaw (Lam x) = `(Lam {a=Raw} ~(quoteRawRaw x)) quoteRawBinderRaw (Pi x k) = `(Pi {a=Raw} ~(quoteRawRaw x) ~(quoteRawRaw k)) quoteRawBinderRaw (Let x y) = `(Let {a=Raw} ~(quoteRawRaw x) ~(quoteRawRaw y))- quoteRawBinderRaw (NLet x y) = `(NLet {a=Raw} ~(quoteRawRaw x) ~(quoteRawRaw y)) quoteRawBinderRaw (Hole x) = `(Hole {a=Raw} ~(quoteRawRaw x)) quoteRawBinderRaw (GHole x) = `(GHole {a=Raw} ~(quoteRawRaw x)) quoteRawBinderRaw (Guess x y) = `(Guess {a=Raw} ~(quoteRawRaw x) ~(quoteRawRaw y))@@ -673,18 +723,3 @@ quote Skip = `(Skip) quote (Fail xs) = `(Fail ~(quote xs)) quote SourceFC = `(SourceFC)---instance Quotable SourceLocation TT where- quotedTy = `(SourceLocation)- quote (FileLoc fn (sl, sc) (el, ec)) =- `(FileLoc ~(quote fn)- (~(quote sl), ~(quote sc))- (~(quote el), ~(quote ec)))--instance Quotable SourceLocation Raw where- quotedTy = `(SourceLocation)- quote (FileLoc fn (sl, sc) (el, ec)) =- `(FileLoc ~(quote {t=Raw} fn)- (~(quote {t=Raw} sl), ~(quote {t=Raw} sc))- (~(quote {t=Raw} el), ~(quote {t=Raw} ec)))
libs/prelude/Language/Reflection/Elab.idr view
@@ -34,11 +34,13 @@ ||| Function arguments ||| ||| These are the simplest representation of argument lists, and are-||| used for functions.+||| used for functions. Additionally, because a FunArg provides enough+||| information to build an application, a generic type lookup of a+||| top-level identifier will return its FunArgs, if applicable. record FunArg where constructor MkFunArg- argName : TTName- argTy : Raw+ name : TTName+ type : Raw plicity : Plicity erasure : Erasure @@ -54,25 +56,30 @@ TyConIndex FunArg ||| A type declaration-data TyDecl : Type where- ||| A type declaration.- |||- ||| Each argument is in the scope of the names of previous- ||| arguments, and the return type is in the scope of all the- ||| argument names.- |||- ||| @ fn the name to be declared, fully-qualified- ||| @ args the arguments to the function- ||| @ ret the final return type- Declare : (fn : TTName) -> (args : List FunArg) -> (ret : Raw) -> TyDecl+record TyDecl where+ constructor Declare + ||| The name of the function being declared.+ name : TTName++ ||| Each argument is in the scope of the names of previous arguments.+ arguments : List FunArg++ ||| The return type is in the scope of all the argument names.+ returnType : Raw+++-- Note: FunClause is not a record because impossible clauses may be+-- added at some point. ||| A single pattern-matching clause data FunClause : Type where MkFunClause : (lhs, rhs : Raw) -> FunClause ||| A reflected function definition.-data FunDefn : Type where- DefineFun : TTName -> List FunClause -> FunDefn+record FunDefn where+ constructor DefineFun+ name : TTName+ clauses : List FunClause data CtorArg = CtorParameter FunArg | CtorField FunArg@@ -82,7 +89,7 @@ constructor MkDatatype ||| The name of the type constructor- familyName : TTName+ name : TTName ||| The arguments to the type constructor tyConArgs : List TyConArg@@ -97,61 +104,62 @@ abstract data Elab : Type -> Type where -- obligatory control stuff- prim__PureElab : a -> Elab a- prim__BindElab : {a, b : Type} -> Elab a -> (a -> Elab b) -> Elab b-- prim__Try : {a : Type} -> Elab a -> Elab a -> Elab a- prim__Fail : {a : Type} -> List ErrorReportPart -> Elab a+ Prim__PureElab : a -> Elab a+ Prim__BindElab : {a, b : Type} -> Elab a -> (a -> Elab b) -> Elab b - prim__Env : Elab (List (TTName, Binder TT))- prim__Goal : Elab (TTName, TT)- prim__Holes : Elab (List TTName)- prim__Guess : Elab (Maybe TT)- prim__LookupTy : TTName -> Elab (List (TTName, NameType, TT))- prim__LookupDatatype : TTName -> Elab (List Datatype)+ Prim__Try : {a : Type} -> Elab a -> Elab a -> Elab a+ Prim__Fail : {a : Type} -> List ErrorReportPart -> Elab a - prim__Check : Raw -> Elab (TT, TT)+ Prim__Env : Elab (List (TTName, Binder TT))+ Prim__Goal : Elab (TTName, TT)+ Prim__Holes : Elab (List TTName)+ Prim__Guess : Elab TT+ Prim__LookupTy : TTName -> Elab (List (TTName, NameType, TT))+ Prim__LookupDatatype : TTName -> Elab (List Datatype)+ Prim__LookupArgs : TTName -> Elab (List (TTName, List FunArg, Raw)) - prim__SourceLocation : Elab SourceLocation- prim__Namespace : Elab (List String)+ Prim__Check : List (TTName, Binder TT) -> Raw -> Elab (TT, TT) - prim__Forget : TT -> Elab Raw+ Prim__SourceLocation : Elab SourceLocation+ Prim__Namespace : Elab (List String) - prim__Gensym : String -> Elab TTName+ Prim__Gensym : String -> Elab TTName - prim__Solve : Elab ()- prim__Fill : Raw -> Elab ()- prim__Apply : Raw -> List (Bool, Int) -> Elab (List (TTName, TTName))- prim__MatchApply : Raw -> List (Bool, Int) -> Elab (List (TTName, TTName))- prim__Focus : TTName -> Elab ()- prim__Unfocus : TTName -> Elab ()- prim__Attack : Elab ()+ Prim__Solve : Elab ()+ Prim__Fill : Raw -> Elab ()+ Prim__Apply : Raw -> List Bool -> Elab (List (TTName, TTName))+ Prim__MatchApply : Raw -> List Bool -> Elab (List (TTName, TTName))+ Prim__Focus : TTName -> Elab ()+ Prim__Unfocus : TTName -> Elab ()+ Prim__Attack : Elab () - prim__Rewrite : Raw -> Elab ()+ Prim__Rewrite : Raw -> Elab () - prim__Claim : TTName -> Raw -> Elab ()- prim__Intro : Maybe TTName -> Elab ()- prim__Forall : TTName -> Raw -> Elab ()- prim__PatVar : TTName -> Elab ()- prim__PatBind : TTName -> Elab ()- prim__LetBind : TTName -> Raw -> Raw -> Elab ()+ Prim__Claim : TTName -> Raw -> Elab ()+ Prim__Intro : Maybe TTName -> Elab ()+ Prim__Forall : TTName -> Raw -> Elab ()+ Prim__PatVar : TTName -> Elab ()+ Prim__PatBind : TTName -> Elab ()+ Prim__LetBind : TTName -> Raw -> Raw -> Elab () - prim__Compute : Elab ()- prim__Normalise : (List (TTName, Binder TT)) -> TT -> Elab TT- prim__Whnf : TT -> Elab TT+ Prim__Compute : Elab ()+ Prim__Normalise : (List (TTName, Binder TT)) -> TT -> Elab TT+ Prim__Whnf : TT -> Elab TT+ Prim__Converts : (List (TTName, Binder TT)) -> TT -> TT -> Elab () - prim__DeclareType : TyDecl -> Elab ()- prim__DefineFunction : FunDefn -> Elab ()- prim__AddInstance : TTName -> TTName -> Elab ()+ Prim__DeclareType : TyDecl -> Elab ()+ Prim__DefineFunction : FunDefn -> Elab ()+ Prim__AddInstance : TTName -> TTName -> Elab ()+ Prim__IsTCName : TTName -> Elab Bool - prim__ResolveTC : TTName -> Elab ()- prim__Search : Int -> List TTName -> Elab ()- prim__RecursiveElab : Raw -> Elab () -> Elab (TT, TT)+ Prim__ResolveTC : TTName -> Elab ()+ Prim__Search : Int -> List TTName -> Elab ()+ Prim__RecursiveElab : Raw -> Elab () -> Elab (TT, TT) - prim__Fixity : String -> Elab Fixity+ Prim__Fixity : String -> Elab Fixity - prim__Debug : {a : Type} -> List ErrorReportPart -> Elab a- prim__Metavar : TTName -> Elab ()+ Prim__Debug : {a : Type} -> List ErrorReportPart -> Elab a+ Prim__Metavar : TTName -> Elab () ------------- -- Public API@@ -159,49 +167,50 @@ %access public namespace Tactics instance Functor Elab where- map f t = prim__BindElab t (\x => prim__PureElab (f x))+ map f t = Prim__BindElab t (\x => Prim__PureElab (f x)) instance Applicative Elab where- pure x = prim__PureElab x- f <*> x = prim__BindElab f $ \g =>- prim__BindElab x $ \y =>- prim__PureElab $ g y+ pure x = Prim__PureElab x+ f <*> x = Prim__BindElab f $ \g =>+ Prim__BindElab x $ \y =>+ Prim__PureElab $ g y ||| The Alternative instance on Elab represents left-biased error ||| handling. In other words, `t <|> t'` will run `t`, and if it ||| fails, roll back the elaboration state and run `t'`. instance Alternative Elab where- empty = prim__Fail [TextPart "empty"]- x <|> y = prim__Try x y+ empty = Prim__Fail [TextPart "empty"]+ x <|> y = Prim__Try x y instance Monad Elab where- x >>= f = prim__BindElab x f+ x >>= f = Prim__BindElab x f ||| Halt elaboration with an error fail : List ErrorReportPart -> Elab a- fail err = prim__Fail err+ fail err = Prim__Fail err - ||| Look up the lexical binding at the focused hole+ ||| Look up the lexical binding at the focused hole. Fails if no holes are present. getEnv : Elab (List (TTName, Binder TT))- getEnv = prim__Env+ getEnv = Prim__Env - ||| Get the name and type of the focused hole+ ||| Get the name and type of the focused hole. Fails if not holes are present. getGoal : Elab (TTName, TT)- getGoal = prim__Goal+ getGoal = Prim__Goal - ||| Get the hole queue, in order+ ||| Get the hole queue, in order. getHoles : Elab (List TTName)- getHoles = prim__Holes+ getHoles = Prim__Holes - ||| If the current hole contains a guess, return it- getGuess : Elab (Maybe TT)- getGuess = prim__Guess+ ||| If the current hole contains a guess, return it. Otherwise, fail.+ getGuess : Elab TT+ getGuess = Prim__Guess - ||| Look up the types of every overloading of a name+ ||| Look up the types of every overloading of a name. lookupTy : TTName -> Elab (List (TTName, NameType, TT))- lookupTy n = prim__LookupTy n+ lookupTy n = Prim__LookupTy n - ||| Get the type of a fully-qualified name+ ||| Get the type of a fully-qualified name. Fail if it doesn not+ ||| resolve uniquely. lookupTyExact : TTName -> Elab (TTName, NameType, TT) lookupTyExact n = case !(lookupTy n) of [res] => return res@@ -209,55 +218,61 @@ xs => fail [NamePart n, TextPart "is ambiguous."] ||| Find the reflected representation of all datatypes whose names- ||| are overloadings of some name+ ||| are overloadings of some name. lookupDatatype : TTName -> Elab (List Datatype)- lookupDatatype n = prim__LookupDatatype n+ lookupDatatype n = Prim__LookupDatatype n ||| Find the reflected representation of a datatype, given its- ||| fully-qualified name.+ ||| fully-qualified name. Fail if the name does not uniquely resolve+ ||| to a datatype. lookupDatatypeExact : TTName -> Elab Datatype lookupDatatypeExact n = case !(lookupDatatype n) of [res] => return res [] => fail [TextPart "No datatype named", NamePart n] xs => fail [TextPart "More than one datatype named", NamePart n] - ||| Attempt to type-check a term, getting back itself and its type- check : (tm : Raw) -> Elab (TT, TT)- check tm = prim__Check tm - ||| Convert a type-annotated reflected term to its untyped- ||| equivalent- forgetTypes : TT -> Elab Raw- forgetTypes tt = prim__Forget tt+ ||| Get the argument specification for each overloading of a name.+ lookupArgs : TTName -> Elab (List (TTName, List FunArg, Raw))+ lookupArgs n = Prim__LookupArgs n - ||| Get the goal type as a Raw term- goalType : Elab Raw- goalType = do g <- getGoal- forgetTypes (snd g)+ ||| Get the argument specification for a name. Fail if the name does+ ||| not uniquely resolve.+ lookupArgsExact : TTName -> Elab (TTName, List FunArg, Raw)+ lookupArgsExact n = case !(lookupArgs n) of+ [res] => return res+ [] => fail [NamePart n, TextPart "is not defined."]+ xs => fail [NamePart n, TextPart "is ambiguous."] + ||| Attempt to type-check a term, getting back itself and its type.+ |||+ ||| @ env the environment within which to check the type+ ||| @ tm the term to check+ check : (env : List (TTName, Binder TT)) -> (tm : Raw) -> Elab (TT, TT)+ check env tm = Prim__Check env tm + ||| Generate a unique name based on some hint. ||| ||| **NB**: the generated name is unique _for this run of the ||| elaborator_. Do not assume that they are globally unique. gensym : (hint : String) -> Elab TTName- gensym hint = prim__Gensym hint+ gensym hint = Prim__Gensym hint ||| Substitute a guess into a hole. solve : Elab ()- solve = prim__Solve+ solve = Prim__Solve - ||| Place a term into a hole, unifying its type+ ||| Place a term into a hole, unifying its type. Fails if the focus+ ||| is not a hole. fill : Raw -> Elab ()- fill tm = prim__Fill tm+ fill tm = Prim__Fill tm ||| Attempt to apply an operator to fill the current hole, ||| potentially solving arguments by unification. |||- ||| The return value is a list of pairs of names, one for each input- ||| argument. The first projection of these pairs is the original- ||| name of the argument, from the type declaration, and the second- ||| projection is the hole into which it is placed.+ ||| The return value is the list of holes established for the+ ||| arguments to the function. ||| ||| Note that not all of the returned hole names still exist, as ||| they may have been solved.@@ -266,20 +281,15 @@ ||| ||| @ argSpec instructions for finding the arguments to the term, ||| where the Boolean states whether or not to attempt to solve- ||| the argument and the Int gives the priority in which to do- ||| so- apply : (op : Raw) ->- (argSpec : List (Bool, Int)) ->- Elab (List (TTName, TTName))- apply tm argSpec = prim__Apply tm argSpec+ ||| the argument by unification.+ apply : (op : Raw) -> (argSpec : List Bool) -> Elab (List TTName)+ apply tm argSpec = map snd <$> Prim__Apply tm argSpec ||| Attempt to apply an operator to fill the current hole,- ||| potentially solving arugments by matching.+ ||| potentially solving arguments by matching. |||- ||| The return value is a list of pairs of names, one for each input- ||| argument. The first projection of these pairs is the original- ||| name of the argument, from the type declaration, and the second- ||| projection is the hole into which it is placed.+ ||| The return value is the list of holes established for the+ ||| arguments to the function. ||| ||| Note that not all of the returned hole names still exist, as ||| they may have been solved.@@ -288,39 +298,41 @@ ||| ||| @ argSpec instructions for finding the arguments to the term, ||| where the Boolean states whether or not to attempt to solve- ||| the argument and the Int gives the priority in which to do- ||| so- matchApply : (op : Raw) ->- (argSpec : List (Bool, Int)) ->- Elab (List (TTName, TTName))- matchApply tm argSpec = prim__Apply tm argSpec+ ||| the argument by matching. - ||| Move the focus to the specified hole+ matchApply : (op : Raw) -> (argSpec : List Bool) -> Elab (List TTName)+ matchApply tm argSpec = map snd <$> Prim__Apply tm argSpec++ ||| Move the focus to the specified hole. Fails if the hole does not+ ||| exist. ||| ||| @ hole the hole to focus on focus : (hole : TTName) -> Elab ()- focus hole = prim__Focus hole+ focus hole = Prim__Focus hole ||| Send the currently-focused hole to the end of the hole queue and ||| focus on the next hole. unfocus : TTName -> Elab ()- unfocus hole = prim__Unfocus hole+ unfocus hole = Prim__Unfocus hole - ||| Convert a hole to make it suitable for bindings.+ ||| Convert a hole to make it suitable for bindings - that is,+ ||| transform it such that it has the form `?h : t . h` as opposed to+ ||| `?h : t . f h`. ||| ||| The binding tactics require that a hole be directly under its ||| binding, or else the scopes of the generated terms won't make ||| sense. This tactic creates a new hole of the proper form, and ||| points the old hole at it. attack : Elab ()- attack = prim__Attack+ attack = Prim__Attack ||| Introduce a new hole with a specified name and type. ||| ||| The new hole will be focused, and the previously-focused hole- ||| will be immediately after it in the hole queue.+ ||| will be immediately after it in the hole queue. Because this+ ||| tactic introduces a new binding, you may need to `attack` first. claim : TTName -> Raw -> Elab ()- claim n ty = prim__Claim n ty+ claim n ty = Prim__Claim n ty ||| Introduce a lambda binding around the current hole and focus on ||| the body. Requires that the hole be in binding form (use@@ -328,54 +340,83 @@ ||| ||| @ n the name to use for the argument intro : (n : TTName) -> Elab ()- intro n = prim__Intro (Just n)+ intro n = Prim__Intro (Just n) ||| Introduce a lambda binding around the current hole and focus on- ||| the body, using the name provided by the type of the hole.+ ||| the body, using the name provided by the type of the+ ||| hole.+ |||+ ||| Requires that the hole be immediately under its binder (use+ ||| `attack` if it might not be). intro' : Elab ()- intro' = prim__Intro Nothing+ intro' = Prim__Intro Nothing ||| Introduce a dependent function type binding into the current hole, ||| and focus on the body.+ |||+ ||| Requires that the hole be immediately under its binder (use+ ||| `attack` if it might not be). forall : TTName -> Raw -> Elab ()- forall n ty = prim__Forall n ty+ forall n ty = Prim__Forall n ty ||| Convert a hole into a pattern variable. patvar : TTName -> Elab ()- patvar n = prim__PatVar n+ patvar n = Prim__PatVar n ||| Introduce a new pattern binding.+ |||+ ||| Requires that the hole be immediately under its binder (use+ ||| `attack` if it might not be). patbind : TTName -> Elab ()- patbind n = prim__PatBind n+ patbind n = Prim__PatBind n - ||| Introduce a new let binding+ ||| Introduce a new let binding. |||+ ||| Requires that the hole be immediately under its binder (use+ ||| `attack` if it might not be).+ ||| ||| @ n the name to let bind ||| @ ty the type of the term to be let-bound ||| @ tm the term to be bound letbind : (n : TTName) -> (ty, tm : Raw) -> Elab ()- letbind n ty tm = prim__LetBind n ty tm+ letbind n ty tm = Prim__LetBind n ty tm ||| Normalise the goal. compute : Elab ()- compute = prim__Compute+ compute = Prim__Compute ||| Normalise a term in some lexical environment ||| ||| @ env the environment in which to compute (get one of these from `getEnv`) ||| @ term the term to normalise normalise : (env : List (TTName, Binder TT)) -> (term : TT) -> Elab TT- normalise env term = prim__Normalise env term+ normalise env term = Prim__Normalise env term ||| Reduce a closed term to weak-head normal form ||| ||| @ term the term to reduce whnf : (term : TT) -> Elab TT- whnf term = prim__Whnf term+ whnf term = Prim__Whnf term + ||| Check that two terms are convertable in the current context and+ ||| in some environment.+ |||+ ||| @ env a lexical environment to compare the terms in (see `getEnv`)+ ||| @ term1 the first term to convert+ ||| @ term2 the second term to convert+ convertsInEnv : (env : List (TTName, Binder TT)) -> (term1, term2 : TT) -> Elab ()+ convertsInEnv env term1 term2 = Prim__Converts env term1 term2++ ||| Check that two terms are convertable in the current context and environment+ |||+ ||| @ term1 the first term to convert+ ||| @ term2 the second term to convert+ converts : (term1, term2 : TT) -> Elab ()+ converts term1 term2 = convertsInEnv !getEnv term1 term2+ ||| Find the source context for the elaboration script getSourceLocation : Elab SourceLocation- getSourceLocation = prim__SourceLocation+ getSourceLocation = Prim__SourceLocation ||| Attempt to solve the current goal with the source code location sourceLocation : Elab ()@@ -389,7 +430,7 @@ ||| The namespace is represented as a reverse-order list of strings, ||| just as in the representation of names. currentNamespace : Elab (List String)- currentNamespace = prim__Namespace+ currentNamespace = Prim__Namespace ||| Attempt to rewrite the goal using an equality. |||@@ -397,43 +438,53 @@ ||| constructs a context for `replace` using them. In some cases, ||| this is not possible, and `replace` must be called manually with ||| an appropriate context.+ |||+ ||| Because this tactic internally introduces a `let` binding, it+ ||| requires that the hole be immediately under its binder (use+ ||| `attack` if it might not be). rewriteWith : Raw -> Elab ()- rewriteWith rule = prim__Rewrite rule+ rewriteWith rule = Prim__Rewrite rule ||| Add a type declaration to the global context. declareType : TyDecl -> Elab ()- declareType decl = prim__DeclareType decl+ declareType decl = Prim__DeclareType decl ||| Define a function in the global context. The function must have ||| already been declared, either in ordinary Idris code or using ||| `declareType`. defineFunction : FunDefn -> Elab ()- defineFunction defun = prim__DefineFunction defun+ defineFunction defun = Prim__DefineFunction defun - ||| Register a new instance for type class resolution+ ||| Register a new instance for type class resolution. ||| ||| @ className the name of the class for which an instance is being registered ||| @ instName the name of the definition to use in instance search addInstance : (className, instName : TTName) -> Elab ()- addInstance className instName = prim__AddInstance className instName+ addInstance className instName = Prim__AddInstance className instName + ||| Determine whether a name denotes a class.+ |||+ ||| @ name a name that might denote a class.+ isTCName : (name : TTName) -> Elab Bool+ isTCName name = Prim__IsTCName name+ ||| Attempt to solve the current goal with a type class dictionary ||| ||| @ fn the name of the definition being elaborated (to prevent Idris ||| from looping) resolveTC : (fn : TTName) -> Elab ()- resolveTC fn = prim__ResolveTC fn+ resolveTC fn = Prim__ResolveTC fn ||| Use Idris's internal proof search. search : Elab ()- search = prim__Search 100 []+ search = Prim__Search 100 [] ||| Use Idris's internal proof search, with more control. ||| ||| @ depth the search depth ||| @ hints additional names to try search' : (depth : Int) -> (hints : List TTName) -> Elab ()- search' depth hints = prim__Search depth hints+ search' depth hints = Prim__Search depth hints ||| Look up the declared fixity for an operator. |||@@ -442,14 +493,14 @@ ||| ||| @ operator the operator string to look up operatorFixity : (operator : String) -> Elab Fixity- operatorFixity operator = prim__Fixity operator+ operatorFixity operator = Prim__Fixity operator ||| Halt elaboration, dumping the internal state for inspection. ||| ||| This is intended for elaboration script developers, not for ||| end-users. Use `fail` for final scripts. debug : Elab a- debug = prim__Debug []+ debug = Prim__Debug [] ||| Halt elaboration, dumping the internal state and displaying a ||| message.@@ -459,17 +510,17 @@ ||| ||| @ msg the message to display debugMessage : (msg : List ErrorReportPart) -> Elab a- debugMessage msg = prim__Debug msg+ debugMessage msg = Prim__Debug msg ||| Create a new top-level metavariable to solve the current hole. ||| ||| @ name the name for the top-level variable metavar : (name : TTName) -> Elab ()- metavar name = prim__Metavar name+ metavar name = Prim__Metavar name ||| Recursively invoke the reflected elaborator with some goal. ||| ||| The result is the final term and its type. runElab : Raw -> Elab () -> Elab (TT, TT)- runElab goal script = prim__RecursiveElab goal script+ runElab goal script = Prim__RecursiveElab goal script
libs/prelude/Prelude.idr view
@@ -30,6 +30,7 @@ import public Prelude.Doubles import public Decidable.Equality import public Language.Reflection+import public Language.Reflection.Elab import public Language.Reflection.Errors %access public
libs/prelude/Prelude/Applicative.idr view
@@ -72,3 +72,7 @@ ||| Note: In Haskell, `choice` is called `asum`. choice : (Foldable t, Alternative f) => t (f a) -> f a choice x = foldr (<|>) empty x++||| A fused version of choice and map.+choiceMap : (Foldable t, Alternative f) => (a -> f b) -> t a -> f b+choiceMap f x = foldr (\elt, acc => f elt <|> acc) empty x
libs/prelude/Prelude/File.idr view
@@ -10,7 +10,8 @@ import Prelude.Bool import Prelude.Basics import Prelude.Classes-import Prelude.Monad+import Prelude.Either+import Prelude.Show import IO %access public@@ -19,6 +20,30 @@ abstract data File = FHandle Ptr +||| An error from a file operation+-- This is built in idris_mkFileError() in rts/idris_stdfgn.c. Make sure+-- the values correspond!+data FileError = FileReadError+ | FileWriteError+ | FileNotFound+ | PermissionDenied+ | GenericFileError Int -- errno++private+strError : Int -> String+strError err = unsafePerformIO -- yeah, yeah...+ (foreign FFI_C "idris_showerror" (Int -> IO String) err)++getFileError : IO FileError+getFileError = do MkRaw err <- foreign FFI_C "idris_mkFileError" + (Ptr -> IO (Raw FileError)) prim__vm+ return err++instance Show FileError where+ show FileNotFound = "File Not Found"+ show PermissionDenied = "Permission Denied"+ show (GenericFileError errno) = strError errno+ ||| Standard input stdin : File stdin = FHandle prim__stdin@@ -31,6 +56,13 @@ stderr : File stderr = FHandle prim__stderr +do_ferror : Ptr -> IO Int+do_ferror h = foreign FFI_C "fileError" (Ptr -> IO Int) h++ferror : File -> IO Bool+ferror (FHandle h) = do err <- do_ferror h+ return (not (err == 0))+ ||| Call the RTS's file opening function do_fopen : String -> String -> IO Ptr do_fopen f m@@ -39,12 +71,14 @@ ||| Open a file ||| @ f the filename ||| @ m the mode as a String (`"r"`, `"w"`, or `"r+"`)-fopen : (f : String) -> (m : String) -> IO File+fopen : (f : String) -> (m : String) -> IO (Either FileError File) fopen f m = do h <- do_fopen f m- return (FHandle h)+ if !(nullPtr h)+ then do err <- getFileError+ return (Left err)+ else return (Right (FHandle h)) ||| Check whether a file handle is actually a null pointer-partial validFile : File -> IO Bool validFile (FHandle h) = do x <- nullPtr h return (not x)@@ -55,33 +89,26 @@ ||| Open a file ||| @ f the filename ||| @ m the mode-partial-openFile : (f : String) -> (m : Mode) -> IO File+openFile : (f : String) -> (m : Mode) -> IO (Either FileError File) openFile f m = fopen f (modeStr m) where modeStr Read = "r" modeStr Write = "w" modeStr ReadWrite = "r+" -partial do_fclose : Ptr -> IO () do_fclose h = foreign FFI_C "fileClose" (Ptr -> IO ()) h -partial closeFile : File -> IO () closeFile (FHandle h) = do_fclose h -partial do_fread : Ptr -> IO' l String do_fread h = prim_fread h -fgetc : File -> IO Char-fgetc (FHandle h) = return (cast !(foreign FFI_C "fgetc" (Ptr -> IO Int) h))--fgetc' : File -> IO (Maybe Char)-fgetc' (FHandle h)- = do x <- foreign FFI_C "fgetc" (Ptr -> IO Int) h- if (x < 0) then return Nothing- else return (Just (cast x))+fgetc : File -> IO (Either FileError Char)+fgetc (FHandle h) = do let c = cast !(foreign FFI_C "fgetc" (Ptr -> IO Int) h)+ if !(ferror (FHandle h))+ then return (Left FileReadError)+ else return (Right c) fflush : File -> IO () fflush (FHandle h) = foreign FFI_C "fflush" (Ptr -> IO ()) h@@ -89,9 +116,12 @@ do_popen : String -> String -> IO Ptr do_popen f m = foreign FFI_C "do_popen" (String -> String -> IO Ptr) f m -popen : String -> Mode -> IO File+popen : String -> Mode -> IO (Either FileError File) popen f m = do ptr <- do_popen f (modeStr m)- return (FHandle ptr)+ if !(nullPtr ptr)+ then do err <- getFileError+ return (Left err)+ else return (Right (FHandle ptr)) where modeStr Read = "r" modeStr Write = "w"@@ -103,20 +133,25 @@ -- mkForeign (FFun "idris_readStr" [FPtr, FPtr] (FAny String)) -- prim__vm h -partial-fread : File -> IO' l String-fread (FHandle h) = do_fread h+fread : File -> IO (Either FileError String)+fread (FHandle h) = do str <- do_fread h+ if !(ferror (FHandle h))+ then return (Left FileReadError)+ else return (Right str) -partial-do_fwrite : Ptr -> String -> IO ()-do_fwrite h s = do prim_fwrite h s- return ()+do_fwrite : Ptr -> String -> IO (Either FileError ())+do_fwrite h s = do res <- prim_fwrite h s+ if (res /= 0)+ then do errno <- getErrno+ if errno == 0 + then return (Left FileWriteError)+ else do err <- getFileError+ return (Left err)+ else return (Right ()) -partial-fwrite : File -> String -> IO ()+fwrite : File -> String -> IO (Either FileError ()) fwrite (FHandle h) s = do_fwrite h s -partial do_feof : Ptr -> IO Int do_feof h = foreign FFI_C "fileEOF" (Ptr -> IO Int) h @@ -125,32 +160,34 @@ feof (FHandle h) = do eof <- do_feof h return (not (eof == 0)) -partial-do_ferror : Ptr -> IO Int-do_ferror h = foreign FFI_C "fileError" (Ptr -> IO Int) h--ferror : File -> IO Bool-ferror (FHandle h) = do err <- do_ferror h- return (not (err == 0))- fpoll : File -> IO Bool fpoll (FHandle h) = do p <- foreign FFI_C "fpoll" (Ptr -> IO Int) h return (p > 0) ||| Read the contents of a file into a string-partial -- no error checking!-readFile : String -> IO String-readFile fn = do h <- openFile fn Read+partial -- might be reading something infinitely long like /dev/null ... +covering+readFile : String -> IO (Either FileError String)+readFile fn = do Right h <- openFile fn Read+ | Left err => return (Left err) c <- readFile' h "" closeFile h return c where partial- readFile' : File -> String -> IO String+ readFile' : File -> String -> IO (Either FileError String) readFile' h contents = do x <- feof h- if not x then do l <- fread h+ if not x then do Right l <- fread h+ | Left err => return (Left err) readFile' h (contents ++ l)- else return contents-+ else return (Right contents) +||| Write a string to a file+writeFile : (filepath : String) -> (contents : String) -> + IO (Either FileError ())+writeFile fn contents = do+ Right h <- openFile fn Write | Left err => return (Left err)+ Right () <- fwrite h contents | Left err => return (Left err)+ closeFile h+ return (Right ())
libs/prelude/Prelude/Functor.idr view
@@ -2,19 +2,21 @@ import Prelude.Basics -||| Functors-||| @ f the action of the functor on objects+||| Functors allow a uniform action over a parameterised type.+||| @ f a parameterised type class Functor (f : Type -> Type) where- ||| The action of the functor on morphisms- ||| @ f the functor- ||| @ m the morphism+ ||| Apply a function across everything of type 'a' in a + ||| parameterised type+ ||| @ f the parameterised type+ ||| @ m the function to apply map : (m : a -> b) -> f a -> f b infixl 4 <$> -||| An infix alias for `map`: the action of a functor on morphisms.-||| @ f the functor-||| @ m the morphism+||| An infix alias for `map`, applying a function across everything of+||| type 'a' in a parameterised type+||| @ f the parameterised type+||| @ m the function to apply (<$>) : Functor f => (m : a -> b) -> f a -> f b m <$> x = map m x
libs/prelude/Prelude/Interactive.idr view
@@ -17,6 +17,7 @@ import Prelude.Cast import Prelude.Maybe import Prelude.Functor+import Prelude.Either import Prelude.Monad import IO @@ -24,33 +25,58 @@ ---- some basic io +||| Output a string to stdout without a trailing newline, for any FFI+||| descriptor+putStr' : String -> IO' ffi ()+putStr' x = do prim_write x+ return ()+ ||| Output a string to stdout without a trailing newline-putStr : String -> IO' ffi ()-putStr x = do prim_write x- return ()+putStr : String -> IO ()+putStr = putStr' +||| Output a string to stdout with a trailing newline, for any FFI+||| descriptor+putStrLn' : String -> IO' ffi ()+putStrLn' x = putStr' (x ++ "\n")+ ||| Output a string to stdout with a trailing newline-putStrLn : String -> IO' ffi ()-putStrLn x = putStr (x ++ "\n")+putStrLn : String -> IO ()+putStrLn = putStrLn' +||| Output something showable to stdout, without a trailing newline, for any FFI+||| descriptor+print' : Show a => a -> IO' ffi ()+print' x = putStr' (show x)+ ||| Output something showable to stdout, without a trailing newline-print : Show a => a -> IO' ffi ()-print x = putStr (show x)+print : Show a => a -> IO ()+print = print' +||| Output something showable to stdout, with a trailing newline, for any FFI+||| descriptor+printLn' : Show a => a -> IO' ffi ()+printLn' x = putStrLn' (show x)+ ||| Output something showable to stdout, with a trailing newline-printLn : Show a => a -> IO' ffi ()-printLn x = putStrLn (show x)+printLn : Show a => a -> IO ()+printLn = printLn' -||| Read one line of input from stdin, without the trailing newline-getLine : IO' ffi String-getLine = do x <- prim_read- return (reverse (trimNL (reverse x)))+||| Read one line of input from stdin, without the trailing newline, for any FFI+||| descriptor+getLine' : IO' ffi String+getLine' = do x <- prim_read+ return (reverse (trimNL (reverse x))) where trimNL : String -> String trimNL str with (strM str) trimNL "" | StrNil = "" trimNL (strCons '\n' xs) | StrCons _ _ = xs trimNL (strCons x xs) | StrCons _ _ = strCons x xs +||| Read one line of input from stdin, without the trailing newline+getLine : IO String+getLine = getLine'+ ||| Write a single character to stdout putChar : Char -> IO () putChar c = foreign FFI_C "putchar" (Int -> IO ()) (cast c)@@ -97,7 +123,8 @@ processHandle h acc onRead onEOF = if !(feof h) then putStr (onEOF acc)- else do x <- fread h+ else do Right x <- fread h+ | Left err => putStr (onEOF acc) let (out, acc') = onRead acc x putStr out processHandle h acc' onRead onEOF
libs/prelude/Prelude/Monad.idr view
@@ -13,7 +13,7 @@ infixl 5 >>= class Applicative m => Monad (m : Type -> Type) where- (>>=) : m a -> (a -> m b) -> m b+ (>>=) : m a -> ((result : a) -> m b) -> m b ||| Also called `join` or mu flatten : Monad m => m (m a) -> m a
libs/prelude/Prelude/Nat.idr view
@@ -216,45 +216,45 @@ ||| A wrapper for Nat that specifies the semigroup and monad instances that use (*) record Multiplicative where- constructor getMultiplicative+ constructor GetMultiplicative _ : Nat ||| A wrapper for Nat that specifies the semigroup and monad instances that use (+) record Additive where- constructor getAdditive + constructor GetAdditive _ : Nat instance Semigroup Multiplicative where- (<+>) left right = getMultiplicative $ left' * right'+ (<+>) left right = GetMultiplicative $ left' * right' where left' : Nat left' = case left of- getMultiplicative m => m+ GetMultiplicative m => m right' : Nat right' = case right of- getMultiplicative m => m+ GetMultiplicative m => m instance Semigroup Additive where- left <+> right = getAdditive $ left' + right'+ left <+> right = GetAdditive $ left' + right' where left' : Nat left' = case left of- getAdditive m => m+ GetAdditive m => m right' : Nat right' = case right of- getAdditive m => m+ GetAdditive m => m instance Monoid Multiplicative where- neutral = getMultiplicative $ S Z+ neutral = GetMultiplicative $ S Z instance Monoid Additive where- neutral = getAdditive Z+ neutral = GetAdditive Z ||| Casts negative `Ints` to 0. instance Cast Int Nat where
libs/prelude/Prelude/Show.idr view
@@ -10,6 +10,7 @@ import Prelude.Classes import Prelude.List import Prelude.Maybe+import Prelude.Either import Prelude.Nat import Prelude.Strings @@ -184,6 +185,10 @@ instance Show a => Show (Maybe a) where showPrec d Nothing = "Nothing" showPrec d (Just x) = showCon d "Just" $ showArg x++instance (Show a, Show b) => Show (Either a b) where+ showPrec d (Left x) = showCon d "Left" $ showArg x+ showPrec d (Right x) = showCon d "Right" $ showArg x instance (Show a, {y : a} -> Show (p y)) => Show (Sigma a p) where show (y ** prf) = "(" ++ show y ++ " ** " ++ show prf ++ ")"
libs/prelude/Prelude/Stream.idr view
@@ -109,6 +109,15 @@ scanr : (f : a -> Inf b -> b) -> (xs : Stream a) -> Stream b scanr f (x :: xs) = f x (foldr f xs) :: scanr f xs +||| Produce a Stream repeating a sequence+||| @ xs the sequence to repeat+||| @ ok proof that the list is non-empty+cycle : (xs : List a) -> {auto ok : NonEmpty xs} -> Stream a+cycle {a} (x :: xs) {ok = IsNonEmpty} = x :: cycle' xs+ where cycle' : List a -> Stream a+ cycle' [] = x :: cycle' xs+ cycle' (y :: ys) = y :: cycle' ys+ instance Applicative Stream where pure = repeat (<*>) = zipWith apply
libs/prelude/prelude.ipkg view
@@ -1,6 +1,6 @@ package prelude -opts = "--nobuiltins --total"+opts = "--nobuiltins --total --no-elim-deprecation-warnings" modules = Builtins, Prelude, IO, Prelude.Algebra, Prelude.Basics, Prelude.Bool, Prelude.Cast,
+ libs/pruviloj/Makefile view
@@ -0,0 +1,21 @@+IDRIS := idris+PKG := pruviloj++build:+ $(IDRIS) --build ${PKG}.ipkg++clean:+ $(IDRIS) --clean ${PKG}.ipkg++install:+ $(IDRIS) --install ${PKG}.ipkg++rebuild: clean build++doc:+ $(IDRIS) --mkdoc ${PKG}.ipkg++doc_clean:+ rm -rf ${PKG}_doc++.PHONY: build clean install rebuild doc doc_clean
+ libs/pruviloj/Pruviloj.idr view
@@ -0,0 +1,8 @@+||| Provides the whole public interface of the proof tools. Import+||| `Pruviloj.Core` for just the simplest tactics.+module Pruviloj++import public Pruviloj.Core+import public Pruviloj.Disjoint+import public Pruviloj.Induction+import public Pruviloj.Injective
+ libs/pruviloj/Pruviloj/Core.idr view
@@ -0,0 +1,268 @@+||| Core tactics for working with Elab reflection. These will be used+||| by most reasonable scripts, and they may be candidates for+||| eventual Prelude inclusion.+module Pruviloj.Core++import Language.Reflection.Utils++||| Run something for effects, throwing away the return value+ignore : Functor f => f a -> f ()+ignore x = map (const ()) x++||| Do nothing+skip : Applicative f => f ()+skip = pure ()++||| Attempt to apply a tactic. If it fails, do nothing.+try : Alternative f => f a -> f ()+try tac = ignore tac <|> pure ()++||| Remove type information from a `TT` term, in a context. Fails if+||| de Bruijn indices are out of scope.+forget' : List TTName -> TT -> Elab Raw+forget' env (P nt n tm) = pure (Var n)+forget' env (V x) = Var <$> getName x env+ where getName : Int -> List a -> Elab a+ getName _ [] = fail [TextPart "Scope error when forget'ting types"]+ getName i (n::ns) = if i <= 0 then pure n else getName (i-1) ns+forget' env (Bind n b tm) =+ [| (RBind n)+ (assert_total $ traverse (forget' env) b)+ (forget' (n::env) tm) |]+forget' env (App tm tm') = [| RApp (forget' env tm) (forget' env tm') |]+forget' env (TConst c) = pure (RConstant c)+forget' env Erased = pure (RConstant Forgot)+forget' env (TType uexp) = pure RType+forget' env (UType uni) = pure (RUType uni)++||| Remove type information from a `TT` term. Fails if de Bruijn+||| indices are out of scope.+forget : TT -> Elab Raw+forget tm = forget' [] tm++||| Get the goal type as a Raw term. Fails if there are no holes.+goalType : Elab Raw+goalType = do g <- getGoal+ forget (snd g)++||| Solve the goal using the most recent applicable hypothesis+hypothesis : Elab ()+hypothesis =+ do hyps <- map fst <$> getEnv+ flip choiceMap hyps $ \n =>+ do fill (Var n)+ solve+++||| Generate a unique name (using `gensym`) that looks like some+||| previous name, for ease of debugging code generators.+nameFrom : TTName -> Elab TTName+nameFrom (UN x) =+ gensym $ if length x == 0 || ("_" `isPrefixOf` x)+ then "x"+ else x+nameFrom (NS n ns) =+ nameFrom n -- throw out namespaces here, because we want to+ -- generate bound var names+nameFrom (MN x n) =+ gensym $ if length n == 0 || ("_" `isPrefixOf` n)+ then "n"+ else n+nameFrom (SN x) = gensym "SN"++||| Get the name at the head of the term, if it exists.+headName : Raw -> Maybe TTName+headName (RApp f _) = headName f+headName (Var n) = Just n+headName x = Nothing++||| Create a new hole with a given type without changing the+||| focus. Return the name of the hole.+|||+||| @ hint the hint to pass to `gensym`+||| @ ty the type of the new hole+newHole : (hint : String) -> (ty : Raw) -> Elab TTName+newHole hint ty =+ do hn <- gensym hint+ claim hn ty+ return hn++||| Use a term to solve a hole+|||+||| @ tm the term that has the right type for the hole+exact : (tm : Raw) -> Elab ()+exact tm = do apply tm []+ solve++||| Introduce as many names as possible, returning them.+intros : Elab (List TTName)+intros = do g <- snd <$> getGoal+ go g+ where go : TT -> Elab (List TTName)+ go (Bind n (Pi _ _) body) =+ do n' <- nameFrom n+ intro n'+ (n' ::) <$> go body+ go _ = return []++||| Run a tactic inside of a particular hole, if it still exists. If+||| it has been solved, do nothing.+inHole : TTName -> Elab a -> Elab (Maybe a)+inHole h todo =+ if (h `elem` !getHoles)+ then do focus h; Just <$> todo+ else return Nothing++||| Restrict a polymorphic type to () for contexts where it doesn't+||| matter. This is nice for sticking `debug` in a context where+||| Idris can't solve the type.+simple : {m : Type -> Type} -> m () -> m ()+simple x = x++||| Replace the current goal with one that's definitionally+||| equal. Return the name of the new goal, and ensure that it's+||| focused.+|||+||| @ newGoal A type that is equivalent to the current goal+equiv : (newGoal : Raw) -> Elab TTName+equiv newGoal =+ do h <- gensym "goal"+ claim h newGoal+ fill (Var h); solve+ focus h+ return h++||| Remember a term built with elaboration for later use. If the+||| current goal is `h`, then `remember n ty` puts a fresh hole at+||| the front of the queue, with the old goal `h` second. The+||| contents of this hole end up let-bound in the scope of+||| `h`. Return the name of the new hole, in case it will be used+||| later.+|||+||| @ n the name to be used to save the term+||| @ ty the type to inhabit+remember : (n : TTName) -> (ty : Raw) -> Elab TTName+remember n ty =+ do todo <- gensym "rememberThis"+ claim todo ty+ letbind n ty (Var todo)+ focus todo+ return todo++||| Repeat a given tactic until it fails. Fails if the tactic fails on+||| the first attempt; succeeds otherwise.+repeatUntilFail : Elab () -> Elab ()+repeatUntilFail tac =+ do tac+ repeatUntilFail tac <|> return ()++||| If the current goal is a pattern-bound variable, bind it with the+||| expected name. Otherwise fail.+bindPat : Elab ()+bindPat = do compute+ g <- snd <$> getGoal+ case g of+ Bind n (PVTy _) _ => patbind n+ _ => fail [TermPart g, TextPart "isn't looking for a pattern."]++||| The underlying implementation type for the inferType operator.+data Infer : Type where+ MkInfer : (a : Type) -> a -> Infer++||| Run a tactic script in a context where the type of the resulting+||| expression must be solvable via unification. Return the term and+||| its type.+|||+||| @ tac a tactic script that will be run with focus on the hole+||| whose type is to be inferred.+total+inferType : (tac : Elab ()) -> Elab (TT, TT)+inferType tac =+ case fst !(runElab `(Infer) (startInfer *> tac)) of+ `(MkInfer ~ty ~tm) => return (tm, ty)+ _ => fail [TextPart "Not infer"]+ where+ startInfer : Elab ()+ startInfer = do [_, tmH] <- apply (Var `{MkInfer}) [True, False]+ | err => fail [TextPart "Type inference failure"]+ solve+ focus tmH++||| Given one tactic that produces a list of subgoal names and another+||| that produces some result, run the second tactic in each hole+||| produced by the first and return the resulting values.+|||+||| Elab has no built-in notion of "subgoals", so this simulates the+||| Coq or JonPRL semicolon operators.+|||+||| @ first run this tactic to produce subgoals+||| @ after run this tactic in each subgoal+andThen : (first : Elab (List TTName)) -> (after : Elab a) -> Elab (List a)+andThen first after =+ do hs <- first+ catMaybes <$> for hs (flip inHole after)++||| Refine the current goal using some term, constructing holes for+||| all arguments that can't be inferred. Return the list of generated+||| holes.+|||+||| @ tm the term to apply to some number of goals+refine : (tm : Raw) -> Elab (List TTName)+refine tm =+ do ty <- (snd <$> check !getEnv tm) >>= forget+ g <- goalType++ -- we don't care about negative results because it'll just fail anyway+ let argCount = minus (countPi ty) (countPi g)+ newHoles <- apply tm (replicate argCount True)+ solve+ actualHoles <- getHoles+ return (filter (flip elem actualHoles) newHoles)++ where countPi : Raw -> Nat+ countPi (RBind _ (Pi _ _) body) = S (countPi body)+ countPi _ = Z+++||| Split a pair into its projections, binding them in the context+||| with the supplied names. A special case of Coq's `inversion`.+both : Raw -> TTName -> TTName -> Elab ()+both tm n1 n2 =+ do -- We don't know that the term is canonical, so let-bind projections applied to it+ (A, B) <- isPairTy (snd !(check !getEnv tm))+ remember n1 A; apply `(fst {a=~A} {b=~B} ~tm) []; solve+ remember n2 B; apply `(snd {a=~A} {b=~B} ~tm) []; solve+ where+ isPairTy : TT -> Elab (Raw, Raw)+ isPairTy `((~A, ~B) : Type) = [| MkPair (forget A) (forget B) |]+ isPairTy tm = fail [TermPart tm, TextPart "is not a pair"]++||| Let-bind all results of completely destructuring nested tuples.+|||+||| This makes them available to the `hypothesis` tactic, among others.+|||+||| @ tm the nested tuple to destructure+covering+unproduct : (tm : Raw) -> Elab ()+unproduct tm =+ do n1 <- gensym "left"+ n2 <- gensym "right"+ both tm n1 n2+ try (unproduct (Var n1))+ try (unproduct (Var n2))+++||| A special-purpose tactic that attempts to solve a goal using+||| `Refl`. This is useful for ensuring that goals in fact are trivial+||| when developing or testing other tactics; otherwise, consider+||| using `search`.+reflexivity : Elab ()+reflexivity =+ case !goalType of+ `((=) {A=~A} {B=~_} ~x ~_) =>+ do fill `(Refl {A=~A} {x=~x})+ solve+ _ => fail [ TextPart "The goal is not an equality, so"+ , NamePart `{reflexivity}+ , TextPart "is not applicable."+ ]
+ libs/pruviloj/Pruviloj/Derive/DecEq.idr view
@@ -0,0 +1,198 @@+||| Derive implementations of decidable equality.+module Pruviloj.Derive.DecEq++import Data.Fin+import Data.Vect++import Language.Reflection.Utils++import Pruviloj.Core++import Pruviloj.Renamers+import Pruviloj.Internals++import Pruviloj.Derive.Eliminators++import Pruviloj.Disjoint+import Pruviloj.Induction+import Pruviloj.Injective++%default total+%access private+++covering+noCase : TTName -> Elab ()+noCase contra =+ do [_, nope] <- apply (Var `{No}) [True, False]+ | _ => fail [TextPart "Bad holes from", NamePart `{Tactics.apply}]+ solve+ focus nope++ -- Construct a lambda binding an assumption from which we can+ -- derive the contradiction+ h <- gensym "h"+ inj <- gensym "inj"+ attack+ intro h+ injective (Var h) inj+ unproduct (Var inj)+ ignore $ refine (Var contra) `andThen` hypothesis+ solve -- attack++partial -- TODO make covering/total+matchCase : List Raw -> Elab ()+matchCase [] = search+matchCase (tm :: tms) =+ do hs <- induction tm+ y <- unsafeNth 0 hs+ n <- unsafeNth 1 hs++ focus n; compute+ contra <- gensym "contra"+ attack; intro contra+ noCase contra; solve++ focus y; compute+ prf <- gensym "prf"+ attack; intro prf+ rewriteWith (Var prf)+ matchCase tms+ solve++spanM : (Monad m) => (a -> m Bool) -> List a -> m (List a, List a)+spanM p [] = pure ([], [])+spanM p (x::xs) =+ if !(p x)+ then do (yes, no) <- spanM p xs+ pure (x :: yes, no)+ else pure ([], x::xs)++partitionM : Monad m => (a -> m Bool) -> List a -> m (List a, List a)+partitionM p [] = pure ([], [])+partitionM p (x :: xs) =+ do (y, n) <- partitionM p xs+ if !(p x) then pure (x :: y, n) else pure (y, x :: n)++perhaps : (Alternative f) => (f a) -> (f (Maybe a))+perhaps x = (Just <$> x) <|> pure Nothing++headIs : Raw -> TTName -> Bool+headIs tm n = maybe False (==n) (headName tm)++partial+mkRhs : (fn, fam : TTName) -> Nat -> Elab ()+mkRhs fn fam k =+ case snd !getGoal of+ `(Dec ((=) {A=~A} {B=~_} ~x ~y)) =>+ let (c1, args1) = unApply x+ (c2, args2) = unApply y+ in if c1 /= c2+ then do (h :: _) <- refine (Var `{No})+ | _ => empty+ focus h+ disjoint+ else do let toMakeEqual = List.filter (uncurry (/=)) (zip args1 args2)+ tms <- for {b=Raw} toMakeEqual $ \(tm1, tm2) =>+ do env <- getEnv+ (tm1', ty1') <- forget tm1 >>= check env+ (tm2', ty2') <- forget tm2 >>= check env+ -- assume they have the same type here -+ -- reasonable due to same constructor, but+ -- this means order is important when+ -- traversing+ eq <- gensym "eq"+ rTy <- forget ty1'+ rTm1 <- forget tm1'+ rTm2 <- forget tm2'+ remember eq `(Dec ((=) {A=~rTy} {B=~rTy} ~rTm1 ~rTm2))+ simple $+ if headIs rTy fam+ then do (a2::a1::hs) <- reverse <$> apply (Var fn) (replicate k True ++ [False, False])+ solve+ focus a1; fill rTm1; solve+ focus a2; fill rTm2; solve+ for_ hs $ \h => inHole h (resolveTC fn)+ else do [_, dH, a1, a2] <- apply (Var `{decEq}) [True, False, False, False]+ solve+ focus a1; fill rTm1; solve+ focus a2; fill rTm2; solve+ focus dH; resolveTC fn+ return (Var eq)+ matchCase tms+ _ => fail [TextPart "Inapplicable"]++||| Attempt to derive the body of an implementation of decidable+||| equality based on an existing type signature.+|||+||| The function signature must provide enough information for the+||| deriving to occur. It must consist of zero or more non-constraint+||| arguments followed by zero or more constraint arguments, followed+||| by the two values to compare. The constraint arguments must+||| provide sufficient instances of `DecEq` to decide the equality of+||| each constructor field. The final two arguments to the function+||| declaration must be the two values that will be compared for+||| equality.+|||+||| @ fn the name of the function whose type has been declared+abstract partial -- because of mkRhs+deriveDecEq : (fn : TTName) -> Elab ()+deriveDecEq fn =+ do (_, Ref, sig') <- lookupTyExact fn+ sig <- forget sig'+ (args, `(Dec ((=) {A=~A} {B=~_} ~(Var x) ~(Var y)))) <- stealBindings sig noRenames+ | other => fail [ TextPart "Return type"+ , RawPart (snd other)+ , TextPart "isn't decidable equality"+ ]++ datatype <- maybe (fail [ RawPart A+ , TextPart "is not an application of a TC"+ ])+ lookupDatatypeExact+ (headName A)++ -- the signature must be like this:+ -- 1. a collection of variable bindings (will be implicit)+ -- 2. a collection of constraints+ -- 3. the arguments x and y from the return type+ (bindings, constrs, arg1, arg2) <-+ the (Elab (List (TTName, Binder Raw),+ List (TTName, Binder Raw),+ (TTName, Binder Raw),+ (TTName, Binder Raw))) $+ case reverse args of+ [] => fail [TextPart "Invalid signature"]+ [_] => fail [TextPart "Invalid signaure"]+ (a2 :: a1 :: rest) =>+ do (constrs, bindings) <- partitionM (\x => isConstr (binderTy (snd x)))+ (reverse rest)+ return (bindings, constrs, a1, a2)+ let todo = [(c1, c2) | c1 <- constructors datatype+ , c2 <- constructors datatype]+ clauses <- for todo+ (uncurry $ mkCase (length bindings + length constrs)+ (name datatype))+ defineFunction $ DefineFun fn (catMaybes clauses)+ skip++ where+ isConstr : Raw -> Elab Bool+ isConstr tm = case headName tm of+ Just n => isTCName n+ Nothing => return False++ partial -- mkRhs+ mkCase : Nat -> TTName -> (x, y : (TTName, List CtorArg, Raw)) -> Elab (Maybe FunClause)+ mkCase k fam (cn1, args1, _) (cn2, args2, _) =+ perhaps $ elabPatternClause+ (do (h2 :: h1 :: _) <- reverse <$>+ apply (Var fn) (replicate k True ++ [False, False])+ solve+ focus h1+ apply (Var cn1) (replicate (length args1) True)+ solve+ focus h2+ apply (Var cn2) (replicate (length args2) True)+ solve)+ (mkRhs fn fam k)
+ libs/pruviloj/Pruviloj/Derive/Eliminators.idr view
@@ -0,0 +1,268 @@+module Pruviloj.Derive.Eliminators++import Language.Reflection.Utils+import Data.Vect++import Pruviloj.Core+import Pruviloj.Internals.TyConInfo+import Pruviloj.Internals+import Pruviloj.Renamers+++%access private++bindParams : TyConInfo -> Elab ()+bindParams info = traverse_ (uncurry forall) (getParams info)++||| Bind indices at new names and return a renamer that's used to+||| rewrite an application of something to their designated global+||| names+bindIndices : TyConInfo -> Elab Renamer+bindIndices info = bind' (getIndices info) noRenames+ where bind' : List (TTName, Raw) -> Renamer -> Elab Renamer+ bind' [] ren = return ren+ bind' ((n, t) :: ixs) ren = do n' <- nameFrom n+ forall n' (alphaRaw ren t)+ bind' ixs (extend ren n n')++||| Return the renaming required to use the result type for this+||| binding of the indices+bindTarget : TyConInfo -> Elab (TTName, Renamer)+bindTarget info = do ren <- bindIndices info+ tn <- gensym "target"+ forall tn (alphaRaw ren $ result info)+ return (tn, ren)++elabMotive : TyConInfo -> Elab ()+elabMotive info = do attack+ ren <- bindIndices info+ x <- gensym "scrutinee"+ forall x (alphaRaw ren $ result info)+ fill `(Type)+ solve -- the attack+ solve -- the motive type hole+++++headsMatch : Raw -> Raw -> Bool+headsMatch x y =+ case (headName x, headName y) of+ (Just n1, Just n2) => n1 == n2+ _ => False++||| Make an induction hypothesis if one is called for+mkIh : TyConInfo -> (motiveName : TTName) -> (recArg : TTName) -> (argty, fam : Raw) -> Elab ()+mkIh info motiveName recArg argty fam =+ case !(stealBindings argty noRenames) of+ (argArgs, argRes) =>+ if headsMatch argRes fam+ then do ih <- gensym "ih"+ ihT <- newHole "ihT" `(Type)+ forall ih (Var ihT)+ focus ihT+ attack+ for_ {b=()} argArgs $ \(n, b) =>+ forall n (getBinderTy b)+ let argTm : Raw = mkApp (Var recArg) (map (Var . fst) argArgs)+ argTmTy <- forget (snd !(check !getEnv argTm))+ argHoles <- apply (Var motiveName)+ (replicate (length (getIndices info))+ True +++ [False])+ argH <- last argHoles+ focus argH+ fill argTm; solve+ solve -- attack+ solve -- ihT+ else return ()++elabMethodTy : TyConInfo -> TTName -> List CtorArg -> Raw -> Raw -> Elab ()+elabMethodTy info motiveName [] res ctorApp =+ do argHoles <- apply (Var motiveName)+ (replicate (length (getIndices info)) True +++ [False])+ argH <- last argHoles+ focus argH; fill ctorApp; solve+ solve+elabMethodTy info motiveName (CtorParameter arg :: args) res ctorApp =+ elabMethodTy info motiveName args res (RApp ctorApp (Var (name arg)))+elabMethodTy info motiveName (CtorField arg :: args) res ctorApp =+ do let n = name arg+ let t = type arg+ attack; forall n t+ mkIh info motiveName n t (result info)+ elabMethodTy info motiveName args res (RApp ctorApp (Var n))+ solve+++||| Bind a method for a constructor+bindMethod : TyConInfo -> (motiveName, cn : TTName) -> List CtorArg -> Raw -> Elab ()+bindMethod info motiveName cn cargs cty =+ do n <- nameFrom cn+ h <- newHole "methTy" `(Type)+ forall n (Var h)+ focus h; elabMethodTy info motiveName cargs cty (Var cn)++getElimTy : TyConInfo -> List (TTName, List CtorArg, Raw) -> Elab Raw+getElimTy info ctors =+ do ty <- runElab `(Type) $+ do bindParams info+ (scrut, iren) <- bindTarget info+ motiveN <- gensym "P"+ motiveH <- newHole "motive" `(Type)+ forall motiveN (Var motiveH)+ focus motiveH+ elabMotive info++ for_ {b=()} ctors $ \(cn, cargs, cresty) =>+ bindMethod info motiveN cn cargs cresty+ let ret = mkApp (Var motiveN)+ (map (Var . fst)+ (getIndices info) +++ [Var scrut])+ apply (alphaRaw iren ret) []+ solve+ forget (fst ty)++++data ElimArg = IHArgument TTName | NormalArgument TTName++instance Show ElimArg where+ show (IHArgument x) = "IHArgument " ++ show x+ show (NormalArgument x) = "NormalArgument " ++ show x++getElimClause : TyConInfo -> (elimn : TTName) -> (methCount : Nat) ->+ (TTName, List CtorArg, Raw) -> Nat -> Elab FunClause+getElimClause info elimn methCount (cn, args, resTy) whichCon =+ elabPatternClause+ (do -- Establish a hole for each parameter+ for (getParams info) {b=()} $ \(n, ty) =>+ do claim n ty+ unfocus n+++ -- Establish a hole for each argument to the constructor+ for {b=()} args $ \arg =>+ case arg of+ CtorParameter _ => return ()+ CtorField arg => do claim (name arg) (type arg)+ unfocus (name arg)++ -- Establish a hole for the scrutinee (infer type)+ scrutinee <- newHole "scrutinee" resTy+++ -- Apply the eliminator to the proper holes+ let paramApp : Raw = mkApp (Var elimn) $+ map (Var . fst) (getParams info)++ -- We leave the RHS with a function type: motive -> method* -> res+ -- to make it easier to map methods to constructors+ holes <- apply paramApp (replicate (length (getIndices info))+ True +++ [False])+ scr <- last holes+ focus scr; fill (Var scrutinee); solve+ solve++ -- Fill the scrutinee with the concrete constructor pattern+ focus scrutinee+ apply (mkApp (Var cn) $+ map (\x => case x of+ CtorParameter param => Var (name param)+ CtorField arg => Var (name arg))+ args)+ []+ solve)+ (do motiveN <- gensym "motive"+ intro motiveN+ prevMethods <- doTimes whichCon intro1+ methN <- gensym "useThisMethod"+ intro methN+ nextMethods <- intros++ argSpec <- Foldable.concat <$>+ for args+ (\x =>+ case x of+ CtorParameter _ => return List.Nil+ CtorField arg =>+ do let n = name arg+ let t = type arg+ (argArgs, argRes) <- stealBindings t noRenames+ if headsMatch argRes (result info) --recursive+ then return [ NormalArgument n+ , IHArgument n+ ]+ else return [NormalArgument n])++ argHs <- apply (Var methN) (replicate (List.length argSpec) True)+ solve++ -- Now build the recursive calls for the induction hypotheses+ for_ {a=(ElimArg, TTName)} {b=()}+ !(zipH argSpec argHs)+ (\(spec, nh) =>+ case spec of+ NormalArgument n => do focus nh+ apply (Var n) []+ solve+ IHArgument n =>+ do focus nh+ attack+ local <- intros+ ihHs <- apply (Var elimn) $+ replicate (length (TyConInfo.args info)) True +++ [False] +++ replicate (S methCount) True+ solve -- application++ let (arg::motive::methods) = drop (length (TyConInfo.args info)) ihHs+ focus arg++ apply (mkApp (Var n) (map Var local)) []; solve+ solve -- attack+++ focus motive; fill (Var motiveN); solve+ let methodArgs : List TTName = toList prevMethods ++ [methN] ++ nextMethods+ remaining <- zipH methods methodArgs++ for_ {b=()} remaining $ \todo =>+ do focus (fst todo)+ fill (Var (snd todo))+ solve))++++ where bindLam : List (TTName, Binder Raw) -> Raw -> Raw+ bindLam [] x = x+ bindLam ((n, b)::rest) x = RBind n (Lam (getBinderTy b)) $ bindLam rest x++getElimClauses : TyConInfo -> (elimn : TTName) ->+ List (TTName, List CtorArg, Raw) -> Elab (List FunClause)+getElimClauses info elimn ctors =+ let methodCount = length ctors+ in traverse (\(i, con) => getElimClause info elimn methodCount con i)+ (enumerate ctors)++instance Show FunClause where+ show (MkFunClause x y) = "(MkFunClause " ++ show x ++ " " ++ show y ++ ")"++abstract+deriveElim : (tyn, elimn : TTName) -> Elab ()+deriveElim tyn elimn =+ do -- Begin with some basic sanity checking: the type name uniquely+ -- determines a datatype+ (MkDatatype tyn tyconArgs tyconRes ctors') <- lookupDatatypeExact tyn++ info <- getTyConInfo tyconArgs (Var tyn)+ ctors <- traverse (processCtorArgs info) ctors'+ declareType $ Declare elimn [] !(getElimTy info ctors)+ clauses <- getElimClauses info elimn ctors++ defineFunction $ DefineFun elimn clauses+ return ()+
+ libs/pruviloj/Pruviloj/Disjoint.idr view
@@ -0,0 +1,85 @@+||| Provides a tactic for solving constructor disjointness goals.+module Pruviloj.Disjoint++import Language.Reflection.Utils++import Pruviloj.Core+import Pruviloj.Internals+import Pruviloj.Renamers++%default total+%access private++-------------------+-- PRIVATE GUTS --+-------------------++||| Compute the name to use for a disjointness lemma.+disjointName : TTName -> TTName -> TTName+disjointName l r = NS (SN (MetaN (UN "disjoint") (SN (MetaN l r))))+ ["Disjoint", "Pruviloj"]++||| Return the name of the disjointness lemma for two constructors,+||| defining it if necessary.+|||+||| @ l one of the constructor names+||| @ r the other constructor name+covering+getDisjointness : (l, r : TTName) -> Elab TTName+getDisjointness l r = exists <|> declare++ where exists : Elab TTName+ exists = do (yep, _, _) <- lookupTyExact (disjointName l r)+ return yep++ notConstructor : TTName -> Elab a+ notConstructor c = fail [NamePart c, TextPart "is not a constructor"]++ covering+ declare : Elab TTName+ declare = do (l', DCon _ _, lty) <- lookupTyExact l+ | _ => notConstructor l+ (r', DCon _ _, rty) <- lookupTyExact r+ | _ => notConstructor r+ let fn = disjointName l' r'+ when (l' == r') $+ fail [ NamePart l', TextPart "and"+ , NamePart r', TextPart "are clearly not disjoint!"+ ]+ (argsl, resl) <- stealBindings !(forget lty) noRenames+ (argsr, resr) <- stealBindings !(forget rty) noRenames+ let args = map {b=FunArg}+ (\(n, b) => MkFunArg n (binderTy b) Implicit NotErased)+ (argsl ++ argsr)+ let eq : Raw = `((=) {A=~resl}+ {B=~resr}+ ~(mkApp (Var l') (map (Var . fst) argsl))+ ~(mkApp (Var r') (map (Var . fst) argsr)))+ h <- gensym "h"+ declareType $ Declare fn (args ++ [MkFunArg h eq Explicit NotErased]) `(Void)+ defineFunction $ DefineFun fn []+ return fn++----------------------+-- PUBLIC INTERFACE --+----------------------+++||| Solve a goal of the form `(C1 x1 x2 ... xn = C2 x1 x2 ... xn) ->+||| Void` for disjoint constructors `C1` and `C2`.+public covering+disjoint : Elab ()+disjoint =+ do compute+ g <- snd <$> getGoal+ case g of+ `(((=) {A=~A} {B=~B} ~a ~b) -> Void) =>+ do Just lHead <- headName <$> forget a+ | Nothing => fail [TermPart a, TextPart "doesn't have a name at the head"]+ Just rHead <- headName <$> forget b+ | Nothing => fail [TermPart b, TextPart "doesn't have a name at the head"]+ [] <- refine (Var !(getDisjointness lHead rHead))+ | _ => fail [TextPart "Didn't solve argument to disjointness lemma"]+ skip+ ty =>+ fail [NamePart `{disjoint}, TextPart "is not applicable to goal", TermPart ty]
+ libs/pruviloj/Pruviloj/Induction.idr view
@@ -0,0 +1,157 @@+module Pruviloj.Induction++import Language.Reflection.Utils++import Pruviloj.Core+import Pruviloj.Derive.Eliminators+import Pruviloj.Internals.TyConInfo+import Pruviloj.Internals+import Pruviloj.Renamers+++%access private++-- To perform induction:+-- 1. Type check the thing to do induction on+-- 2. If its type is not an inductive family, error+-- 3. Ensure that there exists an eliminator for the family+-- 4. Abstract the goal over the scrutinee to get the motive+-- 5. Apply the eliminator to the scrutinee and motive, with holes for methods+-- 6. Return these holes+++elimN : TTName -> TTName+elimN n = NS (SN $ MetaN (UN "elim") n) ["Eliminators", "Induction", "Pruviloj"]++mutual+ alphaEqual : (subst : TTName -> Maybe TTName) -> Raw -> Raw -> Bool+ alphaEqual subst (Var n) (Var m) =+ case subst n of+ Just n' => n' == m -- both are bound if this has been put in the subst+ Nothing => n == m -- free+ alphaEqual subst (RBind n b tm) (RBind m b' tm') =+ alphaEqualBinders subst b b' &&+ alphaEqual (extend subst n m) tm tm'+ alphaEqual subst (RApp f x) (RApp g y) =+ alphaEqual subst f g && alphaEqual subst x y+ alphaEqual subst RType RType = True+ alphaEqual subst (RUType u) (RUType u') = u == u'+ alphaEqual subst (RConstant c) (RConstant c') = c == c'+ alphaEqual subst _ _ = False++ alphaEqualBinders : (subst : TTName -> Maybe TTName) -> Binder Raw -> Binder Raw -> Bool+ alphaEqualBinders subst (Lam tm) (Lam tm') =+ alphaEqual subst tm tm'+ alphaEqualBinders subst (Pi tm1 tm2) (Pi tm1' tm2') =+ alphaEqual subst tm1 tm1' &&+ alphaEqual subst tm2 tm2'+ alphaEqualBinders subst (Let tm1 tm2) (Let tm1' tm2') =+ alphaEqual subst tm1 tm1' &&+ alphaEqual subst tm2 tm2'+ alphaEqualBinders subst (Hole tm) (Hole tm') =+ alphaEqual subst tm tm'+ alphaEqualBinders subst (GHole tm) (GHole tm') =+ alphaEqual subst tm tm'+ alphaEqualBinders subst (Guess tm1 tm2) (Guess tm1' tm2') =+ alphaEqual subst tm1 tm1' &&+ alphaEqual subst tm2 tm2'+ alphaEqualBinders subst (PVar tm) (PVar tm') =+ alphaEqual subst tm tm'+ alphaEqualBinders subst (PVTy tm) (PVTy tm') =+ alphaEqual subst tm tm'+ alphaEqualBinders subst _ _ = False++generalize : (hint : String) -> (ctxt, subject : Raw) -> Elab (TTName, Raw)+generalize hint ctxt subj = do n <- gensym hint+ return (n, !(gen' n ctxt subj))+ where+ mutual+ gen' : TTName -> Raw -> Raw -> Elab Raw+ gen' var outer inner = if alphaEqual (const Nothing) outer inner+ then return (Var var)+ else breakAndRecurse var outer inner++ genB : TTName -> Binder Raw -> Raw -> Elab (Binder Raw)+ genB n (Lam ty) inner = [| Lam (gen' n ty inner) |]+ genB n (Pi ty ty') inner = [| Pi (gen' n ty inner) (gen' n ty' inner) |]+ genB n (Let ty val) inner = [| Let (gen' n ty inner) (gen' n val inner) |]+ genB n (Hole ty) inner = [| Hole (gen' n ty inner) |]+ genB n (GHole ty) inner = [| GHole (gen' n ty inner) |]+ genB n (Guess ty val) inner = [| Guess (gen' n ty inner) (gen' n val inner) |]+ genB n (PVar ty) inner = [| PVar (gen' n ty inner) |]+ genB n (PVTy ty) inner = [| PVTy (gen' n ty inner) |]++ breakAndRecurse : TTName -> Raw -> Raw -> Elab Raw+ breakAndRecurse var (RBind n b tm) inner =+ -- Prevent variable capture by alpha-converting to a unique name+ do n' <- nameFrom n+ b' <- genB var b inner+ body' <- gen' var (alphaRaw (rename n n') tm) inner+ return $ RBind n' b' body'+ breakAndRecurse var (RApp tm tm') inner =+ [| RApp (gen' var tm inner) (gen' var tm' inner) |]+ breakAndRecurse var other inner = return other+++countBinders : TT -> Nat+countBinders (Bind _ _ tm) = S (countBinders tm)+countBinders _ = Z++++indexVals : Raw -> TyConInfo -> List Raw+indexVals tm info =+ do let (var, tyArgs) = unApply tm+ let argsTogether = zip tyArgs (args info)+ (argVal, TyConIndex _) <- argsTogether+ | _ => empty+ return argVal++makeMotive : (info : TyConInfo) -> (subj, subjTy, goal : Raw) -> Elab ()+makeMotive info sub subjTy goal =+ makeMotive' (indexVals subjTy info) goal+ where+ makeMotive' : List Raw -> Raw -> Elab ()+ makeMotive' [] r = do (n, r') <- generalize "subj" r sub+ attack+ intro n+ exact r'+ solve -- attack+ makeMotive' (i :: is) r = do (n, r') <- generalize "i" r i+ attack+ intro n+ makeMotive' is r'+ solve --attack++||| Perform induction on some expression to solve the current+||| goal. Return a list of new holes to be solved.+public+induction : Raw -> Elab (List TTName)+induction subj =+ do g <- goalType+ (_, ty) <- check !getEnv subj+ ty' <- forget ty+ case headName ty' of+ Nothing => fail [TermPart ty, TextPart "is not an inductive family"]+ Just fam =>+ do let elim = elimN fam+ (_,_,elimTy) <- (lookupTyExact elim) <|> (do deriveElim fam elim+ lookupTyExact elim)+ tydef <- lookupDatatypeExact fam+ info <- getTyConInfo (tyConArgs tydef) (tyConRes tydef)+ argHoles <- apply (Var elim)+ (replicate (length (args info)) True +++ [False, False] ++ -- scrutinee, motive+ replicate (length (constructors tydef)) False)+ solve++ -- Apply the eliminator to our scrutinee+ scrutH <- unsafeNth (length (args info)) argHoles+ focus scrutH+ apply subj []+ solve++ motiveH <- unsafeNth (length (args info) + 1) argHoles+ focus motiveH; makeMotive info subj ty' g++ return (drop (2 + length (tyConArgs tydef)) argHoles)
+ libs/pruviloj/Pruviloj/Injective.idr view
@@ -0,0 +1,122 @@+module Pruviloj.Injective++import Language.Reflection.Utils++import Pruviloj.Core+import Pruviloj.Internals+import Pruviloj.Renamers++%default total+%access private++-------------------+-- PRIVATE GUTS --+-------------------++||| Compute the name for a constructor's injectivity lemma+injName : TTName -> TTName+injName cn = NS (SN (MetaN `{{injectivity}} cn)) ["Injective", "Pruviloj"]++||| Provide an error message for when non-constructor names are passed+notConstructor : TTName -> Elab a+notConstructor c = fail [NamePart c, TextPart "is not a constructor"]++covering+getInjectivity : (cn : TTName) -> Elab TTName+getInjectivity cn = exists <|> declare+ where exists : Elab TTName+ exists = do (fn, Ref, _) <- lookupTyExact (injName cn)+ | (fn, _, _) => fail [TextPart "Bad earlier declaration of", NamePart fn]+ return fn++ covering+ declare : Elab TTName+ declare = do (cn', DCon _ _, cty) <- lookupTyExact cn+ | _ => notConstructor cn+ let fn = injName cn'+ (args1, res1) <- stealBindings !(forget cty) noRenames+ (args2, res2) <- stealBindings !(forget cty) noRenames+ let impls1 = map (\(n, b) => MkFunArg n (binderTy b) Implicit NotErased)+ args1+ let impls2 = map (\(n, b) => MkFunArg n (binderTy b) Implicit NotErased)+ args2+ let res = foldr (\t1, t2 => RApp (RApp (Var `{Pair}) t1) t2)+ `(() : Type)+ (map (\(a1, a2) =>+ `((=) {A=~(type a1)}+ {B=~(type a2)}+ ~(Var (name a1))+ ~(Var (name a2))))+ (zip impls1 impls2))++ declareType $ Declare fn (impls1 ++ impls2 +++ [ MkFunArg !(gensym "arg")+ `((=) {A=~res1}+ {B=~res2}+ ~(mkApp (Var cn)+ (map (Var . fst) args1))+ ~(mkApp (Var cn)+ (map (Var . fst) args2)))+ Explicit+ NotErased])++ res+ clause <- elabPatternClause+ (do (h::_) <- reverse <$>+ apply (Var fn)+ (replicate (2 * length args1)+ True +++ [False])+ | _ => fail [TextPart "Missing hole"]+ solve+ focus h; search)+ search -- rhs is conjunction of Refls+ defineFunction $+ DefineFun fn [clause]+ return fn++countBinders : TT -> Nat+countBinders (Bind _ _ body) = S (countBinders body)+countBinders _ = Z+++----------------------+-- PUBLIC INTERFACE --+----------------------+++||| Given an equality of the form `(C x1 ... xn = C y1 ... yn)`,+||| generate an product of the equalities `(x1 = y1)` ... `(xn = yn)`.+|||+||| The equalities are let-bound to the provided name.+|||+||| @ tm the equality to exploit injectivity on+||| @ n the name at which to bind the result+covering public+injective : (tm : Raw) -> (n : TTName) -> Elab ()+injective tm n =+ do (_, ty) <- check !getEnv tm+ case !(forget ty) of+ `((=) {A=~A} {B=~B} ~x ~y) =>+ case (headName x, headName y) of+ (Just xHd, Just yHd) =>+ if xHd /= yHd+ then fail [ TextPart "Mismatch between", NamePart xHd+ , TextPart "and", NamePart yHd+ ]+ else do fn <- getInjectivity xHd+ tyH <- newHole "ty" `(Type)+ tmH <- newHole "tm" (Var tyH)++ letbind n (Var tyH) (Var tmH)+ focus tmH+ (_, _, fnTy) <- lookupTyExact fn++ (arg :: _) <- reverse <$> apply (Var fn) (replicate (pred (countBinders fnTy)) True ++ [False])+ | _ => fail [TextPart "No hole for argument"]+ solve++ focus arg; apply tm []; solve+ _ => fail [TextPart "oops"]++ _ => fail [TextPart "can't use injectivity on non-equality"]
+ libs/pruviloj/Pruviloj/Internals.idr view
@@ -0,0 +1,154 @@+||| Internal details of the library, not for public consumption.+module Pruviloj.Internals+++import Pruviloj.Core+import Pruviloj.Renamers++import Data.Vect++||| Get the name of a reflected type constructor argument.+tyConArgName : TyConArg -> TTName+tyConArgName (TyConParameter a) = name a+tyConArgName (TyConIndex a) = name a++||| Modify the name of a reflected type constructor argument.+setTyConArgName : TyConArg -> TTName -> TyConArg+setTyConArgName (TyConParameter a) n = TyConParameter (record {name = n} a)+setTyConArgName (TyConIndex a) n = TyConIndex (record {name = n} a)++||| Modify the type of a reflected type constructor argument using some function.+updateTyConArgTy : (Raw -> Raw) -> TyConArg -> TyConArg+updateTyConArgTy f (TyConParameter a) =+ TyConParameter (record {type = f (type a) } a)+updateTyConArgTy f (TyConIndex a) =+ TyConIndex (record {type = f (type a) } a)++unApply : Raw -> (Raw, List Raw)+unApply tm = unApply' tm []+ where unApply' : Raw -> List Raw -> (Raw, List Raw)+ unApply' (RApp f x) xs = unApply' f (x::xs)+ unApply' notApp xs = (notApp, xs)++mkApp : Raw -> List Raw -> Raw+mkApp f [] = f+mkApp f (x :: xs) = mkApp (RApp f x) xs++||| Grab the binders from around a term, alpha-converting to make+||| their names unique+partial+stealBindings : Raw -> (nsubst : TTName -> Maybe TTName) -> Elab (List (TTName, Binder Raw), Raw)+stealBindings (RBind n b tm) nsubst =+ do n' <- nameFrom n+ (bindings, result) <- stealBindings tm (extend nsubst n n')+ return ((n', map (alphaRaw nsubst) b) :: bindings, result)+stealBindings tm nsubst = return ([], alphaRaw nsubst tm)++||| Get the last element of a list. Fail on empty lists.+last : List a -> Elab a+last [] = fail [TextPart "Unexpected empty list"]+last [x] = return x+last (_::x::xs) = last (x::xs)++||| Grab the binders from around a term, assuming that they have been+||| previously uniquified+extractBinders : Raw -> (List (TTName, Binder Raw), Raw)+extractBinders (RBind n b tm) = let (bs, res) = extractBinders tm+ in ((n, b) :: bs, res)+extractBinders tm = ([], tm)+++||| Get the type annotation from a binder+getBinderTy : Binder t -> t+getBinderTy (Lam t) = t+getBinderTy (Pi t _) = t+getBinderTy (Let t _) = t+getBinderTy (Hole t) = t+getBinderTy (GHole t) = t+getBinderTy (Guess t _) = t+getBinderTy (PVar t) = t+getBinderTy (PVTy t) = t++||| Map a list `[x1, x2, ..., xn]` to `[(0, x1), (1, x2), ..., (n-1, xn)]`+enumerate : List a -> List (Nat, a)+enumerate xs = enumerate' xs 0+ where enumerate' : List a -> Nat -> List (Nat, a)+ enumerate' [] _ = []+ enumerate' (x::xs) n = (n, x) :: enumerate' xs (S n)++bindPats : List (TTName, Binder Raw) -> Raw -> Raw+bindPats [] res = res+bindPats ((n, b)::bs) res = RBind n (PVar (getBinderTy b)) $ bindPats bs res++bindPatTys : List (TTName, Binder Raw) -> Raw -> Raw+bindPatTys [] res = res+bindPatTys ((n, b)::bs) res = RBind n (PVTy (getBinderTy b)) $ bindPatTys bs res+++||| Helper for elaborating pattern clauses. This helper takes care of+||| inferring the type of the left-hand side and bringing that+||| information onward to the right-hand side.+|||+||| While elaborating the left-hand side, the proof term contains a+||| Sigma type. This is part of the type inference going on and will+||| be removed.+|||+||| @ lhs the tactic script to establish the left-hand side of the+||| clause. It should cause an application of the term being+||| defined. Any holes left behind will be converted to pattern+||| variables with the same name.+||| @ rhs the tactic script to establish the right side of the clause.+||| It will be run in a context where the pattern variables are+||| already bound, and should leave behind no holes.+partial+elabPatternClause : (lhs, rhs : Elab ()) -> Elab FunClause+elabPatternClause lhs rhs =+ do -- Elaborate the LHS in a context where its type will be solved via unification+ (pat, _) <- runElab `(Infer) $+ do th <- newHole "finalTy" `(Type)+ patH <- newHole "pattern" (Var th)+ fill `(MkInfer ~(Var th) ~(Var patH))+ solve+ focus patH+ lhs+ -- Convert all remaining holes to pattern variables+ for_ {b=()} !getHoles $ \h =>+ do focus h; patvar h+ (pvars, `(MkInfer ~rhsTy ~lhsTm)) <- extractBinders <$> forget pat+ | fail [TextPart "Couldn't infer type of left-hand pattern"]+ rhsTm <- runElab (bindPatTys pvars rhsTy) $+ do -- Introduce all the pattern variables from the LHS+ repeatUntilFail bindPat <|> return ()+ rhs+ realRhs <- forget (fst rhsTm)+ return $ MkFunClause (bindPats pvars lhsTm) realRhs++||| Introduce a unique binder name, returning it+intro1 : Elab TTName+intro1 = do g <- snd <$> getGoal+ case g of+ Bind n (Pi _ _) _ => do n' <- nameFrom n+ intro n'+ return n'+ _ => fail [ TextPart "Can't intro1 because goal"+ , TermPart g+ , TextPart "isn't a function type."]+++||| Repeat an action some number of times, saving the results.+doTimes : Applicative m => (n : Nat) -> m a -> m (Vect n a)+doTimes Z x = pure []+doTimes (S k) x = [| x :: (doTimes k x) |]++||| Zip two lists, failing if their lengths don't match.+zipH : List a -> List b -> Elab (List (a, b))+zipH [] [] = return []+zipH (x::xs) (y::ys) = ((x, y) ::) <$> zipH xs ys+zipH _ _ = fail [TextPart "length mismatch"]++unsafeNth : Nat -> List a -> Elab a+unsafeNth _ [] = fail [TextPart "Ran out of list elements"]+unsafeNth Z (x :: _) = return x+unsafeNth (S k) (_ :: xs) = unsafeNth k xs++
+ libs/pruviloj/Pruviloj/Internals/TyConInfo.idr view
@@ -0,0 +1,108 @@+module Pruviloj.Derive.TyConInfo++import Pruviloj.Core+import Pruviloj.Internals+import Pruviloj.Renamers++import Language.Reflection.Utils++++||| A representation of a type constructor in which all argument names+||| are made unique and they are separated into params and then+||| indices.+record TyConInfo where+ constructor MkTyConInfo+ ||| Invariant: the names of the args have been made unique+ args : List TyConArg+ ||| The type constructor, applied to its arguments+ result : Raw++%name TyConInfo info++getParams : TyConInfo -> List (TTName, Raw)+getParams info = mapMaybe param (args info)+ where param : TyConArg -> Maybe (TTName, Raw)+ param (TyConParameter a) = Just (name a, type a)+ param _ = Nothing++getIndices : TyConInfo -> List (TTName, Raw)+getIndices info = mapMaybe index (args info)+ where index : TyConArg -> Maybe (TTName, Raw)+ index (TyConIndex a) = Just (name a, type a)+ index _ = Nothing++||| Rename a bound variable across a telescope+renameIn : (from, to : TTName) -> List (TTName, Raw) -> List (TTName, Raw)+renameIn from to [] = []+renameIn from to ((n, ty)::tele) =+ (n, alphaRaw (rename from to) ty) ::+ if from == n+ then tele+ else renameIn from to tele++||| Rename a free variable in type constructor info (used to implement+||| alpha-conversion for unique binder names, hence the odd name)+alphaTyConInfo : (TTName -> Maybe TTName) -> TyConInfo -> TyConInfo+alphaTyConInfo ren (MkTyConInfo [] res) = MkTyConInfo [] (alphaRaw ren res)+alphaTyConInfo ren (MkTyConInfo (tcArg::tcArgs) res) =+ let MkTyConInfo tcArgs' res' = alphaTyConInfo (restrict ren (tyConArgName tcArg)) (MkTyConInfo tcArgs res)+ tcArg' = updateTyConArgTy (alphaRaw ren) tcArg+ in MkTyConInfo (tcArg'::tcArgs') res'++getTyConInfo' : List TyConArg -> Raw -> (TTName -> Maybe TTName) -> Elab TyConInfo+getTyConInfo' [] res _ = return (MkTyConInfo [] res)+getTyConInfo' (tcArg::tcArgs) res ren =+ do let n = tyConArgName tcArg+ n' <- nameFrom n+ let ren' = extend ren n n'+ -- n' is globally unique so we don't worry about scope+ next <- getTyConInfo' tcArgs (RApp res (Var n')) ren'+ return $ alphaTyConInfo ren' $+ record {args = setTyConArgName tcArg n' :: args next} next++getTyConInfo : List TyConArg -> Raw -> Elab TyConInfo+getTyConInfo args res = getTyConInfo' args res (const Nothing)++||| Convert the parameter names in a constructor to their global unique versions+processCtorArgs : TyConInfo -> (TTName, List CtorArg, Raw) -> Elab (TTName, List CtorArg, Raw)+processCtorArgs info (cn, cargs, resTy) =+ do (args', ty') <- convert' (const Nothing) cargs resTy info+ return (cn, args', ty')+ where+ ||| Find the name that was assigned to a given parameter+ ||| by comparing positions in the TyConInfo+ findParam : TTName -> List Raw -> List TyConArg -> Elab TTName+ findParam paramN (Var n :: args) (TyConParameter a :: tcArgs) =+ if n == paramN+ then return (name a)+ else findParam paramN args tcArgs+ findParam paramN (_ :: args) (_ :: tcArgs) =+ findParam paramN args tcArgs+ findParam paramN _ _ = fail [ TextPart "Parameter"+ , NamePart paramN+ , TextPart "not found."+ ]++ convert' : (TTName -> Maybe TTName) ->+ List CtorArg -> Raw ->+ TyConInfo -> Elab (List CtorArg, Raw)+ convert' subst [] ty info = return ([], alphaRaw subst ty)+ convert' subst (CtorField a :: args) ty info =+ do n' <- nameFrom (name a)+ let a' = record {+ name = n'+ , type = alphaRaw subst (type a)+ } a+ let subst' = extend subst (name a) n'+ (args', ty') <- convert' subst' args ty info+ return (CtorField a' :: args', ty')+ convert' subst (CtorParameter a :: ctorArgs) ty info =+ do n' <- findParam (name a) (snd (unApply ty)) (args info)+ let a' = record {+ name = n'+ , type = alphaRaw subst (type a)+ } a+ let subst' = extend subst (name a) n'+ (args', ty') <- convert' subst' ctorArgs ty info+ return (CtorParameter a' :: args', ty')
+ libs/pruviloj/Pruviloj/Renamers.idr view
@@ -0,0 +1,42 @@+module Pruviloj.Renamers++import Language.Reflection.Utils++||| A renamer keeps track of names to be substituted+Renamer : Type+Renamer = TTName -> Maybe TTName++||| A renamer that renames nothing+noRenames : Renamer+noRenames = const Nothing++||| Cause a renamer to forget a renaming+restrict : Renamer -> TTName -> Renamer+restrict f n n' = if n == n' then Nothing else f n'++||| Extend a renamer with a new renaming+extend : Renamer -> TTName -> TTName -> Renamer+extend f n n' n'' = if n'' == n then Just n' else f n''++||| Create a new renamer+|||+||| @ from the old name+||| @ to the new name+rename : (from, to : TTName) -> Renamer+rename from to = extend noRenames from to++||| Alpha-convert `Raw` terms+||| @ subst a renamer+partial+alphaRaw : (subst : Renamer) -> Raw -> Raw+alphaRaw subst (Var n) with (subst n)+ alphaRaw subst (Var n) | Nothing = Var n+ alphaRaw subst (Var n) | Just n' = Var n'+alphaRaw subst (RBind n b tm) =+ let subst' = restrict subst n+ b' = map (alphaRaw subst) b+ in RBind n b' (alphaRaw subst' tm)+alphaRaw subst (RApp tm tm') = RApp (alphaRaw subst tm) (alphaRaw subst tm')+alphaRaw subst RType = RType+alphaRaw subst (RUType x) = RUType x+alphaRaw subst (RConstant c) = RConstant c
+ libs/pruviloj/pruviloj.ipkg view
@@ -0,0 +1,13 @@+package pruviloj++opts = "--nobasepkgs -i ../prelude -i ../base"+modules = Pruviloj+ , Pruviloj.Core+ , Pruviloj.Derive.DecEq+ , Pruviloj.Derive.Eliminators+ , Pruviloj.Disjoint+ , Pruviloj.Induction+ , Pruviloj.Injective+ , Pruviloj.Internals+ , Pruviloj.Internals.TyConInfo+ , Pruviloj.Renamers
rts/idris_main.c view
@@ -21,6 +21,7 @@ init_gmpalloc(); init_nullaries();+ init_signals(); _idris__123_runMain0_125_(vm, NULL);
rts/idris_rts.c view
@@ -1,4 +1,5 @@ #include <assert.h>+#include <errno.h> #include "idris_rts.h" #include "idris_gc.h"@@ -72,6 +73,7 @@ init_threaddata(vm); init_gmpalloc(); init_nullaries();+ init_signals(); return vm; }@@ -92,6 +94,12 @@ #endif } +void init_signals() {+#if (__linux__ || __APPLE__ || __FreeBSD__)+ signal(SIGPIPE, SIG_IGN);+#endif+}+ Stats terminate(VM* vm) { Stats stats = vm->stats; STATS_ENTER_EXIT(stats)@@ -925,6 +933,14 @@ void idris_freeMsg(Msg* msg) { free(msg);+}++int idris_errno() {+ return errno;+}++char* idris_showerror(int err) {+ return strerror(err); } VAL* nullary_cons;
rts/idris_rts.h view
@@ -9,6 +9,9 @@ #include <pthread.h> #endif #include <stdint.h>+#if (__linux__ || __APPLE__ || __FreeBSD__)+#include <signal.h>+#endif #include "idris_heap.h" #include "idris_stats.h"@@ -252,9 +255,14 @@ #define NULL_CON(x) nullary_cons[x] +int idris_errno();+char* idris_showerror(int err);+ extern VAL* nullary_cons; void init_nullaries(); void free_nullaries();++void init_signals(); void* vmThread(VM* callvm, func f, VAL arg);
rts/idris_stdfgn.c view
@@ -4,6 +4,7 @@ #include "idris_gc.h" #include <sys/select.h> #include <fcntl.h>+#include <errno.h> #include <stdio.h> #include <time.h> @@ -84,6 +85,25 @@ VAL idris_time() { time_t t = time(NULL); return MKBIGI(t);+}++VAL idris_mkFileError(VM* vm) {+ VAL result;+ switch(errno) {+ // Make sure this corresponds to the FileError structure in+ // Prelude.File+ case ENOENT:+ idris_constructor(result, vm, 2, 0, 0);+ break;+ case EACCES:+ idris_constructor(result, vm, 3, 0, 0);+ break;+ default:+ idris_constructor(result, vm, 4, 1, 0);+ idris_setConArg(result, 0, MKINT((intptr_t)errno));+ break;+ }+ return result; } void idris_forceGC(void* vm) {
rts/idris_stdfgn.h view
@@ -14,6 +14,8 @@ int fileError(void* h); // return 0 on success int idris_writeStr(void*h, char* str);+// construct a file error structure (see Prelude.File) from errno+VAL idris_mkFileError(VM* vm); void* do_popen(const char* cmd, const char* mode); int fpoll(void* h);
src/IRTS/CodegenC.hs view
@@ -66,7 +66,7 @@ MavenProject -> putStrLn ("FAILURE: output type not supported") Raw -> writeSource out cout _ -> do- (tmpn, tmph) <- tempfile+ (tmpn, tmph) <- tempfile ".c" hPutStr tmph cout hFlush tmph hClose tmph@@ -78,7 +78,7 @@ gccFlags iface ++ -- # Any flags defined here which alter the RTS API must also be added to config.mk ["-DHAS_PTHREAD", "-DIDRIS_ENABLE_STATS",- "-I."] ++ objs ++ ["-x", "c"] ++ envFlags +++ "-I."] ++ objs ++ envFlags ++ (if (exec == Executable) then [] else ["-c"]) ++ [tmpn] ++ (if not iface then concatMap words libFlags else []) ++@@ -95,7 +95,7 @@ headers xs = concatMap- (\h -> "#include <" ++ h ++ ">\n")+ (\h -> "#include \"" ++ h ++ "\"\n") (xs ++ ["idris_rts.h", "idris_bitstring.h", "idris_stdfgn.h"]) debug TRACE = "#define IDRIS_TRACE\n\n"
src/IRTS/CodegenJavaScript.hs view
@@ -27,6 +27,7 @@ import Data.Traversable hiding (mapM) import System.IO import System.Directory+import System.FilePath import qualified Data.Map.Strict as M import qualified Data.Text as T@@ -113,6 +114,10 @@ let js = concatMap (translateDecl info) bytecode let full = concatMap processFunction js let code = deadCodeElim full+ let ext = takeExtension filename+ let isHtml = target == JavaScript && ext == ".html"+ let htmlPrologue = T.pack "<!doctype html><html><head><script>\n"+ let htmlEpilogue = T.pack "\n</script></head><body></body></html>" let (cons, opt) = optimizeConstructors code let (header, rt) = case target of Node -> ("#!/usr/bin/env node\n", "-node")@@ -132,12 +137,15 @@ ++ idrRuntime ++ tgtRuntime )- writeSourceText filename ( T.pack runtime- `T.append` T.concat (map compileJS opt)- `T.append` T.concat (map compileJS cons)- `T.append` main- `T.append` invokeMain- )+ let jsSource = T.pack runtime+ `T.append` T.concat (map compileJS opt)+ `T.append` T.concat (map compileJS cons)+ `T.append` main+ `T.append` invokeMain+ let source = if isHtml+ then htmlPrologue `T.append` jsSource `T.append` htmlEpilogue+ else jsSource+ writeSourceText filename source setPermissions filename (emptyPermissions { readable = True , executable = target == Node , writable = True
src/IRTS/Compiler.hs view
@@ -167,7 +167,7 @@ snRank (InstanceN n args) = "2" ++ nameRank n ++ concatMap show args snRank (ParentN n s) = "3" ++ nameRank n ++ show s snRank (MethodN n) = "4" ++ nameRank n- snRank (CaseN n) = "5" ++ nameRank n+ snRank (CaseN _ n) = "5" ++ nameRank n snRank (ElimN n) = "6" ++ nameRank n snRank (InstanceCtorN n) = "7" ++ nameRank n snRank (WithN i n) = "8" ++ nameRank n ++ show i@@ -205,7 +205,7 @@ (args, sc) = cases_runtime cd -- Always attempt to inline functions arising from 'case' expressions- caseName (SN (CaseN _)) = True+ caseName (SN (CaseN _ _)) = True caseName (SN (WithN _ _)) = True caseName (NS n _) = caseName n caseName _ = False
src/Idris/AbsSyntax.hs view
@@ -346,6 +346,14 @@ addToCalledG :: Name -> [Name] -> Idris () addToCalledG n ns = return () -- TODO +addDeprecated :: Name -> String -> Idris ()+addDeprecated n reason = do i <- getIState+ putIState $ i { idris_deprecated = addDef n reason (idris_deprecated i) }++getDeprecated :: Name -> Idris (Maybe String)+getDeprecated n = do i <- getIState+ return $ lookupCtxtExact n (idris_deprecated i)+ push_estack :: Name -> Bool -> Idris () push_estack n inst = do i <- getIState@@ -1344,7 +1352,7 @@ let badnames = filter (\n -> not (implicitable n) && n `notElem` (map iname uimpls)) ns when (not (null badnames)) $- throwError (At fc (Elaborating "type of " n+ throwError (At fc (Elaborating "type of " n Nothing (NoSuchVariable (head badnames)))) let cs = getArgnames t -- get already bound names let addimpls = filter (\n -> iname n `notElem` cs) uimpls@@ -1385,7 +1393,11 @@ = (n, (p, t)) : collectImps sc collectImps _ = [] - getImps (Bind n (Pi (Just _) _ _) sc) imps = getImps sc imps+ scopedimpl (Just i) = not (toplevel_imp i)+ scopedimpl _ = False++ getImps (Bind n (Pi i _ _) sc) imps + | scopedimpl i = getImps sc imps getImps (Bind n (Pi _ t _) sc) imps | Just (p, t') <- lookup n imps = argInfo n p t' : getImps sc imps where@@ -1548,9 +1560,9 @@ pibind using [] sc = sc pibind using (n:ns) sc = case lookup n using of- Just ty -> PPi (Imp [] Dynamic False Nothing)+ Just ty -> PPi (Imp [] Dynamic False (Just (Impl False True))) n NoFC ty (pibind using ns sc)- Nothing -> PPi (Imp [InaccessibleArg] Dynamic False Nothing)+ Nothing -> PPi (Imp [InaccessibleArg] Dynamic False (Just (Impl False True))) n NoFC Placeholder (pibind using ns sc) -- Add implicit arguments in function calls@@ -1694,7 +1706,9 @@ -> [PArg] -- ^ initial arguments (if in an expression) -> Either Err PTerm aiFn topname inpat True qq imp_meths ist fc f ffc ds [] _- = case lookupDef f (tt_ctxt ist) of+ | inpat && implicitable f && unqualified f = Right $ PPatvar ffc f+ | otherwise + = case lookupDef f (tt_ctxt ist) of [] -> Right $ PPatvar ffc f alts -> let ialts = lookupCtxtName f (idris_implicits ist) in -- trace (show f ++ " " ++ show (fc, any (all imp) ialts, ialts, any constructor alts)) $@@ -1707,6 +1721,10 @@ imp _ = True -- allImp [] = False allImp xs = all imp xs++ unqualified (NS _ _) = False+ unqualified _ = True+ constructor (TyDecl (DCon _ _ _) _) = True constructor _ = False @@ -1887,9 +1905,11 @@ su tm@(PRef fc hl f) | (Bind n (Pi _ t _) sc :_) <- lookupTy f (tt_ctxt i) = Placeholder- | (TType _ : _) <- lookupTy f (tt_ctxt i)+ | (TType _ : _) <- lookupTy f (tt_ctxt i),+ not (implicitable f) = PHidden tm- | (UType _ : _) <- lookupTy f (tt_ctxt i)+ | (UType _ : _) <- lookupTy f (tt_ctxt i),+ not (implicitable f) = PHidden tm su (PApp fc f@(PRef _ _ fn) args) -- here we use canBeDConName because the impossible pattern
src/Idris/AbsSyntaxTree.hs view
@@ -259,7 +259,8 @@ idris_symbols :: M.Map Name Name, -- ^ Symbol table (preserves sharing of names) idris_exports :: [Name], -- ^ Functions with ExportList idris_highlightedRegions :: [(FC, OutputAnnotation)], -- ^ Highlighting information to output- idris_parserHighlights :: [(FC, OutputAnnotation)] -- ^ Highlighting information from the parser+ idris_parserHighlights :: [(FC, OutputAnnotation)], -- ^ Highlighting information from the parser+ idris_deprecated :: Ctxt String -- ^ Deprecated names and explanation } -- Required for parsers library, and therefore trifecta@@ -335,6 +336,7 @@ | IBCUsage (Name, Int) | IBCExport Name | IBCAutoHint Name Name+ | IBCDeprecate Name String deriving Show -- | The initial state for the compiler@@ -349,6 +351,7 @@ [] [] Nothing [] Nothing [] [] Nothing Nothing [] Hidden False [] Nothing [] [] (RawOutput stdout) True defaultTheme [] (0, emptyContext) emptyContext M.empty AutomaticWidth S.empty S.empty [] Nothing Nothing [] [] M.empty [] [] []+ emptyContext -- | The monad for the main REPL - reading and processing files and updating -- global state (hence the IO inner monad).@@ -506,10 +509,12 @@ | Client String | ShowOrigErr | AutoWidth -- ^ Automatically adjust terminal width- | AutoSolve -- ^ Automatically issue "solve" tactic in interactive prover+ | AutoSolve -- ^ Automatically issue "solve" tactic in old-style interactive prover | UseConsoleWidth ConsoleWidth | DumpHighlights | DesugarNats+ | NoElimDeprecationWarnings -- ^ Don't show deprecation warnings for %elim+ | NoOldTacticDeprecationWarnings -- ^ Don't show deprecation warnings for old-style tactics deriving (Show, Eq) data ElabShellCmd = EQED | EAbandon | EUndo | EProofState | EProofTerm@@ -582,9 +587,9 @@ is_scoped (Imp _ _ _ s) = s is_scoped _ = Nothing -impl = Imp [] Dynamic False Nothing-forall_imp = Imp [] Dynamic False (Just (Impl False))-forall_constraint = Imp [] Dynamic False (Just (Impl True))+impl = Imp [] Dynamic False (Just (Impl False True))+forall_imp = Imp [] Dynamic False (Just (Impl False False))+forall_constraint = Imp [] Dynamic False (Just (Impl True False)) expl = Exp [] Dynamic False expl_param = Exp [] Dynamic True constraint = Constraint [] Static@@ -706,6 +711,7 @@ DNameHint Name FC [(Name, FC)] | DErrorHandlers Name FC Name FC [(Name, FC)] | DLanguage LanguageExt |+ DDeprecate Name String | DUsed FC Name Name -- | A set of instructions for things that need to happen in IState
src/Idris/CaseSplit.hs view
@@ -50,8 +50,11 @@ -} -- Given a variable to split, and a term application, return a list of--- variable updates-split :: Name -> PTerm -> Idris [[(Name, PTerm)]]+-- variable updates, paired with a flag to say whether the given update+-- typechecks (False = impossible)+-- if the flag is 'False' the splits should be output with the 'impossible'+-- flag, otherwise they should be output as normal+split :: Name -> PTerm -> Idris (Bool, [[(Name, PTerm)]]) split n t' = do ist <- getIState -- Make sure all the names in the term are accessible@@ -77,15 +80,26 @@ logLvl 4 ("Working from " ++ show t) logLvl 4 ("Trying " ++ showSep "\n" (map (showTmImpls) newPats_in))- newPats <- mapM elabNewPat newPats_in- logLvl 3 ("Original:\n" ++ show t)- logLvl 3 ("Split:\n" ++- (showSep "\n" (map show (mapMaybe id newPats))))- logLvl 3 "----"- let newPats' = mergeAllPats ist n t (mapMaybe id newPats)- logLvl 1 ("Name updates " ++ showSep "\n"- (map (\ (p, u) -> show u ++ " " ++ show p) newPats'))- return (map snd newPats')+ newPats_in <- mapM elabNewPat newPats_in+ case anyValid [] [] newPats_in of+ Left fails -> do+ let fails' = mergeAllPats ist n t fails+ return (False, (map snd fails'))+ Right newPats -> do+ logLvl 3 ("Original:\n" ++ show t)+ logLvl 3 ("Split:\n" +++ (showSep "\n" (map show newPats)))+ logLvl 3 "----"+ let newPats' = mergeAllPats ist n t newPats+ logLvl 1 ("Name updates " ++ showSep "\n"+ (map (\ (p, u) -> show u ++ " " ++ show p) newPats'))+ return (True, (map snd newPats'))+ where + anyValid ok bad [] = if null ok then Left (reverse bad) + else Right (reverse ok)+ anyValid ok bad ((tc, p) : ps)+ | tc = anyValid (p : ok) bad ps+ | otherwise = anyValid ok (p : bad) ps data MergeState = MS { namemap :: [(Name, Name)], invented :: [(Name, Name)],@@ -208,13 +222,13 @@ -- where tidyVar (PRef _ _) = Placeholder -- tidyVar t = t -elabNewPat :: PTerm -> Idris (Maybe PTerm)+elabNewPat :: PTerm -> Idris (Bool, PTerm) elabNewPat t = idrisCatch (do (tm, ty) <- elabVal recinfo ELHS t i <- getIState- return (Just (delab i tm)))+ return (True, delab i tm)) (\e -> do i <- getIState logLvl 5 $ "Not a valid split:\n" ++ pshow i e- return Nothing)+ return (False, t)) findPats :: IState -> Type -> [PTerm] findPats ist t | (P _ n _, _) <- unApply t@@ -248,26 +262,27 @@ splitOnLine :: Int -- ^ line number -> Name -- ^ variable -> FilePath -- ^ name of file- -> Idris [[(Name, PTerm)]]+ -> Idris (Bool, [[(Name, PTerm)]]) splitOnLine l n fn = do--- let (before, later) = splitAt (l-1) (lines inp)--- i <- getIState cl <- getInternalApp fn l logLvl 3 ("Working with " ++ showTmImpls cl) tms <- split n cl--- iputStrLn (showSep "\n" (map show tms))- return tms -- "" -- not yet done...+ return tms -replaceSplits :: String -> [[(Name, PTerm)]] -> Idris [String]-replaceSplits l ups = updateRHSs 1 (map (rep (expandBraces l)) ups)+replaceSplits :: String -> [[(Name, PTerm)]] -> Bool -> Idris [String]+replaceSplits l ups impossible+ = updateRHSs 1 (map (rep (expandBraces l)) ups) where rep str [] = str ++ "\n" rep str ((n, tm) : ups) = rep (updatePat False (show n) (nshow tm) str) ups updateRHSs i [] = return []- updateRHSs i (x : xs) = do (x', i') <- updateRHS (null xs) i x- xs' <- updateRHSs i' xs- return (x' : xs')+ updateRHSs i (x : xs) + | impossible = do xs' <- updateRHSs i xs+ return (setImpossible False x : xs')+ | otherwise = do (x', i') <- updateRHS (null xs) i x+ xs' <- updateRHSs i' xs+ return (x' : xs') updateRHS last i ('?':'=':xs) = do (xs', i') <- updateRHS last i xs return ("?=" ++ xs', i')@@ -283,6 +298,11 @@ return (x : xs', i') updateRHS last i [] = return ("", i) + setImpossible brace ('}':xs) = '}' : setImpossible False xs+ setImpossible brace ('{':xs) = '{' : setImpossible True xs+ setImpossible False ('=':xs) = "impossible\n"+ setImpossible brace (x : xs) = x : setImpossible brace xs+ setImpossible brace [] = "" -- TMP HACK: If there are Nats, we don't want to show as numerals since -- this isn't supported in a pattern, so special case here@@ -337,17 +357,21 @@ getClause :: Int -- ^ line number that the type is declared on -> Name -- ^ Function name+ -> Name -- ^ User given name -> FilePath -- ^ Source file name -> Idris String-getClause l fn fp +getClause l fn un fp = do i <- getIState case lookupCtxt fn (idris_classes i) of [c] -> return (mkClassBodies i (class_methods c))- _ -> do ty <- getInternalApp fp l+ _ -> do ty_in <- getInternalApp fp l+ let ty = case ty_in of+ PTyped n t -> t+ x -> x ist <- get let ap = mkApp ist ty []- return (show fn ++ " " ++ ap ++ "= ?" - ++ show fn ++ "_rhs")+ return (show un ++ " " ++ ap ++ "= ?" + ++ show un ++ "_rhs") where mkApp :: IState -> PTerm -> [Name] -> String mkApp i (PPi (Exp _ _ False) (MN _ _) _ ty sc) used = let n = getNameFrom i used ty in@@ -380,7 +404,7 @@ def (show (nsroot n)) ++ " " ++ mkApp i ty [] ++ "= ?" - ++ show fn ++ "_rhs_" ++ show m) ns [1..])+ ++ show un ++ "_rhs_" ++ show m) ns [1..]) def n@(x:xs) | not (isAlphaNum x) = "(" ++ n ++ ")" def n = n@@ -390,7 +414,10 @@ -> FilePath -- ^ Source file name -> Idris String getProofClause l fn fp- = do ty <- getInternalApp fp l+ = do ty_in <- getInternalApp fp l+ let ty = case ty_in of+ PTyped n t -> t+ x -> x return (mkApp ty ++ " = ?" ++ show fn ++ "_rhs") where mkApp (PPi _ _ _ _ sc) = mkApp sc mkApp rt = "(" ++ show rt ++ ") <== " ++ show fn@@ -427,8 +454,8 @@ nm ptm = do mptm <- elabNewPat ptm case mptm of- Nothing -> return ptm- Just ptm' -> return ptm'+ (False, _) -> return ptm+ (True, ptm') -> return ptm'
src/Idris/Chaser.hs view
@@ -1,5 +1,6 @@-module Idris.Chaser(buildTree, getModuleFiles, ModuleTree(..)) where+module Idris.Chaser(buildTree, getImports, getModuleFiles, ModuleTree(..)) where +import Idris.Core.TT import Idris.Parser import Idris.AbsSyntax import Idris.Imports@@ -79,42 +80,86 @@ getIModTime (IDR i) = getModificationTime i getIModTime (LIDR i) = getModificationTime i +getImports :: [(FilePath, [ImportInfo])] -> [FilePath] -> + Idris [(FilePath, [ImportInfo])]+getImports acc [] = return acc+getImports acc (f : fs) = do + i <- getIState+ let file = extractFileName f+ ibcsd <- valIBCSubDir i+ ids <- allImportDirs+ idrisCatch (do+ fp <- findImport ["."] ibcsd file+ let parsef = fname fp+ case lookup parsef acc of+ Just _ -> getImports acc fs+ _ -> do+ exist <- runIO $ doesFileExist parsef+ if exist then do+ src_in <- runIO $ readSource parsef+ src <- if lit fp then tclift $ unlit parsef src_in + else return src_in+ (_, _, modules, _) <- parseImports parsef src+ clearParserWarnings+ getImports ((parsef, modules) : acc)+ (fs ++ map import_path modules)+ else getImports ((parsef, []) : acc) fs)+ (\_ -> getImports acc fs) -- not in current soure tree, ignore+ where+ lit (LIDR _) = True+ lit _ = False++ fname (IDR fn) = fn+ fname (LIDR fn) = fn+ fname (IBC _ src) = fname src+ buildTree :: [FilePath] -> -- already guaranteed built+ [(FilePath, [ImportInfo])] -> -- import lists (don't reparse) FilePath -> Idris [ModuleTree]-buildTree built fp = btree [] fp--- = idrisCatch (btree [] fp)--- (\e -> do now <- runIO $ getCurrentTime--- iputStrLn (show e)--- return [MTree (IDR fp) True now []])+buildTree built importlists fp = evalStateT (btree [] fp) [] where- btree done f =- do i <- getIState+ addFile :: FilePath -> [ModuleTree] -> + StateT [(FilePath, [ModuleTree])] Idris [ModuleTree]+ addFile f m = do fs <- get+ put ((f, m) : fs)+ return m++ btree :: [FilePath] -> FilePath -> + StateT [(FilePath, [ModuleTree])] Idris [ModuleTree]+ btree stk f =+ do i <- lift getIState let file = extractFileName f- logLvl 1 $ "CHASING " ++ show file- ibcsd <- valIBCSubDir i- ids <- allImportDirs- fp <- findImport ids ibcsd file- logLvl 1 $ "Found " ++ show fp- mt <- runIO $ getIModTime fp+ lift $ logLvl 1 $ "CHASING " ++ show file ++ " (" ++ show fp ++ ")"+ ibcsd <- lift $ valIBCSubDir i+ ids <- lift $ allImportDirs+ fp <- lift $ findImport ids ibcsd file+ lift $ logLvl 1 $ "Found " ++ show fp+ mt <- lift $ runIO $ getIModTime fp if (file `elem` built) then return [MTree fp False mt []]- else if file `elem` done- then return []- else mkChildren fp+ else if file `elem` stk then + do lift $ tclift $ tfail+ (Msg $ "Cycle detected in imports: "+ ++ showSep " -> " (reverse (file : stk)))+ else do donetree <- get+ case lookup file donetree of+ Just t -> return t+ _ -> do ms <- mkChildren file fp+ addFile file ms - where mkChildren (LIDR fn) = do ms <- children True fn (f:done)- mt <- runIO $ getModificationTime fn- return [MTree (LIDR fn) True mt ms]- mkChildren (IDR fn) = do ms <- children False fn (f:done)- mt <- runIO $ getModificationTime fn- return [MTree (IDR fn) True mt ms]- mkChildren (IBC fn src)- = do srcexist <- runIO $ doesFileExist (getSrcFile src)+ where mkChildren file (LIDR fn) = do ms <- children True fn (file : stk)+ mt <- lift $ runIO $ getModificationTime fn+ return [MTree (LIDR fn) True mt ms]+ mkChildren file (IDR fn) = do ms <- children False fn (file : stk)+ mt <- lift $ runIO $ getModificationTime fn+ return [MTree (IDR fn) True mt ms]+ mkChildren file (IBC fn src)+ = do srcexist <- lift $ runIO $ doesFileExist (getSrcFile src) ms <- if srcexist then- do [MTree _ _ _ ms'] <- mkChildren src+ do [MTree _ _ _ ms'] <- mkChildren file src return ms' else return []- mt <- idrisCatch (runIO $ getModificationTime fn)+ mt <- lift $ idrisCatch (runIO $ getModificationTime fn) (\c -> runIO $ getIModTime src) -- FIXME: It's also not up to date if anything it imports has -- been modified since its own ibc has.@@ -122,7 +167,7 @@ -- Issue #1592 on the issue tracker. -- -- https://github.com/idris-lang/Idris-dev/issues/1592- ibcOutdated <- fn `younger` (getSrcFile src)+ ibcOutdated <- lift $ fn `younger` (getSrcFile src) -- FIXME (EB): The below 'hasValidIBCVersion' that's -- commented out appears to be breaking reloading in vim -- mode. Until we know why, I've commented it out.@@ -140,16 +185,14 @@ return (srct > ibct) else return False - children :: Bool -> FilePath -> [FilePath] -> Idris [ModuleTree]- children lit f done = -- idrisCatch- do exist <- runIO $ doesFileExist f+ children :: Bool -> FilePath -> [FilePath] ->+ StateT [(FilePath, [ModuleTree])] Idris [ModuleTree]+ children lit f stk = -- idrisCatch+ do exist <- lift $ runIO $ doesFileExist f if exist then do- file_in <- runIO $ readSource f- file <- if lit then tclift $ unlit f file_in else return file_in- (_, _, modules, _) <- parseImports f file- -- The chaser should never report warnings from sub-modules- clearParserWarnings- ms <- mapM (btree done . import_path) modules+ lift $ logLvl 1 $ "Reading source " ++ show f+ let modules = maybe [] id (lookup f importlists)+ ms <- mapM (btree stk . import_path) modules return (concat ms) else return [] -- IBC with no source available -- (\c -> return []) -- error, can't chase modules here
src/Idris/CmdOptions.hs view
@@ -148,6 +148,8 @@ <|> (UseConsoleWidth <$> option (str >>= parseConsoleWidth) (long "consolewidth" <> metavar "WIDTH" <> help "Select console width: auto, infinite, nat")) <|> flag' DumpHighlights (long "highlight" <> help "Emit source code highlighting")+ <|> flag' NoElimDeprecationWarnings (long "no-elim-deprecation-warnings" <> help "Disable deprecation warnings for %elim")+ <|> flag' NoOldTacticDeprecationWarnings (long "no-tactic-deprecation-warnings" <> help "Disable deprecation warnings for the old tactic sublanguage") where getExt s = case maybeRead s of
src/Idris/Completion.hs view
@@ -12,7 +12,7 @@ import Idris.ParseHelpers(opChars) import qualified Idris.ParseExpr (constants, tactics) import Idris.ParseExpr (TacticArg (..))-import Idris.REPLParser (allHelp)+import Idris.REPLParser (allHelp, setOptions) import Control.Monad.State.Strict import Data.List@@ -82,13 +82,7 @@ completeOption :: CompletionFunc Idris completeOption = completeWord Nothing " \t" completeOpt- where completeOpt = return . completeWith [ "errorcontext"- , "showimplicits"- , "originalerrors"- , "autosolve"- , "nobanner"- , "desugarnats"- ]+ where completeOpt = return . completeWith (map fst setOptions) completeConsoleWidth :: CompletionFunc Idris completeConsoleWidth = completeWord Nothing " \t" completeW
src/Idris/Core/Binary.hs view
@@ -145,10 +145,11 @@ put (At fc e) = do putWord8 27 put fc put e- put (Elaborating str n e) = do putWord8 28- put str- put n- put e+ put (Elaborating str n ty e) = do putWord8 28+ put str+ put n+ put ty+ put e put (ElaboratingArg n1 n2 ns e) = do putWord8 29 put n1 put n2@@ -188,7 +189,10 @@ put ns put (RunningElabScript e) = do putWord8 42 put e-+ put (ElabScriptStaging n) = do putWord8 43+ put n+ put (FancyMsg xs) = do putWord8 44+ put xs get = do i <- getWord8 case i of 0 -> fmap Msg get@@ -230,8 +234,8 @@ 26 -> fmap NoRewriting get 27 -> do x <- get ; y <- get return $ At x y- 28 -> do x <- get ; y <- get ; z <- get- return $ Elaborating x y z+ 28 -> do w <- get; x <- get ; y <- get ; z <- get+ return $ Elaborating w x y z 29 -> do w <- get ; x <- get ; y <- get ; z <- get return $ ElaboratingArg w x y z 30 -> fmap ProviderError get@@ -259,6 +263,8 @@ return $ UnknownImplicit x y 41 -> fmap NoValidAlts get 42 -> fmap RunningElabScript get+ 43 -> fmap ElabScriptStaging get+ 44 -> fmap FancyMsg get _ -> error "Corrupted binary data for Err'" ----- Generated by 'derive' @@ -284,6 +290,9 @@ return (FileFC x1) _ -> error "Corrupted binary data for FC" +instance Binary FC' where+ put (FC' fc) = put fc+ get = fmap FC' get instance Binary Name where put x@@ -296,10 +305,9 @@ MN x1 x2 -> do putWord8 2 put x1 put x2- NErased -> putWord8 3- SN x1 -> do putWord8 4+ SN x1 -> do putWord8 3 put x1- SymRef x1 -> do putWord8 5+ SymRef x1 -> do putWord8 4 put x1 get = do i <- getWord8@@ -312,10 +320,9 @@ 2 -> do x1 <- get x2 <- get return (MN x1 x2)- 3 -> return NErased- 4 -> do x1 <- get+ 3 -> do x1 <- get return (SN x1)- 5 -> do x1 <- get+ 4 -> do x1 <- get return (SymRef x1) _ -> error "Corrupted binary data for Name" @@ -334,7 +341,7 @@ put x2 MethodN x1 -> do putWord8 3 put x1- CaseN x1 -> do putWord8 4; put x1+ CaseN x1 x2 -> do putWord8 4; put x1; put x2 ElimN x1 -> do putWord8 5; put x1 InstanceCtorN x1 -> do putWord8 6; put x1 WithN x1 x2 -> do putWord8 7@@ -359,7 +366,8 @@ 3 -> do x1 <- get return (MethodN x1) 4 -> do x1 <- get- return (CaseN x1)+ x2 <- get+ return (CaseN x1 x2) 5 -> do x1 <- get return (ElimN x1) 6 -> do x1 <- get@@ -452,9 +460,7 @@ RType -> putWord8 3 RConstant x1 -> do putWord8 4 put x1- RForce x1 -> do putWord8 5- put x1- RUType x1 -> do putWord8 6+ RUType x1 -> do putWord8 5 put x1 get = do i <- getWord8@@ -472,18 +478,17 @@ 4 -> do x1 <- get return (RConstant x1) 5 -> do x1 <- get- return (RForce x1)- 6 -> do x1 <- get return (RUType x1) _ -> error "Corrupted binary data for Raw" instance Binary ImplicitInfo where put x = case x of- Impl x1 -> put x1+ Impl x1 x2 -> do put x1; put x2 get = do x1 <- get- return (Impl x1)+ x2 <- get+ return (Impl x1 x2) instance (Binary b) => Binary (Binder b) where put x
src/Idris/Core/DeepSeq.hs view
@@ -13,7 +13,6 @@ rnf (UN x1) = rnf x1 `seq` () rnf (NS x1 x2) = rnf x1 `seq` rnf x2 `seq` () rnf (MN x1 x2) = rnf x1 `seq` rnf x2 `seq` ()- rnf NErased = () rnf (SN x1) = rnf x1 `seq` () rnf (SymRef x1) = rnf x1 `seq` () @@ -65,7 +64,7 @@ rnf (InstanceN x1 x2) = rnf x1 `seq` rnf x2 `seq` () rnf (ParentN x1 x2) = rnf x1 `seq` rnf x2 `seq` () rnf (MethodN x1) = rnf x1 `seq` ()- rnf (CaseN x1) = rnf x1 `seq` ()+ rnf (CaseN x1 x2) = rnf x1 `seq` rnf x2 `seq` () rnf (ElimN x1) = rnf x1 `seq` () rnf (InstanceCtorN x1) = rnf x1 `seq` () rnf (MetaN x1 x2) = rnf x1 `seq` rnf x2 `seq` ()@@ -81,7 +80,6 @@ rnf (RApp x1 x2) = rnf x1 `seq` rnf x2 `seq` () rnf RType = () rnf (RUType x1) = rnf x1 `seq` ()- rnf (RForce x1) = rnf x1 `seq` () rnf (RConstant x1) = x1 `seq` () instance NFData FC where@@ -89,6 +87,9 @@ rnf NoFC = () rnf (FileFC f) = rnf f `seq` () +instance NFData FC' where+ rnf (FC' fc) = rnf fc `seq` ()+ instance NFData Provenance where rnf ExpectedType = () rnf InferredVal = ()@@ -148,13 +149,15 @@ rnf (ProofSearchFail x1) = rnf x1 `seq` () rnf (NoRewriting x1) = rnf x1 `seq` () rnf (At x1 x2) = rnf x1 `seq` rnf x2 `seq` ()- rnf (Elaborating x1 x2 x3)- = rnf x1 `seq` rnf x2 `seq` rnf x3 `seq` ()+ rnf (Elaborating x1 x2 x3 x4)+ = rnf x1 `seq` rnf x2 `seq` rnf x3 `seq` rnf x4 `seq` () rnf (ProviderError x1) = rnf x1 `seq` () rnf (LoadingFailed x1 x2) = rnf x1 `seq` rnf x2 `seq` () rnf (ElabScriptDebug x1 x2 x3) = rnf x1 `seq` rnf x2 `seq` rnf x3 `seq` () rnf (ElabScriptStuck x1) = rnf x1 `seq` () rnf (RunningElabScript x1) = rnf x1 `seq` ()+ rnf (ElabScriptStaging x1) = rnf x1 `seq` ()+ rnf (FancyMsg x1) = rnf x1 `seq` () instance NFData ErrorReportPart where rnf (TextPart x1) = rnf x1 `seq` ()@@ -164,7 +167,7 @@ rnf (SubReport x1) = rnf x1 `seq` () instance NFData ImplicitInfo where- rnf (Impl x1) = rnf x1 `seq` ()+ rnf (Impl x1 x2) = rnf x1 `seq` rnf x2 `seq` () instance (NFData b) => NFData (Binder b) where rnf (Lam x1) = rnf x1 `seq` ()
src/Idris/Core/Elaborate.hs view
@@ -119,8 +119,8 @@ rewriteErr (ProofSearchFail e) = ProofSearchFail (rewriteErr e) rewriteErr e = f e -errAt :: String -> Name -> Elab' aux a -> Elab' aux a-errAt thing n = transformErr (Elaborating thing n)+errAt :: String -> Name -> Maybe Type -> Elab' aux a -> Elab' aux a+errAt thing n ty = transformErr (Elaborating thing n ty) erun :: FC -> Elab' aux a -> Elab' aux a@@ -711,8 +711,8 @@ = do g <- goal case g of Bind _ (Pi _ _ _) _ -> return ()- _ -> do a <- getNameFrom (sMN 0 "pargTy")- b <- getNameFrom (sMN 0 "pretTy")+ _ -> do a <- getNameFrom (sMN 0 "__pargTy")+ b <- getNameFrom (sMN 0 "__pretTy") f <- getNameFrom (sMN 0 "pf") claim a RType claim b RType@@ -725,8 +725,8 @@ simple_app :: Bool -> Elab' aux () -> Elab' aux () -> String -> Elab' aux () simple_app infer fun arg str = - do a <- getNameFrom (sMN 0 "argTy")- b <- getNameFrom (sMN 0 "retTy")+ do a <- getNameFrom (sMN 0 "__argTy")+ b <- getNameFrom (sMN 0 "__retTy") f <- getNameFrom (sMN 0 "f") s <- getNameFrom (sMN 0 "s") claim a RType
src/Idris/Core/Evaluate.hs view
@@ -2,7 +2,8 @@ PatternGuards #-} {-# OPTIONS_GHC -fwarn-incomplete-patterns #-} -module Idris.Core.Evaluate(normalise, normaliseTrace, normaliseC, normaliseAll, toValue, quoteTerm,+module Idris.Core.Evaluate(normalise, normaliseTrace, normaliseC, + normaliseAll, normaliseBlocking, toValue, quoteTerm, rt_simplify, simplify, specialise, hnf, convEq, convEq', Def(..), CaseInfo(..), CaseDefs(..), Accessibility(..), Totality(..), PReason(..), MetaInformation(..),@@ -79,9 +80,17 @@ = evalState (do val <- eval False ctxt [] (map finalEntry env) t [] quote 0 val) initEval +-- | Normalise everything, whether abstract, private or public normaliseAll :: Context -> Env -> TT Name -> TT Name normaliseAll ctxt env t = evalState (do val <- eval False ctxt [] (map finalEntry env) t [AtREPL]+ quote 0 val) initEval++-- | As normaliseAll, but with an explicit list of names *not* to reduce+normaliseBlocking :: Context -> Env -> [Name] -> TT Name -> TT Name+normaliseBlocking ctxt env blocked t+ = evalState (do val <- eval False ctxt (map (\n -> (n, 0)) blocked)+ (map finalEntry env) t [AtREPL] quote 0 val) initEval normalise :: Context -> Env -> TT Name -> TT Name
src/Idris/Core/Execute.hs view
@@ -349,6 +349,17 @@ "The argument to fileEOF should be a file handle, but it was " ++ show handle ++ ". Are all cases covered?"+ | Just (FFun "fileError" [(_,handle)] _) <- foreignFromTT arity ty fn xs+ = case handle of+ -- errors handled differently in Haskell than in C, so if+ -- there's been an error we'll have had an exception already.+ -- Therefore, assume we're okay.+ EHandle h -> do let res = ioWrap (EConstant (I 0))+ execApp env ctxt res (drop arity xs)+ _ -> execFail . Msg $+ "The argument to fileError should be a file handle, but it was " +++ show handle +++ ". Are all cases covered?" | Just (FFun "fileClose" [(_,handle)] _) <- foreignFromTT arity ty fn xs = case handle of EHandle h -> do execIO $ hClose h
src/Idris/Core/ProofState.hs view
@@ -408,6 +408,8 @@ ps { holes = (hs \\ [x]) ++ [x], instances = x:is }) return (Bind x (Hole t) sc)+instanceArg n ctxt env _+ = fail "The current focus is not a hole." autoArg :: Name -> RunTactic autoArg n ctxt env (Bind x (Hole t) sc)@@ -418,6 +420,8 @@ autos = (x, (while_elaborating ps, refsIn t)) : autos ps } Just _ -> ps) return (Bind x (Hole t) sc)+autoArg n ctxt env _+ = fail "The current focus not a hole." setinj :: Name -> RunTactic setinj n ctxt env (Bind x b sc)@@ -439,6 +443,7 @@ mkTy ((n,b) : bs) t = Bind n (Pi Nothing (binderTy b) (TType (UVar 0))) (mkTy bs t) getP (n, b) = P Bound n (binderTy b)+defer dropped n ctxt env _ = fail "Can't defer a non-hole focus." -- as defer, but build the type and application explicitly deferType :: Name -> Raw -> [Name] -> RunTactic@@ -454,6 +459,7 @@ getP n = case lookup n env of Just b -> P Bound n (binderTy b) Nothing -> error ("deferType can't find " ++ show n)+deferType _ _ _ _ _ _ = fail "Can't defer a non-hole focus." regret :: RunTactic regret ctxt env (Bind x (Hole t) sc) | noOccurrence x sc =@@ -462,12 +468,14 @@ return sc regret ctxt env (Bind x (Hole t) _) = fail $ show x ++ " : " ++ show t ++ " is not solved..."+regret _ _ _ = fail "The current focus is not a hole." unifyGoal :: Raw -> RunTactic unifyGoal tm ctxt env h@(Bind x b sc) = do (tmv, _) <- lift $ check ctxt env tm ns' <- unify' ctxt env (binderTy b, Nothing) (tmv, Nothing) return h+unifyGoal _ _ _ _ = fail "The focus is not a binder." exact :: Raw -> RunTactic exact guess ctxt env (Bind x (Hole ty) sc) =@@ -621,19 +629,19 @@ intro :: Maybe Name -> RunTactic intro mn ctxt env (Bind x (Hole t) (P _ x' _)) | x == x' =- do let n = case mn of- Just name -> name- Nothing -> x- let t' = case t of+ do let t' = case t of x@(Bind y (Pi _ s _) _) -> x _ -> hnf ctxt env t case t' of Bind y (Pi _ s _) t ->+ let n = case mn of+ Just name -> name+ Nothing -> y -- It's important that this be subst and not updsubst, -- because we want to substitute even in portions of -- terms that we know do not contain holes.- let t' = subst y (P Bound n s) t in- return $ Bind n (Lam s) (Bind x (Hole t') (P Bound x t'))+ t' = subst y (P Bound n s) t+ in return $ Bind n (Lam s) (Bind x (Hole t') (P Bound x t')) _ -> lift $ tfail $ CantIntroduce t' intro n ctxt env _ = fail "Can't introduce here." @@ -714,7 +722,7 @@ let tmt' = normalise ctxt env tmt let (tacn, tacstr, tactt) = if induction then (ElimN, "eliminator", "Induction")- else (CaseN, "case analysis", "Case analysis")+ else (CaseN (FC' emptyFC), "case analysis", "Case analysis") case unApply tmt' of (P _ tnm _, tyargs) -> do case lookupTy (SN (tacn tnm)) ctxt of@@ -870,7 +878,7 @@ updateError [] err = err updateError ns (At f e) = At f (updateError ns e)-updateError ns (Elaborating s n e) = Elaborating s n (updateError ns e)+updateError ns (Elaborating s n ty e) = Elaborating s n ty (updateError ns e) updateError ns (ElaboratingArg f a env e) = ElaboratingArg f a env (updateError ns e) updateError ns (CantUnify b (l,lp) (r,rp) e xs sc)
src/Idris/Core/TT.hs view
@@ -58,6 +58,7 @@ import qualified Data.Map.Strict as Map import Data.Char import Data.Data (Data)+import Data.Monoid (mconcat) import Numeric (showIntAtBase) import qualified Data.Text as T import Data.List hiding (group, insert)@@ -148,7 +149,7 @@ _ == _ = True -- | FC with equality-newtype FC' = FC' { unwrapFC :: FC }+newtype FC' = FC' { unwrapFC :: FC } deriving (Data, Typeable, Ord) instance Eq FC' where FC' fc == FC' fc' = fcEq fc fc'@@ -157,6 +158,9 @@ fcEq (FileFC f) (FileFC f') = f == f' fcEq _ _ = False +instance Show FC' where+ showsPrec d (FC' fc) = showsPrec d fc+ -- | Empty source location emptyFC :: FC emptyFC = NoFC@@ -283,7 +287,7 @@ | ProofSearchFail (Err' t) | NoRewriting t | At FC (Err' t)- | Elaborating String Name (Err' t)+ | Elaborating String Name (Maybe t) (Err' t) | ElaboratingArg Name Name [(Name, Name)] (Err' t) | ProviderError String | LoadingFailed String (Err' t)@@ -293,6 +297,8 @@ -- ^ User-specified message, proof term, goals with context (first goal is focused) | ElabScriptStuck t | RunningElabScript (Err' t) -- ^ The error occurred during a top-level elaboration script+ | ElabScriptStaging Name+ | FancyMsg [ErrorReportPart] deriving (Eq, Functor, Data, Typeable) type Err = Err' Term@@ -354,7 +360,7 @@ size (IncompleteTerm trm) = size trm size ProgramLineComment = 1 size (At fc err) = size fc + size err- size (Elaborating _ n err) = size err+ size (Elaborating _ _ _ err) = size err size (ElaboratingArg _ _ _ err) = size err size (ProviderError msg) = length msg size (LoadingFailed fn e) = 1 + length fn + size e@@ -375,7 +381,11 @@ show (At f e) = show f ++ ":" ++ show e show (ElaboratingArg f x prev e) = "Elaborating " ++ show f ++ " arg " ++ show x ++ ": " ++ show e- show (Elaborating what n e) = "Elaborating " ++ what ++ show n ++ ":" ++ show e+ show (Elaborating what n ty e) = "Elaborating " ++ what ++ show n ++ + showType ty ++ ":" ++ show e+ where+ showType Nothing = ""+ showType (Just ty) = " with expected type " ++ show ty show (ProofSearchFail e) = "Proof search fail: " ++ show e show (InfiniteUnify _ _ _) = "InfiniteUnify" show (UnifyScope _ _ _ _) = "UnifyScope"@@ -442,7 +452,6 @@ data Name = UN !T.Text -- ^ User-provided name | NS !Name [T.Text] -- ^ Root, namespaces | MN !Int !T.Text -- ^ Machine chosen names- | NErased -- ^ Name of something which is never used in scope | SN !SpecialName -- ^ Decorated function names | SymRef Int -- ^ Reference to IBC file symbol table (used during serialisation) deriving (Eq, Ord, Data, Typeable)@@ -479,7 +488,7 @@ | InstanceN !Name [T.Text] | ParentN !Name !T.Text | MethodN !Name- | CaseN !Name+ | CaseN !FC' !Name | ElimN !Name | InstanceCtorN !Name | MetaN !Name !Name@@ -509,7 +518,6 @@ pretty n@(SN s) = annotate (AnnName n Nothing Nothing Nothing) $ text (show s) pretty n@(SymRef i) = annotate (AnnName n Nothing Nothing Nothing) $ text $ "##symbol" ++ show i ++ "##"- pretty NErased = annotate (AnnName NErased Nothing Nothing Nothing) $ text "_" instance Pretty [Name] OutputAnnotation where pretty = encloseSep empty empty comma . map pretty@@ -521,7 +529,6 @@ show (MN i s) = "{" ++ str s ++ show i ++ "}" show (SN s) = show s show (SymRef i) = "##symbol" ++ show i ++ "##"- show NErased = "_" instance Show SpecialName where show (WhereN i p c) = show p ++ ", " ++ show c@@ -529,7 +536,8 @@ show (InstanceN cl inst) = showSep ", " (map T.unpack inst) ++ " instance of " ++ show cl show (MethodN m) = "method " ++ show m show (ParentN p c) = show p ++ "#" ++ T.unpack c- show (CaseN n) = "case block in " ++ show n+ show (CaseN fc n) = "case block in " ++ show n +++ if fc == FC' emptyFC then "" else " at " ++ show fc show (ElimN n) = "<<" ++ show n ++ " eliminator>>" show (InstanceCtorN n) = "constructor of " ++ show n show (MetaN parent meta) = "<<" ++ show parent ++ " " ++ show meta ++ ">>"@@ -546,12 +554,20 @@ showCG' (InstanceN cl inst) = '@':showCG cl ++ '$':showSep ":" (map T.unpack inst) showCG' (MethodN m) = '!':showCG m showCG' (ParentN p c) = showCG p ++ "#" ++ show c- showCG' (CaseN c) = showCG c ++ "_case"+ showCG' (CaseN fc c) = showCG c ++ showFC' fc ++ "_case" showCG' (ElimN sn) = showCG sn ++ "_elim" showCG' (InstanceCtorN n) = showCG n ++ "_ictor" showCG' (MetaN parent meta) = showCG parent ++ "_meta_" ++ showCG meta+ showFC' (FC' NoFC) = ""+ showFC' (FC' (FileFC f)) = "_" ++ cgFN f+ showFC' (FC' (FC f s e))+ | s == e = "_" ++ cgFN f +++ "_" ++ show (fst s) ++ "_" ++ show (snd s)+ | otherwise = "_" ++ cgFN f +++ "_" ++ show (fst s) ++ "_" ++ show (snd s) +++ "_" ++ show (fst e) ++ "_" ++ show (snd e)+ cgFN = concatMap (\c -> if not (isDigit c || isLetter c) then "__" else [c]) showCG (SymRef i) = error "can't do codegen for a symbol reference"-showCG NErased = "_" -- |Contexts allow us to map names to things. A root name maps to a collection@@ -776,7 +792,6 @@ | RApp Raw Raw | RType | RUType Universe- | RForce Raw | RConstant Const deriving (Show, Eq, Data, Typeable) @@ -786,7 +801,6 @@ size (RApp left right) = 1 + size left + size right size RType = 1 size (RUType _) = 1- size (RForce raw) = 1 + size raw size (RConstant const) = size const instance Pretty Raw OutputAnnotation where@@ -797,7 +811,7 @@ deriving instance NFData Raw !-} -data ImplicitInfo = Impl { tcinstance :: Bool }+data ImplicitInfo = Impl { tcinstance :: Bool, toplevel_imp :: Bool } deriving (Show, Eq, Ord, Data, Typeable) {-!@@ -812,27 +826,44 @@ -- the types of bindings (and their values, if any); the attached identifiers are part -- of the 'Bind' constructor for the 'TT' type. data Binder b = Lam { binderTy :: !b {-^ type annotation for bound variable-}}+ -- ^ A function binding | Pi { binderImpl :: Maybe ImplicitInfo, binderTy :: !b, binderKind :: !b }- {-^ A binding that occurs in a function type expression, e.g. @(x:Int) -> ...@- The 'binderImpl' flag says whether it was a scoped implicit- (i.e. forall bound) in the high level Idris, but otherwise- has no relevance in TT. -}+ -- ^ A binding that occurs in a function type+ -- expression, e.g. @(x:Int) -> ...@ The 'binderImpl'+ -- flag says whether it was a scoped implicit+ -- (i.e. forall bound) in the high level Idris, but+ -- otherwise has no relevance in TT. | Let { binderTy :: !b, binderVal :: b {-^ value for bound variable-}} -- ^ A binding that occurs in a @let@ expression | NLet { binderTy :: !b, binderVal :: b }+ -- ^ NLet is an intermediate product in the evaluator+ -- that's used for temporarily naming locals during+ -- reduction. It won't occur outside the evaluator. | Hole { binderTy :: !b}+ -- ^ A hole in a term under construction in the+ -- elaborator. If this is not filled during+ -- elaboration, it is an error. | GHole { envlen :: Int, localnames :: [Name], binderTy :: !b}+ -- ^ A saved TT hole that will later be converted to a+ -- top-level Idris metavariable applied to all+ -- elements of its local environment. | Guess { binderTy :: !b, binderVal :: b }+ -- ^ A provided value for a hole. It will later be+ -- substituted - the guess is to keep it+ -- computationally inert while working on other things+ -- if necessary. | PVar { binderTy :: !b }- -- ^ A pattern variable+ -- ^ A pattern variable (these are bound around terms+ -- that make up pattern-match clauses) | PVTy { binderTy :: !b }+ -- ^ The type of a pattern binding deriving (Show, Eq, Ord, Functor, Foldable, Traversable, Data, Typeable) {-! deriving instance Binary Binder@@ -1420,12 +1451,11 @@ nextName' (WithN i n) = WithN i (nextName n) nextName' (InstanceN n ns) = InstanceN (nextName n) ns nextName' (ParentN n ns) = ParentN (nextName n) ns- nextName' (CaseN n) = CaseN (nextName n)+ nextName' (CaseN fc n) = CaseN fc (nextName n) nextName' (ElimN n) = ElimN (nextName n) nextName' (MethodN n) = MethodN (nextName n) nextName' (InstanceCtorN n) = InstanceCtorN (nextName n) nextName' (MetaN parent meta) = MetaN parent (nextName meta)-nextName NErased = NErased nextName (SymRef i) = error "Can't generate a name from a symbol reference" type Term = TT Name@@ -1582,7 +1612,7 @@ pureBinder (Let t v) = pureTerm t && pureTerm v pureBinder t = pureTerm (binderTy t) - notClassName (MN _ c) | c == txt "class" = False+ notClassName (MN _ c) | c == txt "__class" = False notClassName _ = True pureTerm _ = True@@ -1823,9 +1853,6 @@ pprintRaw bound RType = text "RType" pprintRaw bound (RUType u) = enclose lparen rparen . group . align . hang 2 $ text "RUType" <$> text (show u)-pprintRaw bound (RForce r) =- enclose lparen rparen . group . align . hang 2 $- vsep [text "RForce", pprintRaw bound r] pprintRaw bound (RConstant c) = enclose lparen rparen . group . align . hang 2 $ vsep [text "RConstant", annotate (AnnConst c) (text (show c))]
src/Idris/Core/Typecheck.hs view
@@ -160,9 +160,6 @@ constType TheWorld = Constant WorldType constType Forgot = Erased constType _ = TType (UVal 0)- chk u env (RForce t) - = do (_, ty) <- chk u env t- return (Erased, ty) chk u env (RBind n (Pi i s k) t) = do (sv, st) <- chk u env s (v, cs) <- get
src/Idris/Core/Unify.hs view
@@ -40,7 +40,7 @@ unrec (CantUnify r _ _ _ _ _) = not r unrec (At _ e) = unrec e- unrec (Elaborating _ _ e) = unrec e+ unrec (Elaborating _ _ _ e) = unrec e unrec (ElaboratingArg _ _ _ e) = unrec e unrec _ = False
src/Idris/Core/WHNF.hs view
@@ -1,7 +1,7 @@ {-# LANGUAGE PatternGuards #-} {-# OPTIONS_GHC -fwarn-incomplete-patterns #-} --- Reduction to Weak Head Normal Form+-- | Reduction to Weak Head Normal Form module Idris.Core.WHNF(whnf, WEnv) where import Idris.Core.TT@@ -11,7 +11,7 @@ import Debug.Trace --- A stack entry consists of a term and the environment it is to be+-- | A stack entry consists of a term and the environment it is to be -- evaluated in (i.e. it's a thunk) type StackEntry = (Term, WEnv) data WEnv = WEnv Int -- number of free variables@@ -20,17 +20,17 @@ type Stack = [StackEntry] --- A WHNF is a top level term evaluated in the empty environment. It is+-- | A WHNF is a top level term evaluated in the empty environment. It is -- always headed by either an irreducible expression, i.e. a constructor, -- a lambda, a constant, or a postulate-+-- -- Every 'Term' or 'Type' in this structure is associated with the -- environment it was encountered in, so that when we quote back to a term -- we get the substitutions right. -data WHNF = WDCon Int Int Bool Name (Type, WEnv) -- data constructor- | WTCon Int Int Name (Type, WEnv) -- type constructor- | WPRef Name (Type, WEnv) -- irreducible global (e.g. a postulate)+data WHNF = WDCon Int Int Bool Name (Type, WEnv) -- ^ data constructor+ | WTCon Int Int Name (Type, WEnv) -- ^ type constructor+ | WPRef Name (Type, WEnv) -- ^irreducible global (e.g. a postulate) | WBind Name (Binder Term) (Term, WEnv) | WApp WHNF (Term, WEnv) | WConstant Const@@ -40,7 +40,7 @@ | WErased | WImpossible --- Reduce a *closed* term to weak head normal form.+-- | Reduce a *closed* term to weak head normal form. whnf :: Context -> Term -> Term whnf ctxt tm = quote (do_whnf ctxt (WEnv 0 []) tm)
src/Idris/Coverage.hs view
@@ -137,7 +137,7 @@ _ -> False validCoverageCase ctxt (CantConvert _ _ _) = False validCoverageCase ctxt (At _ e) = validCoverageCase ctxt e-validCoverageCase ctxt (Elaborating _ _ e) = validCoverageCase ctxt e+validCoverageCase ctxt (Elaborating _ _ _ e) = validCoverageCase ctxt e validCoverageCase ctxt (ElaboratingArg _ _ _ e) = validCoverageCase ctxt e validCoverageCase ctxt _ = True @@ -167,7 +167,7 @@ | (Bound, Bound) <- (x, y) = True | otherwise = False -- name is different, unrecoverable recoverableCoverage ctxt (At _ e) = recoverableCoverage ctxt e-recoverableCoverage ctxt (Elaborating _ _ e) = recoverableCoverage ctxt e+recoverableCoverage ctxt (Elaborating _ _ _ e) = recoverableCoverage ctxt e recoverableCoverage ctxt (ElaboratingArg _ _ _ e) = recoverableCoverage ctxt e recoverableCoverage _ _ = False
src/Idris/DSL.hs view
@@ -42,7 +42,7 @@ , pexp (mkList fc ns)] MN i nm -> PApp fc (PRef fc [] (reflm "MN")) [ pexp (intC i) , pexp (stringC nm)]- otherwise -> PRef fc [] $ reflm "NErased"+ _ -> error "Invalid name from user syntax for DSL name" expandSugar :: DSL -> PTerm -> PTerm expandSugar dsl (PLam fc n nfc ty tm)
src/Idris/DataOpts.hs view
@@ -40,7 +40,6 @@ | otherwise = RApp <$> applyOpts f <*> applyOpts a applyOpts (RBind n b t) = RBind n <$> applyOpts b <*> applyOpts t- applyOpts (RForce t) = applyOpts t applyOpts t = return t -- Erase types (makes ibc smaller, and we don't need them)
src/Idris/DeepSeq.hs view
@@ -162,7 +162,9 @@ rnf (AutoWidth) = () rnf (AutoSolve) = () rnf (UseConsoleWidth cw) = rnf cw `seq` ()- rnf (DumpHighlights) = ()+ rnf DumpHighlights = ()+ rnf NoElimDeprecationWarnings = ()+ rnf NoOldTacticDeprecationWarnings = () instance NFData TIData where@@ -298,6 +300,7 @@ rnf (IBCUsage usage) = rnf usage `seq` () rnf (IBCExport name) = rnf name `seq` () rnf (IBCAutoHint n1 n2) = rnf n1 `seq` rnf n2 `seq` ()+ rnf (IBCDeprecate n1 n2) = rnf n1 `seq` rnf n2 `seq` () rnf (IBCRecord x) = rnf x `seq` () @@ -687,8 +690,8 @@ rnf (IState x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 x13 x14 x15 x16 x17 x18 x19 x20 x21 x22 x23 x24 x25 x26 x27 x28 x29 x30 x31 x32 x33 x34 x35 x36 x37 x38 x39 x40 x41 x42 x43 x44 x45 x46 x47 x48 x49 x50 x51 x52 x53 x54 x55 x56 x57 x58 x59 x60- x61 x62 x63 x64 x65 x66 x67 x68 x69 x70 x71 x72 x73)+ x61 x62 x63 x64 x65 x66 x67 x68 x69 x70 x71 x72 x73 x74) = rnf x1 `seq` rnf x2 `seq` rnf x3 `seq` rnf x4 `seq` rnf x5 `seq` rnf x6 `seq` rnf x7 `seq` rnf x8 `seq` rnf x9 `seq` rnf x10 `seq` () `seq` rnf x11 `seq` rnf x12 `seq` rnf x13 `seq` rnf x14 `seq` rnf x15 `seq` rnf x16 `seq` rnf x17 `seq` rnf x18 `seq` rnf x19 `seq` rnf x20 `seq` rnf x21 `seq` rnf x22 `seq` rnf x23 `seq` rnf x24 `seq` rnf x25 `seq` rnf x26 `seq` rnf x27 `seq` rnf x28 `seq` rnf x29 `seq` rnf x30 `seq` rnf x31 `seq` rnf x32 `seq` rnf x33 `seq` rnf x34 `seq` rnf x35 `seq` rnf x36 `seq` rnf x37 `seq` rnf x38 `seq` rnf x39 `seq` rnf x40 `seq` rnf x41 `seq` rnf x42 `seq` rnf x43 `seq` rnf x44 `seq` rnf x45 `seq` rnf x46 `seq` rnf x47 `seq` rnf x48 `seq` rnf x49 `seq` rnf x50 `seq` rnf x51 `seq` rnf x52 `seq` rnf x53 `seq` rnf x54 `seq` rnf x55 `seq` rnf x56 `seq` rnf x57 `seq` rnf x58 `seq` rnf x59 `seq` rnf x60 `seq`- rnf x61 `seq` rnf x62 `seq` rnf x63 `seq` rnf x64 `seq` rnf x65 `seq` rnf x66 `seq` rnf x67 `seq` rnf x68 `seq` rnf x69 `seq` rnf x70 `seq` rnf x71 `seq` rnf x72 `seq` rnf x73 `seq` ()+ rnf x61 `seq` rnf x62 `seq` rnf x63 `seq` rnf x64 `seq` rnf x65 `seq` rnf x66 `seq` rnf x67 `seq` rnf x68 `seq` rnf x69 `seq` rnf x70 `seq` rnf x71 `seq` rnf x72 `seq` rnf x73 `seq` rnf x74 `seq` ()
src/Idris/Delaborate.hs view
@@ -110,6 +110,9 @@ _ -> PRef un [] n de env _ (Bind n (Lam ty) sc) = PLam un n NoFC (de env [] ty) (de ((n,n):env) [] sc)+ de env (_ : is) (Bind n (Pi (Just impl) ty _) sc)+ | toplevel_imp impl -- information in 'imps' repeated+ = PPi (Imp [] Dynamic False (Just impl)) n NoFC (de env [] ty) (de ((n,n):env) is sc) de env is (Bind n (Pi (Just impl) ty _) sc) | tcinstance impl = PPi constraint n NoFC (de env [] ty) (de ((n,n):env) is sc)@@ -192,7 +195,7 @@ isCaseApp tm | P _ n _ <- fst (unApply tm) = isCN n | otherwise = False where isCN (NS n _) = isCN n- isCN (SN (CaseN _)) = True+ isCN (SN (CaseN _ _)) = True isCN _ = False delabCase :: [(Name, Name)] -> [PArg] -> Name -> Term -> Name -> [Term] -> Maybe PTerm@@ -437,9 +440,14 @@ pprintErr' i (ProofSearchFail e) = pprintErr' i e pprintErr' i (NoRewriting tm) = text "rewrite did not change type" <+> annTm tm (pprintTerm i (delabSugared i tm)) pprintErr' i (At f e) = annotate (AnnFC f) (text (show f)) <> colon <> pprintErr' i e-pprintErr' i (Elaborating s n e) = text "When checking" <+> text s <>- annName' n (showqual i n) <> colon <$>- pprintErr' i e+pprintErr' i (Elaborating s n ty e) = text "When checking" <+> text s <>+ annName' n (showqual i n) <> + pprintTy ty <$>+ pprintErr' i e+ where pprintTy Nothing = colon+ pprintTy (Just ty) = text " with expected type" <> + indented (annTm ty (pprintTerm i (delabSugared i ty)))+ <> line pprintErr' i (ElaboratingArg f x _ e) | isInternal f = pprintErr' i e | isUN x =@@ -503,6 +511,12 @@ text "Is it a stuck term?" pprintErr' i (RunningElabScript e) = text "While running an elaboration script, the following error occurred" <> colon <$> pprintErr' i e+pprintErr' i (ElabScriptStaging n) =+ text "Can't run elaboration script because it contains pattern matching that has not yet been elaborated." <$>+ text "Try lifting the script to a top-level definition." <$>+ text "In particular, the problem is caused by:" <+> annName n+pprintErr' i (FancyMsg parts) =+ fillSep (map (showPart i) parts) showPart :: IState -> ErrorReportPart -> Doc OutputAnnotation showPart ist (TextPart str) = fillSep . map text . words $ str
src/Idris/Directives.hs view
@@ -64,7 +64,10 @@ map (\(n, fc) -> (fc, AnnName n Nothing Nothing Nothing)) ns' directiveAction (DLanguage ext) = addLangExt ext-+directiveAction (DDeprecate n reason) + = do n' <- disambiguate n+ addDeprecated n' reason+ addIBC (IBCDeprecate n' reason) directiveAction (DUsed fc fn arg) = addUsedName fc fn arg disambiguate :: Name -> Idris Name
src/Idris/Elab/Class.hs view
@@ -258,7 +258,7 @@ insertConstraint :: PTerm -> [Name] -> PTerm -> PTerm insertConstraint c all (PPi p@(Imp _ _ _ _) n fc ty sc) = PPi p n fc ty (insertConstraint c all sc)- insertConstraint c all sc = let dictN = sMN 0 "class"+ insertConstraint c all sc = let dictN = sMN 0 "__class" in PPi (constraint { pstatic = Static }) dictN NoFC c (constrainMeths (map basename all)
src/Idris/Elab/Clause.hs view
@@ -223,46 +223,47 @@ putIState (ist { idris_patdefs = addDef n (force pdef_pe, force pmissing) (idris_patdefs ist) }) let caseInfo = CaseInfo (inlinable opts) (inlinable opts) (dictionary opts)- case lookupTy n ctxt of- [ty] -> do ctxt' <- do ctxt <- getContext- tclift $- addCasedef n erInfo caseInfo- tcase defaultcase- reflect- (AssertTotal `elem` opts)- atys- inacc- pats_pe- pdef- pdef -- compile time- pdef_inl -- inlined- pdef' ty- ctxt- setContext ctxt'- addIBC (IBCDef n)- setTotality n tot- when (not reflect && PEGenerated `notElem` opts) $ - do totcheck (fc, n)- defer_totcheck (fc, n)- when (tot /= Unchecked) $ addIBC (IBCTotal n tot)- i <- getIState- case lookupDef n (tt_ctxt i) of- (CaseOp _ _ _ _ _ cd : _) ->- let (scargs, sc) = cases_compiletime cd- (scargs', sc') = cases_runtime cd in- do let calls = findCalls sc' scargs'- let used = findUsedArgs sc' scargs'- -- let scg = buildSCG i sc scargs- -- add SCG later, when checking totality- let cg = CGInfo scargs' calls [] used [] -- TODO: remove this, not needed anymore- logLvl 2 $ "Called names: " ++ show cg- addToCG n cg- addToCalledG n (nub (map fst calls)) -- plus names in type!- addIBC (IBCCG n)- _ -> return ()- return ()+ case lookupTyExact n ctxt of+ Just ty -> + do ctxt' <- do ctxt <- getContext+ tclift $+ addCasedef n erInfo caseInfo+ tcase defaultcase+ reflect+ (AssertTotal `elem` opts)+ atys+ inacc+ pats_pe+ pdef+ pdef -- compile time+ pdef_inl -- inlined+ pdef' ty+ ctxt+ setContext ctxt'+ addIBC (IBCDef n)+ setTotality n tot+ when (not reflect && PEGenerated `notElem` opts) $ + do totcheck (fc, n)+ defer_totcheck (fc, n)+ when (tot /= Unchecked) $ addIBC (IBCTotal n tot)+ i <- getIState+ case lookupDef n (tt_ctxt i) of+ (CaseOp _ _ _ _ _ cd : _) ->+ let (scargs, sc) = cases_compiletime cd+ (scargs', sc') = cases_runtime cd in+ do let calls = findCalls sc' scargs'+ let used = findUsedArgs sc' scargs'+ -- let scg = buildSCG i sc scargs+ -- add SCG later, when checking totality+ let cg = CGInfo scargs' calls [] used [] -- TODO: remove this, not needed anymore+ logLvl 2 $ "Called names: " ++ show cg+ addToCG n cg+ addToCalledG n (nub (map fst calls)) -- plus names in type!+ addIBC (IBCCG n)+ _ -> return ()+ return () -- addIBC (IBCTotal n tot)- [] -> return ()+ _ -> return () -- Check it's covering, if 'covering' option is used. Chase -- all called functions, and fail if any of them are also -- 'Partial NotCovering'@@ -476,7 +477,9 @@ let lhs = addImplPat i lhs_in -- if the LHS type checks, it is possible case elaborate ctxt (idris_datatypes i) (sMN 0 "patLHS") infP initEState- (erun fc (buildTC i info ELHS [] fname (infTerm lhs))) of+ (erun fc (buildTC i info ELHS [] fname + (allNamesIn lhs_in)+ (infTerm lhs))) of OK (ElabResult lhs' _ _ ctxt' newDecls highlights, _) -> do setContext ctxt' processTacticDecls info newDecls@@ -491,19 +494,19 @@ recoverableCoverage ctxt err) -propagateParams :: IState -> [Name] -> Type -> PTerm -> PTerm-propagateParams i ps t tm@(PApp _ (PRef fc hls n) args)+propagateParams :: IState -> [Name] -> Type -> [Name] -> PTerm -> PTerm+propagateParams i ps t bound tm@(PApp _ (PRef fc hls n) args) = PApp fc (PRef fc hls n) (addP t args) where addP (Bind n _ sc) (t : ts) | Placeholder <- getTm t, n `elem` ps,- not (n `elem` allNamesIn tm)- = t { getTm = PRef NoFC [] n } : addP sc ts+ not (n `elem` bound)+ = t { getTm = PPatvar NoFC n } : addP sc ts addP (Bind n _ sc) (t : ts) = t : addP sc ts addP _ ts = ts-propagateParams i ps t tm@(PApp fc ap args)- = PApp fc (propagateParams i ps t ap) args-propagateParams i ps t (PRef fc hls n)+propagateParams i ps t bound (PApp fc ap args)+ = PApp fc (propagateParams i ps t bound ap) args+propagateParams i ps t bound (PRef fc hls n) = case lookupCtxt n (idris_implicits i) of [is] -> let ps' = filter (isImplicit is) ps in PApp fc (PRef fc hls n) (map (\x -> pimp x (PRef fc [] x) True) ps')@@ -511,7 +514,7 @@ where isImplicit [] n = False isImplicit (PImp _ _ _ x _ : is) n | x == n = True isImplicit (_ : is) n = isImplicit is n-propagateParams i ps t x = x+propagateParams i ps t bound x = x findUnique :: Context -> Env -> Term -> [Name] findUnique ctxt env (Bind n b sc)@@ -548,6 +551,12 @@ -- pattern bindings i <- getIState inf <- isTyInferred fname++ -- Check if we have "with" patterns outside of "with" block+ when (isOutsideWith lhs_in && (not $ null withs)) $+ ierror $ (At fc (Elaborating "left hand side of " fname Nothing+ (Msg "unexpected patterns outside of \"with\" block")))+ -- get the parameters first, to pass through to any where block let fn_ty = case lookupTy fname (tt_ctxt i) of [t] -> t@@ -560,7 +569,7 @@ let tcparams = getTCParamsInType i [] fn_is norm_ty let lhs = mkLHSapp $ stripLinear i $ stripUnmatchable i $- propagateParams i params norm_ty (addImplPat i lhs_in)+ propagateParams i params norm_ty (allNamesIn lhs_in) (addImplPat i lhs_in) -- let lhs = mkLHSapp $ -- propagateParams i params fn_ty (addImplPat i lhs_in) logLvl 10 (show (params, fn_ty) ++ " " ++ showTmImpls (addImplPat i lhs_in))@@ -570,8 +579,10 @@ ((ElabResult lhs' dlhs [] ctxt' newDecls highlights, probs, inj), _) <- tclift $ elaborate ctxt (idris_datatypes i) (sMN 0 "patLHS") infP initEState- (do res <- errAt "left hand side of " fname- (erun fc (buildTC i info ELHS opts fname (infTerm lhs)))+ (do res <- errAt "left hand side of " fname Nothing+ (erun fc (buildTC i info ELHS opts fname + (allNamesIn lhs_in)+ (infTerm lhs))) probs <- get_probs inj <- get_inj return (res, probs, inj))@@ -654,9 +665,9 @@ mapM_ setinj (nub (tcparams ++ inj)) setNextName (ElabResult _ _ is ctxt' newDecls highlights) <-- errAt "right hand side of " fname+ errAt "right hand side of " fname (Just clhsty) (erun fc (build i winfo ERHS opts fname rhs))- errAt "right hand side of " fname+ errAt "right hand side of " fname (Just clhsty) (erun fc $ psolve lhs_tm) hs <- get_holes mapM_ (elabCaseHole is) hs@@ -676,7 +687,7 @@ logLvl 4 $ "---> " ++ show rhs' when (not (null defer)) $ logLvl 1 $ "DEFERRED " ++ show (map (\ (n, (_,_,t,_)) -> (n, t)) defer)- def' <- checkDef fc (Elaborating "deferred type of ") defer+ def' <- checkDef fc (\n -> Elaborating "deferred type of " n Nothing) defer let def'' = map (\(n, (i, top, t, ns)) -> (n, (i, top, t, ns, False))) def' addDeferred def'' mapM_ (\(n, _) -> addIBC (IBCDef n)) def''@@ -798,6 +809,11 @@ isArg' _ = False isArg _ _ = False + -- term is not within "with" block+ isOutsideWith :: PTerm -> Bool+ isOutsideWith (PApp _ (PRef _ _ (SN (WithN _ _))) _) = False+ isOutsideWith _ = True+ elabClause info opts (_, PWith fc fname lhs_in withs wval_in pn_in withblock) = do let tcgen = Dictionary `elem` opts ctxt <- getContext@@ -812,12 +828,16 @@ [t] -> t _ -> [] let params = getParamsInType i [] fn_is (normalise ctxt [] fn_ty)- let lhs = stripLinear i $ stripUnmatchable i $ propagateParams i params fn_ty (addImplPat i lhs_in)+ let lhs = stripLinear i $ stripUnmatchable i $ + propagateParams i params fn_ty (allNamesIn lhs_in) + (addImplPat i lhs_in) logLvl 2 ("LHS: " ++ show lhs) (ElabResult lhs' dlhs [] ctxt' newDecls highlights, _) <- tclift $ elaborate ctxt (idris_datatypes i) (sMN 0 "patLHS") infP initEState- (errAt "left hand side of with in " fname- (erun fc (buildTC i info ELHS opts fname (infTerm lhs))) )+ (errAt "left hand side of with in " fname Nothing+ (erun fc (buildTC i info ELHS opts fname + (allNamesIn lhs_in)+ (infTerm lhs))) ) setContext ctxt' processTacticDecls info newDecls sendHighlighting highlights@@ -841,7 +861,7 @@ mapM_ addPSname (allNamesIn lhs_in) setNextName -- TODO: may want where here - see winfo abpve- (ElabResult _ d is ctxt' newDecls highlights) <- errAt "with value in " fname+ (ElabResult _ d is ctxt' newDecls highlights) <- errAt "with value in " fname Nothing (erun fc (build i info ERHS opts fname (infTerm wval))) erun fc $ psolve lhs_tm tt <- get_term
src/Idris/Elab/Data.hs view
@@ -48,13 +48,19 @@ import Data.Char(isLetter, toLower) import Data.List.Split (splitOn) -import Util.Pretty(pretty, text)+import Util.Pretty +warnLC :: FC -> Name -> Idris ()+warnLC fc n + = iWarn fc $ annName n <+> text "has a name which may be implicitly bound."+ <> line <> text "This is likely to lead to problems!"+ elabData :: ElabInfo -> SyntaxInfo -> Docstring (Either Err PTerm)-> [(Name, Docstring (Either Err PTerm))] -> FC -> DataOpts -> PData -> Idris () elabData info syn doc argDocs fc opts (PLaterdecl n nfc t_in) = do let codata = Codata `elem` opts logLvl 1 (show (fc, doc)) checkUndefined fc n+ when (implicitable n) $ warnLC fc n (cty, _, t, inacc) <- buildType info syn fc [] n t_in addIBC (IBCDef n)@@ -65,6 +71,7 @@ = do let codata = Codata `elem` opts logLvl 1 (show fc) undef <- isUndefined fc n+ when (implicitable n) $ warnLC fc n (cty, ckind, t, inacc) <- buildType info syn fc [] n t_in -- if n is defined already, make sure it is just a type declaration -- with the same type we've just elaborated, and no constructors@@ -74,9 +81,11 @@ -- temporary, to check cons when undef $ updateContext (addTyDecl n (TCon 0 0) cty) let cnameinfo = cinfo info (map cname dcons)- let unique = case getRetTy cty of- UType UniqueType -> True- _ -> False+ unique <- case getRetTy (normalise (tt_ctxt i) [] cty) of+ UType UniqueType -> return True+ UType _ -> return False+ TType _ -> return False+ rt -> tclift $ tfail (At fc (Elaborating "type constructor " n Nothing (Msg "Not a valid type constructor"))) cons <- mapM (elabCon cnameinfo syn n codata (getRetTy cty) ckind) dcons ttag <- getName i <- getIState@@ -222,6 +231,7 @@ Idris (Name, Type) elabCon info syn tn codata expkind dkind (doc, argDocs, n, nfc, t_in, fc, forcenames) = do checkUndefined fc n+ when (implicitable n) $ warnLC fc n logLvl 2 $ show fc ++ ":Constructor " ++ show n ++ " : " ++ show t_in (cty, ckind, t, inacc) <- buildType info syn fc [Constructor] n (if codata then mkLazy t_in else t_in) ctxt <- getContext@@ -253,9 +263,9 @@ where tyIs con (Bind n b sc) = tyIs con sc tyIs con t | (P _ n' _, _) <- unApply t- = if n' /= tn then tclift $ tfail (At fc (Elaborating "constructor " con (Msg (show n' ++ " is not " ++ show tn))))+ = if n' /= tn then tclift $ tfail (At fc (Elaborating "constructor " con Nothing (Msg (show n' ++ " is not " ++ show tn)))) else return ()- tyIs con t = tclift $ tfail (At fc (Elaborating "constructor " con (Msg (show t ++ " is not " ++ show tn))))+ tyIs con t = tclift $ tfail (At fc (Elaborating "constructor " con Nothing (Msg (show t ++ " is not " ++ show tn)))) mkLazy (PPi pl n nfc ty sc) = let ty' = if getTyName ty@@ -337,12 +347,12 @@ let eliminatorDef = PClauses emptyFC [TotalFn] elimDeclName eliminatorClauses elimLog $ "-- case function definition: " ++ (show . showDeclImp verbosePPOption) eliminatorDef State.lift $ idrisCatch (rec_elabDecl info EAll info eliminatorTyDecl)- (ierror . Elaborating "type declaration of " elimDeclName)+ (ierror . Elaborating "type declaration of " elimDeclName Nothing) -- Do not elaborate clauses if there aren't any case eliminatorClauses of [] -> State.lift $ solveDeferred elimDeclName -- Remove meta-variable for type _ -> State.lift $ idrisCatch (rec_elabDecl info EAll info eliminatorDef)- (ierror . Elaborating "clauses of " elimDeclName)+ (ierror . Elaborating "clauses of " elimDeclName Nothing) where elimLog :: String -> EliminatorState () elimLog s = State.lift (logLvl 2 s) @@ -350,7 +360,7 @@ elimFC = fileFC "(casefun)" elimDeclName :: Name- elimDeclName = if ind then SN . ElimN $ n else SN . CaseN $ n+ elimDeclName = if ind then SN . ElimN $ n else SN . CaseN (FC' emptyFC) $ n applyNS :: Name -> [String] -> Name applyNS n [] = n
src/Idris/Elab/Instance.hs view
@@ -181,7 +181,7 @@ ctxt <- getContext (ElabResult tyT _ _ ctxt' newDecls highlights, _) <- tclift $ elaborate ctxt (idris_datatypes i) iname (TType (UVal 0)) initEState- (errAt "type of " iname (erun fc (build i info ERHS [] iname ty)))+ (errAt "type of " iname Nothing (erun fc (build i info ERHS [] iname ty))) setContext ctxt' processTacticDecls info newDecls sendHighlighting highlights
src/Idris/Elab/Record.hs view
@@ -171,7 +171,7 @@ ttConsTy <- case lookupTyExact dconName (tt_ctxt i) of Just as -> return as- Nothing -> tclift $ tfail $ At fc (Elaborating "record " tyn (InternalMsg "It seems like the constructor for this record has disappeared. :( \n This is a bug. Please report."))+ Nothing -> tclift $ tfail $ At fc (Elaborating "record " tyn Nothing (InternalMsg "It seems like the constructor for this record has disappeared. :( \n This is a bug. Please report.")) -- The arguments to the constructor let constructorArgs = getArgTys ttConsTy
src/Idris/Elab/Term.hs view
@@ -28,9 +28,10 @@ import Control.Applicative ((<$>)) import Control.Monad import Control.Monad.State.Strict+import Data.Foldable (for_) import Data.List import qualified Data.Map as M-import Data.Maybe (mapMaybe, fromMaybe, catMaybes)+import Data.Maybe (mapMaybe, fromMaybe, catMaybes, maybeToList) import qualified Data.Set as S import qualified Data.Text as T @@ -137,15 +138,16 @@ -- (Separate, so we don't go overboard resolving things that we don't -- know about yet on the LHS of a pattern def) -buildTC :: IState -> ElabInfo -> ElabMode -> FnOpts -> Name -> PTerm ->+buildTC :: IState -> ElabInfo -> ElabMode -> FnOpts -> Name -> + [Name] -> -- Cached names in the PTerm, before adding PAlternatives+ PTerm -> ElabD ElabResult-buildTC ist info emode opts fn tm- = do -- set name supply to begin after highest index in tm- let ns = allNamesIn tm- let tmIn = tm+buildTC ist info emode opts fn ns tm+ = do let tmIn = tm let inf = case lookupCtxt fn (idris_tyinfodata ist) of [TIPartial] -> True _ -> False+ -- set name supply to begin after highest index in tm initNextNameFrom ns elab ist info emode opts fn tm probs <- get_probs@@ -308,7 +310,7 @@ forceErr orig env (InfiniteUnify _ t _) | (P _ (UN ht) _, _) <- unApply (normalise (tt_ctxt ist) env t), ht == txt "Lazy'" = notDelay orig- forceErr orig env (Elaborating _ _ t) = forceErr orig env t+ forceErr orig env (Elaborating _ _ _ t) = forceErr orig env t forceErr orig env (ElaboratingArg _ _ _ t) = forceErr orig env t forceErr orig env (At _ t) = forceErr orig env t forceErr orig env t = False@@ -361,7 +363,7 @@ elab' ina fc (PResolveTC (FC "HACK" _ _)) -- for chasing parent classes = do g <- goal; resolveTC' False False 5 g fn ist elab' ina fc (PResolveTC fc')- = do c <- getNameFrom (sMN 0 "class")+ = do c <- getNameFrom (sMN 0 "__class") instanceArg c -- Elaborate the equality type first homogeneously, then -- heterogeneously as a fallback@@ -442,16 +444,17 @@ uns <- get_usedns let as' = map (mkUniqueNames (uns ++ map snd ms) ms) as_pruned (h : hs) <- get_holes--- trace (show (map showHd as')) $ ty <- goal case as' of- [] -> lift $ tfail $ NoValidAlts (map showHd as)+ [] -> do hds <- mapM showHd as+ lift $ tfail $ NoValidAlts hds [x] -> elab' ina fc x -- If there's options, try now, and if that fails, postpone -- to later. _ -> handleError isAmbiguous- (tryAll (zip (map (elab' ina fc) as') - (map showHd as')))+ (do hds <- mapM showHd as'+ tryAll (zip (map (elab' ina fc) as')+ hds)) (do movelast h delayElab 5 $ do hs <- get_holes@@ -460,16 +463,17 @@ as'' <- doPrune as' case as'' of [x] -> elab' ina fc x- _ -> tryAll (zip (map (elab' ina fc) as'') - (map showHd as'')))+ _ -> do hds <- mapM showHd as''+ tryAll (zip (map (elab' ina fc) as'')+ hds)) where showHd (PApp _ (PRef _ _ (UN l)) [_, _, arg]) | l == txt "Delay" = showHd (getTm arg)- showHd (PApp _ (PRef _ _ n) _) = n- showHd (PRef _ _ n) = n+ showHd (PApp _ (PRef _ _ n) _) = return n+ showHd (PRef _ _ n) = return n showHd (PApp _ h _) = showHd h- showHd x = NErased -- We probably should do something better than this here+ showHd x = getNameFrom (sMN 0 "_") -- We probably should do something better than this here - doPrune as = + doPrune as = do compute ty <- goal let (tc, _) = unApply (unDelay ty)@@ -479,10 +483,9 @@ unDelay t | (P _ (UN l) _, [_, arg]) <- unApply t, l == txt "Lazy'" = unDelay arg | otherwise = t- isAmbiguous (CantResolveAlts _) = delayok- isAmbiguous (Elaborating _ _ e) = isAmbiguous e+ isAmbiguous (Elaborating _ _ _ e) = isAmbiguous e isAmbiguous (ElaboratingArg _ _ _ e) = isAmbiguous e isAmbiguous (At _ e) = isAmbiguous e isAmbiguous _ = False@@ -711,8 +714,9 @@ g <- goal hs <- get_holes if all (\n -> n == tyn || not (n `elem` hs)) (freeNames g)- then try (resolveTC' True False 10 g fn ist)- (movelast n)+ then handleError (tcRecoverable emode)+ (resolveTC' True False 10 g fn ist)+ (movelast n) else movelast n) (ivs' \\ ivs) -- HACK: If the name leaks into its type, it may leak out of@@ -883,7 +887,8 @@ env <- get_env hs <- get_holes if all (\n -> not (n `elem` hs)) (freeNames g)- then try (resolveTC' False False 10 g fn ist)+ then handleError (tcRecoverable emode)+ (resolveTC' False False 10 g fn ist) (movelast n) else movelast n) (ivs' \\ ivs)@@ -1057,7 +1062,7 @@ let args' = filter (\(n, _) -> n `notElem` argsDropped) args attack- cname' <- defer argsDropped (mkN (mkCaseName fn))+ cname' <- defer argsDropped (mkN (mkCaseName fc fn)) solve -- if the scrutinee is one of the 'args' in env, we should@@ -1070,8 +1075,8 @@ -- if we haven't got the type yet, hopefully we'll get it later! movelast tyn solve- where mkCaseName (NS n ns) = NS (mkCaseName n) ns- mkCaseName n = SN (CaseN n)+ where mkCaseName fc (NS n ns) = NS (mkCaseName fc n) ns+ mkCaseName fc n = SN (CaseN (FC' fc) n) -- mkCaseName (UN x) = UN (x ++ "_case") -- mkCaseName (MN i x) = MN i (x ++ "_case") mkN n@(NS _ _) = n@@ -1237,17 +1242,18 @@ elab' ina fc (PRunElab fc' tm ns) = do attack n <- getNameFrom (sMN 0 "tacticScript")- n' <- getNameFrom (sMN 0 "tacticExpr") let scriptTy = RApp (Var (sNS (sUN "Elab") ["Elab", "Reflection", "Language"])) (Var unitTy) claim n scriptTy- movelast n- letbind n' scriptTy (Var n) focus n+ attack -- to get an extra hole elab' ina (Just fc') tm+ script <- get_guess+ fullyElaborated script+ solve -- eliminate the hole. Becuase there are no references, the script is only in the binding env <- get_env- runElabAction ist (maybe fc' id fc) env (P Bound n' Erased) ns+ runElabAction ist (maybe fc' id fc) env script ns solve elab' ina fc (PConstSugar constFC tm) = -- Here we elaborate the contained term, then calculate@@ -1360,6 +1366,19 @@ getFC d (PAlternative _ _ (x:_)) = getFC d x getFC d x = d + -- Fail if a term is not yet fully elaborated (e.g. if it contains+ -- case block functions that don't yet exist)+ fullyElaborated :: Term -> ElabD ()+ fullyElaborated (P _ n _) =+ do EState cases _ _ _ <- getAux+ case lookup n cases of+ Nothing -> return ()+ Just _ -> lift . tfail $ ElabScriptStaging n+ fullyElaborated (Bind n b body) = fullyElaborated body >> for_ b fullyElaborated+ fullyElaborated (App _ l r) = fullyElaborated l >> fullyElaborated r+ fullyElaborated (Proj t _) = fullyElaborated t+ fullyElaborated _ = return ()+ insertLazy :: PTerm -> ElabD PTerm insertLazy t@(PApp _ (PRef _ _ (UN l)) _) | l == txt "Delay" = return t insertLazy t@(PApp _ (PRef _ _ (UN l)) _) | l == txt "Force" = return t@@ -1396,9 +1415,9 @@ notImplicitable _ = False insertScopedImps fc (Bind n (Pi im@(Just i) _ _) sc) xs- | tcinstance i+ | tcinstance i && not (toplevel_imp i) = pimp n (PResolveTC fc) True : insertScopedImps fc sc xs- | otherwise+ | not (toplevel_imp i) = pimp n Placeholder True : insertScopedImps fc sc xs insertScopedImps fc (Bind n (Pi _ _ _) sc) (x : xs) = x : insertScopedImps fc sc xs@@ -1621,7 +1640,7 @@ Nothing -> case lookupTyExact n ctxt of Just _ -> return $ AnnName n Nothing Nothing Nothing Nothing -> lift . tfail . InternalMsg $- "Can't find name" ++ show n+ "Can't find name " ++ show n -- Try again to solve auto implicits solveAuto :: IState -> Name -> Bool -> (Name, [FailContext]) -> ElabD ()@@ -1646,7 +1665,7 @@ cantsolve (CantSolveGoal _ _) = True cantsolve (InternalMsg _) = True cantsolve (At _ e) = cantsolve e- cantsolve (Elaborating _ _ e) = cantsolve e+ cantsolve (Elaborating _ _ _ e) = cantsolve e cantsolve (ElaboratingArg _ _ _ e) = cantsolve e cantsolve _ = False @@ -1655,6 +1674,15 @@ = do autos <- get_autos mapM_ (solveAuto ist fn ambigok) (map (\(n, (fc, _)) -> (n, fc)) autos) +-- Return true if the given error suggests a type class failure is+-- recoverable+tcRecoverable :: ElabMode -> Err -> Bool+tcRecoverable ERHS (CantResolve f g) = f+tcRecoverable ETyDecl (CantResolve f g) = f+tcRecoverable e (ElaboratingArg _ _ _ err) = tcRecoverable e err+tcRecoverable e (At _ err) = tcRecoverable e err+tcRecoverable _ _ = True+ trivial' ist = trivial (elab ist toplevel ERHS [] (sMN 0 "tac")) ist trivialHoles' psn h ist@@ -1785,10 +1813,10 @@ -- step, the output is the (reflected) term returned. runTacTm :: Term -> ElabD Term runTacTm (unApply -> tac@(P _ n _, args))- | n == tacN "prim__Solve", [] <- args+ | n == tacN "Prim__Solve", [] <- args = do solve returnUnit- | n == tacN "prim__Goal", [] <- args+ | n == tacN "Prim__Goal", [] <- args = do hs <- get_holes case hs of (h : _) -> do t <- goal@@ -1798,27 +1826,19 @@ [] -> lift . tfail . Msg $ "Elaboration is complete. There are no goals." - | n == tacN "prim__Holes", [] <- args+ | n == tacN "Prim__Holes", [] <- args = do hs <- get_holes fmap fst . checkClosed $ mkList (Var $ reflm "TTName") (map reflectName hs)- | n == tacN "prim__Guess", [] <- args- = do ok <- is_guess- if ok- then do guess <- fmap forget get_guess- fmap fst . get_type_val $- RApp (RApp (Var (sNS (sUN "Just") ["Maybe", "Prelude"]))- (Var (reflm "TT")))- guess- else fmap fst . checkClosed $- RApp (Var (sNS (sUN "Nothing") ["Maybe", "Prelude"]))- (Var (reflm "TT"))- | n == tacN "prim__LookupTy", [n] <- args+ | n == tacN "Prim__Guess", [] <- args+ = do g <- get_guess+ fmap fst . checkClosed $ reflect g+ | n == tacN "Prim__LookupTy", [n] <- args = do n' <- reifyTTName n ctxt <- get_context- let getNameTypeAndType = \case Function ty _ -> (Ref, ty)- TyDecl nt ty -> (nt, ty)- Operator ty _ _ -> (Ref, ty)+ let getNameTypeAndType = \case Function ty _ -> (Ref, ty)+ TyDecl nt ty -> (nt, ty)+ Operator ty _ _ -> (Ref, ty) CaseOp _ ty _ _ _ _ -> (Ref, ty) -- Idris tuples nest to the right reflectTriple (x, y, z) =@@ -1835,46 +1855,70 @@ , raw_apply (Var pairTy) [ Var (reflm "NameType") , Var (reflm "TT")]]) defs- | n == tacN "prim__LookupDatatype", [name] <- args+ | n == tacN "Prim__LookupDatatype", [name] <- args = do n' <- reifyTTName name datatypes <- get_datatypes ctxt <- get_context fmap fst . checkClosed $ rawList (Var (tacN "Datatype")) (map reflectDatatype (buildDatatypes ist n'))- | n == tacN "prim__SourceLocation", [] <- args+ | n == tacN "Prim__LookupArgs", [name] <- args+ = do n' <- reifyTTName name+ let listTy = Var (sNS (sUN "List") ["List", "Prelude"])+ listFunArg = RApp listTy (Var (tacN "FunArg"))+ -- Idris tuples nest to the right+ let reflectTriple (x, y, z) =+ raw_apply (Var pairCon) [ Var (reflm "TTName")+ , raw_apply (Var pairTy) [listFunArg, Var (reflm "Raw")]+ , x+ , raw_apply (Var pairCon) [listFunArg, Var (reflm "Raw")+ , y, z]]+ let out =+ [ reflectTriple (reflectName fn, reflectList (Var (tacN "FunArg")) (map reflectArg args), reflectRaw res)+ | (fn, pargs) <- lookupCtxtName n' (idris_implicits ist)+ , (args, res) <- getArgs pargs . forget <$>+ maybeToList (lookupTyExact fn (tt_ctxt ist))+ ]++ fmap fst . checkClosed $+ rawList (raw_apply (Var pairTy) [Var (reflm "TTName")+ , raw_apply (Var pairTy) [ RApp listTy+ (Var (tacN "FunArg"))+ , Var (reflm "Raw")]])+ out+ | n == tacN "Prim__SourceLocation", [] <- args = fmap fst . checkClosed $ reflectFC fc- | n == tacN "prim__Namespace", [] <- args+ | n == tacN "Prim__Namespace", [] <- args = fmap fst . checkClosed $ rawList (RConstant StrType) (map (RConstant . Str) ns)- | n == tacN "prim__Env", [] <- args+ | n == tacN "Prim__Env", [] <- args = do env <- get_env fmap fst . checkClosed $ reflectEnv env- | n == tacN "prim__Fail", [_a, errs] <- args+ | n == tacN "Prim__Fail", [_a, errs] <- args = do errs' <- eval errs parts <- reifyReportParts errs' lift . tfail $ ReflectionError [parts] (Msg "")- | n == tacN "prim__PureElab", [_a, tm] <- args+ | n == tacN "Prim__PureElab", [_a, tm] <- args = return tm- | n == tacN "prim__BindElab", [_a, _b, first, andThen] <- args+ | n == tacN "Prim__BindElab", [_a, _b, first, andThen] <- args = do first' <- eval first res <- eval =<< runTacTm first' next <- eval (App Complete andThen res) runTacTm next- | n == tacN "prim__Try", [_a, first, alt] <- args+ | n == tacN "Prim__Try", [_a, first, alt] <- args = do first' <- eval first alt' <- eval alt try' (runTacTm first') (runTacTm alt') True- | n == tacN "prim__Fill", [raw] <- args+ | n == tacN "Prim__Fill", [raw] <- args = do raw' <- reifyRaw =<< eval raw- fill raw'+ apply raw' [] returnUnit- | n == tacN "prim__Apply" || n == tacN "prim__MatchApply"+ | n == tacN "Prim__Apply" || n == tacN "Prim__MatchApply" , [raw, argSpec] <- args = do raw' <- reifyRaw =<< eval raw- argSpec' <- reifyList (reifyPair reifyBool reifyInt) argSpec- let op = if n == tacN "prim__Apply"+ argSpec' <- map (\b -> (b, 0)) <$> reifyList reifyBool argSpec+ let op = if n == tacN "Prim__Apply" then apply else match_apply ns <- op raw' argSpec'@@ -1884,84 +1928,88 @@ (reflectName n1, reflectName n2) | (n1, n2) <- ns ]- | n == tacN "prim__Gensym", [hint] <- args+ | n == tacN "Prim__Gensym", [hint] <- args = do hintStr <- eval hint case hintStr of Constant (Str h) -> do n <- getNameFrom (sMN 0 h) fmap fst $ get_type_val (reflectName n) _ -> fail "no hint"- | n == tacN "prim__Claim", [n, ty] <- args+ | n == tacN "Prim__Claim", [n, ty] <- args = do n' <- reifyTTName n ty' <- reifyRaw ty claim n' ty' returnUnit- | n == tacN "prim__Check", [raw] <- args- = do raw' <- reifyRaw =<< eval raw+ | n == tacN "Prim__Check", [env', raw] <- args+ = do env <- reifyEnv env'+ raw' <- reifyRaw =<< eval raw ctxt <- get_context- env <- get_env (tm, ty) <- lift $ check ctxt env raw' fmap fst . checkClosed $ rawPair (Var (reflm "TT"), Var (reflm "TT")) (reflect tm, reflect ty)- | n == tacN "prim__Forget", [tt] <- args- = do tt' <- reifyTT tt- fmap fst . checkClosed . reflectRaw $ forget tt'- | n == tacN "prim__Attack", [] <- args+ | n == tacN "Prim__Attack", [] <- args = do attack returnUnit- | n == tacN "prim__Rewrite", [rule] <- args+ | n == tacN "Prim__Rewrite", [rule] <- args = do r <- reifyRaw rule rewrite r returnUnit- | n == tacN "prim__Focus", [what] <- args+ | n == tacN "Prim__Focus", [what] <- args = do n' <- reifyTTName what hs <- get_holes if elem n' hs then focus n' >> returnUnit else lift . tfail . Msg $ "The name " ++ show n' ++ " does not denote a hole"- | n == tacN "prim__Unfocus", [what] <- args+ | n == tacN "Prim__Unfocus", [what] <- args = do n' <- reifyTTName what movelast n' returnUnit- | n == tacN "prim__Intro", [mn] <- args+ | n == tacN "Prim__Intro", [mn] <- args = do n <- case fromTTMaybe mn of Nothing -> return Nothing Just name -> fmap Just $ reifyTTName name intro n returnUnit- | n == tacN "prim__Forall", [n, ty] <- args+ | n == tacN "Prim__Forall", [n, ty] <- args = do n' <- reifyTTName n ty' <- reifyRaw ty forall n' Nothing ty' returnUnit- | n == tacN "prim__PatVar", [n] <- args+ | n == tacN "Prim__PatVar", [n] <- args = do n' <- reifyTTName n patvar' n' returnUnit- | n == tacN "prim__PatBind", [n] <- args+ | n == tacN "Prim__PatBind", [n] <- args = do n' <- reifyTTName n patbind n' returnUnit- | n == tacN "prim__LetBind", [n, ty, tm] <- args+ | n == tacN "Prim__LetBind", [n, ty, tm] <- args = do n' <- reifyTTName n ty' <- reifyRaw ty tm' <- reifyRaw tm letbind n' ty' tm' returnUnit- | n == tacN "prim__Compute", [] <- args+ | n == tacN "Prim__Compute", [] <- args = do compute ; returnUnit- | n == tacN "prim__Normalise", [env, tm] <- args+ | n == tacN "Prim__Normalise", [env, tm] <- args = do env' <- reifyEnv env tm' <- reifyTT tm ctxt <- get_context let out = normaliseAll ctxt env' (finalise tm') fmap fst . checkClosed $ reflect out- | n == tacN "prim__Whnf", [tm] <- args+ | n == tacN "Prim__Whnf", [tm] <- args = do tm' <- reifyTT tm ctxt <- get_context fmap fst . checkClosed . reflect $ whnf ctxt tm'- | n == tacN "prim__DeclareType", [decl] <- args+ | n == tacN "Prim__Converts", [env, tm1, tm2] <- args+ = do env' <- reifyEnv env+ tm1' <- reifyTT tm1+ tm2' <- reifyTT tm2+ ctxt <- get_context+ lift $ converts ctxt env' tm1' tm2'+ returnUnit+ | n == tacN "Prim__DeclareType", [decl] <- args = do (RDeclare n args res) <- reifyTyDecl decl ctxt <- get_context let mkPi arg res = RBind (argName arg)@@ -1983,24 +2031,28 @@ set_context ctxt' updateAux $ \e -> e { new_tyDecls = (RTyDeclInstrs n fc (map rFunArgToPArg args) checked) : new_tyDecls e }- aux <- getAux returnUnit- | n == tacN "prim__DefineFunction", [decl] <- args+ | n == tacN "Prim__DefineFunction", [decl] <- args = do defn <- reifyFunDefn decl defineFunction defn returnUnit- | n == tacN "prim__AddInstance", [cls, inst] <- args+ | n == tacN "Prim__AddInstance", [cls, inst] <- args = do className <- reifyTTName cls instName <- reifyTTName inst updateAux $ \e -> e { new_tyDecls = RAddInstance className instName : new_tyDecls e} returnUnit- | n == tacN "prim__ResolveTC", [fn] <- args+ | n == tacN "Prim__IsTCName", [n] <- args+ = do n' <- reifyTTName n+ case lookupCtxtExact n' (idris_classes ist) of+ Just _ -> fmap fst . checkClosed $ Var (sNS (sUN "True") ["Bool", "Prelude"])+ Nothing -> fmap fst . checkClosed $ Var (sNS (sUN "False") ["Bool", "Prelude"])+ | n == tacN "Prim__ResolveTC", [fn] <- args = do g <- goal fn <- reifyTTName fn resolveTC' False True 100 g fn ist returnUnit- | n == tacN "prim__Search", [depth, hints] <- args+ | n == tacN "Prim__Search", [depth, hints] <- args = do d <- eval depth hints' <- eval hints case (d, unList hints') of@@ -2013,7 +2065,7 @@ (Constant (I _), Nothing ) -> lift . tfail . InternalMsg $ "Not a list: " ++ show hints' (_, _) -> lift . tfail . InternalMsg $ "Can't reify int " ++ show d- | n == tacN "prim__RecursiveElab", [goal, script] <- args+ | n == tacN "Prim__RecursiveElab", [goal, script] <- args = do goal' <- reifyRaw goal ctxt <- get_context script <- eval script@@ -2023,22 +2075,28 @@ aux <- getAux datatypes <- get_datatypes env <- get_env- (_, ES (p, aux') _ _) <-++ (ctxt', ES (p, aux') _ _) <- do (ES (current_p, _) _ _) <- get- lift $ runElab aux (runElabAction ist fc [] script ns)- ((newProof recH ctxt datatypes goalTT)- { nextname = nextname current_p})+ lift $ runElab aux+ (do runElabAction ist fc [] script ns+ ctxt' <- get_context+ return ctxt')+ ((newProof recH ctxt datatypes goalTT)+ { nextname = nextname current_p })+ set_context ctxt'+ let tm_out = getProofTerm (pterm p) do (ES (prf, _) s e) <- get let p' = prf { nextname = nextname p } put (ES (p', aux') s e) env' <- get_env- (tm, ty, _) <- lift $ recheck ctxt env (forget tm_out) tm_out+ (tm, ty, _) <- lift $ recheck ctxt' env (forget tm_out) tm_out let (tm', ty') = (reflect tm, reflect ty) fmap fst . checkClosed $ rawPair (Var $ reflm "TT", Var $ reflm "TT") (tm', ty')- | n == tacN "prim__Metavar", [n] <- args+ | n == tacN "Prim__Metavar", [n] <- args = do n' <- reifyTTName n ctxt <- get_context ptm <- get_term@@ -2049,7 +2107,7 @@ defer unique_used mvn solve returnUnit- | n == tacN "prim__Fixity", [op'] <- args+ | n == tacN "Prim__Fixity", [op'] <- args = do opTm <- eval op' case opTm of Constant (Str op) -> @@ -2063,7 +2121,7 @@ [f] -> fmap fst . checkClosed $ reflectFixity f many -> lift . tfail . InternalMsg $ "Ambiguous fixity for '" ++ op ++ "'! Found " ++ show many _ -> lift . tfail . Msg $ "Not a constant string for an operator name: " ++ show opTm- | n == tacN "prim__Debug", [ty, msg] <- args+ | n == tacN "Prim__Debug", [ty, msg] <- args = do msg' <- eval msg parts <- reifyReportParts msg debugElaborator parts@@ -2342,9 +2400,9 @@ handle e@(At fc err) = do logLvl 3 "Reflecting body of At" err' <- handle err return (At fc err')- handle e@(Elaborating what n err) = do logLvl 3 "Reflecting body of Elaborating"- err' <- handle err- return (Elaborating what n err')+ handle e@(Elaborating what n ty err) = do logLvl 3 "Reflecting body of Elaborating"+ err' <- handle err+ return (Elaborating what n ty err') handle e@(ElaboratingArg f a prev err) = do logLvl 3 "Reflecting body of ElaboratingArg" hs <- getFnHandlers f a err' <- if null hs@@ -2486,7 +2544,8 @@ let fc = fileFC "elab_reflected_totality" let tcgen = False -- TODO: later we may support dictionary generation case elaborate ctxt (idris_datatypes ist) (sMN 0 "refPatLHS") infP initEState- (erun fc (buildTC ist info ELHS [] fname (infTerm lhs))) of+ (erun fc (buildTC ist info ELHS [] fname (allNamesIn lhs_in)+ (infTerm lhs))) of OK (ElabResult lhs' _ _ _ _ _, _) -> do -- not recursively calling here, because we don't -- want to run infinitely many times
src/Idris/Elab/Transform.hs view
@@ -57,7 +57,7 @@ (ElabResult lhs' dlhs [] ctxt' newDecls highlights, _) <- tclift $ elaborate ctxt (idris_datatypes i) (sMN 0 "transLHS") infP initEState (erun fc (buildTC i info ETransLHS [] (sUN "transform")- (infTerm lhs)))+ (allNamesIn lhs_in) (infTerm lhs))) setContext ctxt' processTacticDecls info newDecls sendHighlighting highlights
src/Idris/Elab/Type.hs view
@@ -69,7 +69,7 @@ (ElabResult tyT' defer is ctxt' newDecls highlights, log) <- tclift $ elaborate ctxt (idris_datatypes i) n (TType (UVal 0)) initEState- (errAt "type of " n (erun fc (build i info ETyDecl [] n ty)))+ (errAt "type of " n Nothing (erun fc (build i info ETyDecl [] n ty))) setContext ctxt' processTacticDecls info newDecls sendHighlighting highlights@@ -144,12 +144,13 @@ let nty' = normalise ctxt [] nty logLvl 2 $ "Rechecked to " ++ show nty' - -- Add normalised type to internals+ -- Add function name to internals (used for making :addclause know+ -- the name unambiguously) i <- getIState rep <- useREPL when rep $ do- addInternalApp (fc_fname fc) (fst . fc_start $ fc) ty' -- (mergeTy ty' (delab i nty')) -- TODO: Should use span instead of line and filename?- addIBC (IBCLineApp (fc_fname fc) (fst . fc_start $ fc) ty') -- (mergeTy ty' (delab i nty')))+ addInternalApp (fc_fname fc) (fst . fc_start $ fc) (PTyped (PRef fc [] n) ty') -- (mergeTy ty' (delab i nty')) -- TODO: Should use span instead of line and filename?+ addIBC (IBCLineApp (fc_fname fc) (fst . fc_start $ fc) (PTyped (PRef fc [] n) ty')) -- (mergeTy ty' (delab i nty'))) let (fam, _) = unApply (getRetTy nty') let corec = case fam of
src/Idris/Elab/Utils.hs view
@@ -6,12 +6,15 @@ import Idris.DeepSeq import Idris.Delaborate import Idris.Docstrings+import Idris.Output import Idris.Core.TT import Idris.Core.Elaborate hiding (Tactic(..)) import Idris.Core.Evaluate import Idris.Core.Typecheck +import Util.Pretty+ import Control.Applicative hiding (Const) import Control.Monad.State import Control.Monad@@ -36,8 +39,20 @@ OK x -> return x logLvl 6 $ "CONSTRAINTS ADDED: " ++ show (tm, ty, cs) when addConstrs $ addConstraints fc cs+ mapM_ (checkDeprecated fc) (allTTNames tm)+ mapM_ (checkDeprecated fc) (allTTNames ty) return (tm, ty) +checkDeprecated :: FC -> Name -> Idris ()+checkDeprecated fc n + = do r <- getDeprecated n+ case r of+ Nothing -> return ()+ Just r -> do iWarn fc $ text "Use of deprecated name " <> annName n+ <> case r of+ "" -> Util.Pretty.empty+ _ -> line <> text r+ iderr :: Name -> Err -> Err iderr _ e = e @@ -51,6 +66,7 @@ checkAddDef add toplvl fc mkerr [] = return [] checkAddDef add toplvl fc mkerr ((n, (i, top, t, psns)) : ns) = do ctxt <- getContext+ logLvl 5 $ "Rechecking deferred name " ++ show (n, t) (t', _) <- recheckC fc (mkerr n) [] t when add $ do addDeferred [(n, (i, top, t, psns, toplvl))] addIBC (IBCDef n)
src/Idris/Elab/Value.hs view
@@ -127,7 +127,8 @@ printtm tm ]) where- runtm t = PApp fc (PRef fc [] (sUN "run__IO")) [pexp t]+ runtm t = PApp fc (PRef fc [] (sUN "run__IO")) + [pimp (sUN "ffi") (PRef fc [] (sUN "FFI_C")) False, pexp t] printtm t = PApp fc (PRef fc [] (sUN "printLn")) [pimp (sUN "ffi") (PRef fc [] (sUN "FFI_C")) False, pexp t]
src/Idris/IBC.hs view
@@ -40,7 +40,7 @@ import Codec.Archive.Zip ibcVersion :: Word16-ibcVersion = 120+ibcVersion = 127 data IBCFile = IBCFile { ver :: Word16, sourcefile :: FilePath,@@ -86,7 +86,8 @@ ibc_parsedSpan :: !(Maybe FC), ibc_usage :: ![(Name, Int)], ibc_exports :: ![Name],- ibc_autohints :: ![(Name, Name)]+ ibc_autohints :: ![(Name, Name)],+ ibc_deprecated :: ![(Name, String)] } deriving Show {-!@@ -94,7 +95,7 @@ !-} initIBC :: IBCFile-initIBC = IBCFile ibcVersion "" [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] Nothing [] [] []+initIBC = IBCFile ibcVersion "" [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] Nothing [] [] [] [] hasValidIBCVersion :: FilePath -> Idris Bool hasValidIBCVersion fp = do@@ -179,7 +180,8 @@ toEntry "ibc_parsedSpan" 0 . encode <$> ibc_parsedSpan i, makeEntry "ibc_usage" (ibc_usage i), makeEntry "ibc_exports" (ibc_exports i),- makeEntry "ibc_autohints" (ibc_autohints i)]+ makeEntry "ibc_autohints" (ibc_autohints i),+ makeEntry "ibc_deprecated" (ibc_deprecated i)] writeArchive :: FilePath -> IBCFile -> Idris () writeArchive fp i = do let a = L.foldl (\x y -> addEntryToArchive y x) emptyArchive (entries i)@@ -305,6 +307,7 @@ ibc i (IBCUsage n) f = return f { ibc_usage = n : ibc_usage f } ibc i (IBCExport n) f = return f { ibc_exports = n : ibc_exports f } ibc i (IBCAutoHint n h) f = return f { ibc_autohints = (n, h) : ibc_autohints f }+ibc i (IBCDeprecate n r) f = return f { ibc_deprecated = (n, r) : ibc_deprecated f } getEntry :: (Binary b, NFData b) => b -> FilePath -> Archive -> Idris b getEntry alt f a = case findEntryByPath f a of@@ -367,6 +370,7 @@ pUsage =<< getEntry [] "ibc_usage" i pExports =<< getEntry [] "ibc_exports" i pAutoHints =<< getEntry [] "ibc_autohints" i+ pDeprecate =<< getEntry [] "ibc_deprecated" i timestampOlder :: FilePath -> FilePath -> Idris () timestampOlder src ibc = do srct <- runIO $ getModificationTime src@@ -393,6 +397,9 @@ pAutoHints :: [(Name, Name)] -> Idris () pAutoHints ns = mapM_ (\(n,h) -> addAutoHint n h) ns++pDeprecate :: [(Name, String)] -> Idris ()+pDeprecate ns = mapM_ (\(n,reason) -> addDeprecated n reason) ns pImportDirs :: [FilePath] -> Idris () pImportDirs fs = mapM_ addImportDir fs
src/Idris/Interactive.hs view
@@ -34,10 +34,10 @@ caseSplitAt :: FilePath -> Bool -> Int -> Name -> Idris () caseSplitAt fn updatefile l n = do src <- runIO $ readSource fn- res <- splitOnLine l n fn+ (ok, res) <- splitOnLine l n fn logLvl 1 (showSep "\n" (map show res)) let (before, (ap : later)) = splitAt (l-1) (lines src)- res' <- replaceSplits ap res+ res' <- replaceSplits ap res (not ok) let new = concat res' if updatefile then do let fb = fn ++ "~" -- make a backup!@@ -47,11 +47,20 @@ iPrintResult new addClauseFrom :: FilePath -> Bool -> Int -> Name -> Idris ()-addClauseFrom fn updatefile l n- = do src <- runIO $ readSource fn+addClauseFrom fn updatefile l n = do+ -- if a definition already exists, add missing cases rather than+ -- adding a new definition.+ ist <- getIState+ cl <- getInternalApp fn l+ let fulln = getAppName cl++ case lookup fulln (idris_metavars ist) of+ Nothing -> addMissing fn updatefile l n+ Just _ -> do+ src <- runIO $ readSource fn let (before, tyline : later) = splitAt (l-1) (lines src) let indent = getIndent 0 (show n) tyline- cl <- getClause l n fn+ cl <- getClause l fulln n fn -- add clause before first blank line in 'later' let (nonblank, rest) = span (not . all isSpace) (tyline:later) if updatefile@@ -62,11 +71,16 @@ unlines rest) runIO $ copyFile fb fn else iPrintResult cl- where- getIndent i n [] = 0- getIndent i n xs | take 9 xs == "instance " = i- getIndent i n xs | take (length n) xs == n = i- getIndent i n (x : xs) = getIndent (i + 1) n xs+ where+ getIndent i n [] = 0+ getIndent i n xs | take 9 xs == "instance " = i+ getIndent i n xs | take (length n) xs == n = i+ getIndent i n (x : xs) = getIndent (i + 1) n xs+ + getAppName (PApp _ r _) = getAppName r+ getAppName (PRef _ _ r) = r+ getAppName (PTyped n _) = getAppName n+ getAppName _ = n addProofClauseFrom :: FilePath -> Bool -> Int -> Name -> Idris () addProofClauseFrom fn updatefile l n@@ -98,16 +112,17 @@ cl <- getInternalApp fn l let n' = getAppName cl - extras <- case lookupCtxt n' (idris_patdefs i) of- [] -> return ""- [(_, tms)] -> do tms' <- nameMissing tms- showNew (show n ++ "_rhs") 1 indent tms'- other -> return "" -- happens if called on a metavar, or with no clauses+ extras <- case lookupCtxtExact n' (idris_patdefs i) of+ Nothing -> return ""+ Just (_, tms) -> do tms' <- nameMissing tms+ showNew (show n ++ "_rhs") 1 indent tms' let (nonblank, rest) = span (not . all isSpace) (tyline:later) if updatefile then do let fb = fn ++ "~" runIO $ writeSource fb (unlines (before ++ nonblank)- ++ extras ++ unlines rest)+ ++ extras ++ + (if null extras then ""+ else "\n" ++ unlines rest)) runIO $ copyFile fb fn else iPrintResult extras where showPat = show . stripNS@@ -121,6 +136,7 @@ getAppName (PApp _ r _) = getAppName r getAppName (PRef _ _ r) = r+ getAppName (PTyped n _) = getAppName n getAppName _ = n makeIndent ind | ".lidr" `isSuffixOf` fn = '>' : ' ' : replicate (ind-2) ' '@@ -131,7 +147,8 @@ rest <- showNew nm i' ind tms return (makeIndent ind ++ showPat tm ++ " = ?" ++ nm' ++- "\n" ++ rest)+ (if null rest then "" else+ "\n" ++ rest)) showNew nm i _ [] = return "" getIndent i n [] = 0
src/Idris/ParseData.hs view
@@ -157,11 +157,21 @@ -} dataOpts :: DataOpts -> IdrisParser DataOpts dataOpts opts- = do reserved "%elim"; dataOpts (DefaultEliminator : DefaultCaseFun : opts)- <|> do reserved "%case"; dataOpts (DefaultCaseFun : opts)+ = do fc <- reservedFC "%elim"+ warnElim fc+ dataOpts (DefaultEliminator : DefaultCaseFun : opts)+ <|> do fc <- reservedFC "%case"+ warnElim fc+ dataOpts (DefaultCaseFun : opts) <|> do reserved "%error_reverse"; dataOpts (DataErrRev : opts) <|> return opts <?> "data options"+ where warnElim fc =+ do ist <- get+ let cmdline = opt_cmdline (idris_options ist)+ unless (NoElimDeprecationWarnings `elem` cmdline) $+ put ist { parserWarnings =+ (fc, Msg "Eliminator generation is deprecated. Use an eliminator generator in a library instead.") : parserWarnings ist } {- | Parses a data type declaration Data ::= DocComment? Accessibility? DataI DefaultEliminator FnName TypeSig ExplicitTypeDataRest?
src/Idris/ParseExpr.hs view
@@ -331,6 +331,14 @@ return (lhs, r) <?> "case option" +warnTacticDeprecation :: FC -> IdrisParser ()+warnTacticDeprecation fc =+ do ist <- get+ let cmdline = opt_cmdline (idris_options ist)+ unless (NoOldTacticDeprecationWarnings `elem` cmdline) $+ put ist { parserWarnings =+ (fc, Msg "This style of tactic proof is deprecated. See %runElab for the replacement.") : parserWarnings ist }+ {- | Parses a proof block @ ProofExpr ::=@@ -342,6 +350,7 @@ proofExpr syn = do kw <- reservedFC "proof" ts <- indentedBlock1 (tactic syn) highlightP kw AnnKeyword+ warnTacticDeprecation kw return $ PProof ts <?> "proof block" @@ -356,6 +365,7 @@ tacticsExpr syn = do kw <- reservedFC "tactics" ts <- indentedBlock1 (tactic syn) highlightP kw AnnKeyword+ warnTacticDeprecation kw return $ PTactics ts <?> "tactics block" @@ -1041,10 +1051,10 @@ sc <- expr syn let (im,cl) = if implicitAllowed syn- then (Imp opts st False Nothing,+ then (Imp opts st False (Just (Impl False True)), constraint)- else (Imp opts st False (Just (Impl False)),- Imp opts st False (Just (Impl True)))+ else (Imp opts st False (Just (Impl False False)),+ Imp opts st False (Just (Impl True False))) return (bindList (PPi im) xt (bindList (PPi cl) cs sc))
src/Idris/ParseHelpers.hs view
@@ -100,7 +100,8 @@ mapM_ (uncurry iWarn) (map (\ (fc, err) -> (fc, pprintErr ist err)) . reverse .- nub $+ nubBy (\(fc, err) (fc', err') ->+ FC' fc == FC' fc' && err == err') $ parserWarnings ist) clearParserWarnings
src/Idris/Parser.hs view
@@ -153,7 +153,7 @@ prog :: SyntaxInfo -> IdrisParser [PDecl] prog syn = do whiteSpace decls <- many (decl syn)- let c = (concat decls)+ let c = concat decls case maxline syn of Nothing -> do notOpenBraces; eof _ -> return ()@@ -191,17 +191,27 @@ internalDecl :: SyntaxInfo -> IdrisParser [PDecl] internalDecl syn = do fc <- getFC- -- if we're after maxline, stop here+ -- if we're after maxline, stop at the next type declaration+ -- (so we get all cases of a definition to preserve totality+ -- results, in particular). let continue = case maxline syn of Nothing -> True Just l -> if fst (fc_end fc) > l then mut_nesting syn /= 0 else True- if continue then do notEndBlock- declBody- else fail "End of readable input"- where declBody :: IdrisParser [PDecl]- declBody = declBody'+ -- What I'd really like to do here is explicitly save the+ -- current state, then if reading ahead finds we've passed+ -- the end of the definition, reset the state. But I've lost+ -- patience with trying to find out how to do that from the+ -- trifecta docs, so this does the job instead.+ if continue then + do notEndBlock+ declBody continue+ else try (do notEndBlock+ declBody continue)+ <|> fail "End of readable input"+ where declBody :: Bool -> IdrisParser [PDecl]+ declBody b = declBody' b <|> using_ syn <|> params syn <|> mutual syn@@ -214,12 +224,18 @@ <|> transform syn <|> do import_; fail "imports must be at top of file" <?> "declaration"- declBody' :: IdrisParser [PDecl]- declBody' = do d <- decl' syn- i <- get- let d' = fmap (debindApp syn . (desugar syn i)) d- return [d']+ declBody' :: Bool -> IdrisParser [PDecl]+ declBody' cont = do d <- decl' syn+ i <- get+ let d' = fmap (debindApp syn . (desugar syn i)) d+ if continue cont d'+ then return [d']+ else fail "End of readable input" + -- Keep going while we're still parsing clauses+ continue False (PClauses _ _ _ _) = True+ continue c _ = c+ {- | Parses a top-level declaration with possible syntax sugar @@@ -1307,6 +1323,10 @@ return [PDirective (DErrorHandlers fn nfc arg afc ns) ] <|> do try (lchar '%' *> reserved "language"); ext <- pLangExt; return [PDirective (DLanguage ext)]+ <|> do try (lchar '%' *> reserved "deprecate")+ n <- fst <$> fnName+ alt <- option "" (fst <$> stringLiteral)+ return [PDirective (DDeprecate n alt)] <|> do fc <- getFC try (lchar '%' *> reserved "used") fn <- fst <$> fnName
src/Idris/ProofSearch.hs view
@@ -178,7 +178,7 @@ cantsolve (CantSolveGoal _ _) = True cantsolve (IncompleteTerm _) = True cantsolve (At _ e) = cantsolve e- cantsolve (Elaborating _ _ e) = cantsolve e+ cantsolve (Elaborating _ _ _ e) = cantsolve e cantsolve (ElaboratingArg _ _ _ e) = cantsolve e cantsolve err = False @@ -196,7 +196,7 @@ Nothing -> -- local variable, go for it return True TType _ -> return True- _ -> fail "Not a data type"+ _ -> typeNotSearchable ty conReady :: [Term] -> Name -> ElabD Bool conReady as n @@ -282,8 +282,8 @@ -- since that's part of the point...) $ checkConstructor ist others tryCons d locs tys (others ++ getFn d fn)- Nothing -> fail "Not a data type"- _ -> fail "Not a data type"+ Nothing -> typeNotSearchable t+ _ -> typeNotSearchable t -- if there are local variables which have a function type, try -- applying them too@@ -326,12 +326,21 @@ let newhs = filter (\ (x, y) -> not x) (zip (map fst imps) args) mapM_ (\ (_, h) -> do focus h aty <- goal- psRec True d locs tys) newhs + psRec True d locs tys) newhs solve isImp (PImp p _ _ _ _) = (True, p)- isImp arg = (False, priority arg) + isImp arg = (False, priority arg) + typeNotSearchable ty =+ lift $ tfail $ FancyMsg $+ [TextPart "Attempted to find an element of type",+ TermPart ty,+ TextPart "using proof search, but proof search only works on datatypes with constructors."] +++ case ty of+ (Bind _ (Pi _ _ _) _) -> [TextPart "In particular, function types are not supported."]+ _ -> []+ -- In interactive mode, only search for things if there is some -- index to help pick a relevant constructor checkConstructor :: IState -> [Name] -> ElabD ()@@ -453,9 +462,7 @@ boundVar (P Bound _ _) = True boundVar _ = False - blunderbuss t d stk [] = do -- c <- get_env- -- ps <- get_probs- lift $ tfail $ CantResolve False topg+ blunderbuss t d stk [] = lift $ tfail $ CantResolve False topg blunderbuss t d stk (n:ns) | n /= fn -- && (n `elem` stk) = tryCatch (resolve n d)
src/Idris/Prover.hs view
@@ -1,3 +1,4 @@+ {-# LANGUAGE PatternGuards #-} module Idris.Prover (prover, showProof, showRunElab) where @@ -5,7 +6,7 @@ -- This exludes (<$>) as fmap, because wl-pprint uses it for newline import Prelude (Eq(..), Show(..), Bool(..), Either(..), Maybe(..), String,- (.), ($), (++), (||),+ (.), ($), (++), (||), (&&), concatMap, id, elem, error, fst, flip, foldl, foldr, init, length, lines, map, not, null, repeat, reverse, tail, zip) @@ -89,7 +90,10 @@ (tm, prf) <- if mode then elabloop n True ("-" ++ show n) [] (ES (ps, initEState) "" Nothing) [] Nothing []- else ploop n True ("-" ++ show n) [] (ES (ps, initEState) "" Nothing) Nothing+ else do iputStrLn $ "Warning: this interactive prover is deprecated and will be removed " +++ "in a future release. Please see :elab for a similar feature that "+++ "will replace it."+ ploop n True ("-" ++ show n) [] (ES (ps, initEState) "" Nothing) Nothing logLvl 1 $ "Adding " ++ show tm i <- getIState let shower = if mode@@ -145,16 +149,16 @@ return (res, ctxt) ((_,_,_,_,e,_,_):_) -> lift $ Error e -dumpState :: IState -> [(Name, Type, Term)] -> ProofState -> Idris ()-dumpState ist menv ps | [] <- holes ps =+dumpState :: IState -> Bool -> [(Name, Type, Term)] -> ProofState -> Idris ()+dumpState ist inElab menv ps | [] <- holes ps = do let nm = thname ps rendered <- iRender $ prettyName True False [] nm <> colon <+> text "No more goals." iputGoal rendered-dumpState ist menv ps | (h : hs) <- holes ps = do+dumpState ist inElab menv ps | (h : hs) <- holes ps = do let OK ty = goalAtFocus ps let OK env = envAtFocus ps let state = prettyOtherGoals hs <> line <>- prettyAssumptions ty env <> line <>+ prettyAssumptions inElab ty env <> line <> prettyMetaValues (reverse menv) <> prettyGoal (zip (assumptionNames env) (repeat False)) ty rendered <- iRender state@@ -172,18 +176,18 @@ assumptionNames :: Env -> [Name] assumptionNames = map fst - prettyPs :: Binder Type -> [(Name, Bool)] -> Env -> Doc OutputAnnotation- prettyPs g bnd [] = empty- prettyPs g bnd ((n@(MN _ r), _) : bs)- | r == txt "rewrite_rule" = prettyPs g ((n, False):bnd) bs- prettyPs g bnd ((n@(MN _ _), _) : bs)- | not (n `elem` freeEnvNames bs || n `elem` goalNames g) = prettyPs g bnd bs- prettyPs g bnd ((n, Let t v) : bs) =+ prettyPs :: Bool -> Binder Type -> [(Name, Bool)] -> Env -> Doc OutputAnnotation+ prettyPs all g bnd [] = empty+ prettyPs all g bnd ((n@(MN _ r), _) : bs)+ | not all && r == txt "rewrite_rule" = prettyPs all g ((n, False):bnd) bs+ prettyPs all g bnd ((n@(MN _ _), _) : bs)+ | not (all || n `elem` freeEnvNames bs || n `elem` goalNames g) = prettyPs all g bnd bs+ prettyPs all g bnd ((n, Let t v) : bs) = line <> bindingOf n False <+> text "=" <+> tPretty bnd v <+> colon <+>- align (tPretty bnd t) <> prettyPs g ((n, False):bnd) bs- prettyPs g bnd ((n, b) : bs) =+ align (tPretty bnd t) <> prettyPs all g ((n, False):bnd) bs+ prettyPs all g bnd ((n, b) : bs) = line <> bindingOf n False <+> colon <+>- align (tPretty bnd (binderTy b)) <> prettyPs g ((n, False):bnd) bs+ align (tPretty bnd (binderTy b)) <> prettyPs all g ((n, False):bnd) bs prettyMetaValues [] = empty prettyMetaValues mvs =@@ -210,12 +214,12 @@ text "---------- Goal: ----------" <$$> bindingOf h False <+> colon <+> align (prettyG bnd ty) - prettyAssumptions g env =+ prettyAssumptions inElab g env = if length env == 0 then empty else text "---------- Assumptions: ----------" <>- nest nestingSize (prettyPs g [] $ reverse env)+ nest nestingSize (prettyPs inElab g [] $ reverse env) prettyOtherGoals hs = if length hs == 0 then@@ -273,7 +277,7 @@ elabloop :: Name -> Bool -> String -> [String] -> ElabState EState -> [ElabShellHistory] -> Maybe History -> [(Name, Type, Term)] -> Idris (Term, [String]) elabloop fn d prompt prf e prev h env = do ist <- getIState- when d $ dumpState ist env (proof e)+ when d $ dumpState ist True env (proof e) (x, h') <- case idris_outputmode ist of RawOutput _ ->@@ -390,7 +394,7 @@ ploop fn d prompt prf e h = do i <- getIState let autoSolve = opt_autoSolve (idris_options i)- when d $ dumpState i [] (proof e)+ when d $ dumpState i False [] (proof e) (x, h') <- case idris_outputmode i of RawOutput _ ->
src/Idris/REPL.hs view
@@ -189,11 +189,13 @@ where processNet fn Reload = processNet fn (Load fn Nothing) processNet fn (Load f toline) =- do let ist = orig { idris_options = idris_options i- , idris_colourTheme = idris_colourTheme i- , idris_colourRepl = False- }- putIState ist+ -- The $!! here prevents a space leak on reloading.+ -- This isn't a solution - but it's a temporary stopgap.+ -- See issue #2386+ do putIState $!! orig { idris_options = idris_options i+ , idris_colourTheme = idris_colourTheme i+ , idris_colourRepl = False+ } setErrContext True setOutH h setQuiet True@@ -755,6 +757,9 @@ let args = line ++ [fixName f] runIO $ rawSystem editor args clearErr+ -- The $!! here prevents a space leak on reloading.+ -- This isn't a solution - but it's a temporary stopgap.+ -- See issue #2386 putIState $!! orig { idris_options = idris_options i , idris_colourTheme = idris_colourTheme i }@@ -800,7 +805,11 @@ getIState >>= flip warnDisamb t (tm, ty) <- elabREPL recinfo ERHS t ctxt <- getContext- let tm' = perhapsForce $ normaliseAll ctxt [] tm+ let tm' = perhapsForce $ normaliseBlocking ctxt [] + [sUN "foreign",+ sUN "prim_read",+ sUN "prim_write"]+ tm let ty' = perhapsForce $ normaliseAll ctxt [] ty -- Add value to context, call it "it" updateContext (addCtxtDef (sUN "it") (Function ty' tm'))@@ -808,7 +817,8 @@ logLvl 3 $ "Raw: " ++ show (tm', ty') logLvl 10 $ "Debug: " ++ showEnvDbg [] tm' let tmDoc = pprintDelab ist tm'- tyDoc = pprintDelab ist ty'+ -- errReverse to make type more readable+ tyDoc = pprintDelab ist (errReverse ist ty') iPrintTermWithType tmDoc tyDoc where perhapsForce tm | termSmallerThan 100 tm = force tm | otherwise = tm@@ -937,12 +947,14 @@ putTy :: PPOption -> IState -> Int -> [(Name, Bool)] -> PTerm -> Doc OutputAnnotation putTy ppo ist 0 bnd sc = putGoal ppo ist bnd sc putTy ppo ist i bnd (PPi _ n _ t sc)- = let current = text " " <>- (case n of- MN _ _ -> text "_"- UN nm | ('_':'_':_) <- str nm -> text "_"- _ -> bindingOf n False) <+>- colon <+> align (tPretty bnd ist t) <> line+ = let current = case n of+ MN _ _ -> text ""+ UN nm | ('_':'_':_) <- str nm -> text ""+ _ -> text " " <> + bindingOf n False+ <+> colon + <+> align (tPretty bnd ist t) + <> line in current <> putTy ppo ist (i-1) ((n,False):bnd) sc putTy ppo ist _ bnd sc = putGoal ppo ist ((n,False):bnd) sc@@ -1052,6 +1064,8 @@ when (not (null si)) $ iputStrLn (show si) let di = lookupCtxt n (idris_datatypes i) when (not (null di)) $ iputStrLn (show di)+ let imps = lookupCtxt n (idris_implicits i)+ when (not (null imps)) $ iputStrLn (show imps) let d = lookupDef n (tt_ctxt i) when (not (null d)) $ iputStrLn $ "Definition: " ++ (show (head d)) let cg = lookupCtxtName n (idris_callgraph i)@@ -1182,7 +1196,7 @@ = idrisCatch (do ist <- getIState (m, _) <- elabVal recinfo ERHS (elabExec fc tm)- (tmpn, tmph) <- runIO tempfile+ (tmpn, tmph) <- runIO $ tempfile "" runIO $ hClose tmph t <- codegen -- gcc adds .exe when it builds windows programs@@ -1218,12 +1232,16 @@ process fn (Missing n) = do i <- getIState- let i' = i { idris_options = (idris_options i) { opt_showimp = True } }+ ppOpts <- fmap ppOptionIst getIState case lookupCtxt n (idris_patdefs i) of- [] -> iPrintError $ "Unknown operator " ++ show n- [(_, tms)] ->- iPrintResult (showSep "\n" (map (showTm i') tms))- _ -> iPrintError $ "Ambiguous name"+ [] -> iPrintError $ "Unknown name " ++ show n+ [(_, tms)] ->+ iRenderResult (vsep (map (pprintPTerm ppOpts {ppopt_impl = True}+ []+ []+ (idris_infixes i))+ tms))+ _ -> iPrintError $ "Ambiguous name" process fn (DynamicLink l) = do i <- getIState let importdirs = opt_importdirs (idris_options i)@@ -1502,11 +1520,16 @@ -- For each ifile list, check it and build ibcs in the same clean IState -- so that they don't interfere with each other when checking + importlists <- getImports [] inputs++ logLvl 1 (show (map (\(i,m) -> (i, map import_path m)) importlists))+ let ninputs = zip [1..] inputs ifiles <- mapWhileOK (\(num, input) -> do putIState ist- modTree <- buildTree+ modTree <- buildTree (map snd (take (num-1) ninputs))+ importlists input let ifiles = getModuleFiles modTree logLvl 1 ("MODULE TREE : " ++ show modTree)@@ -1518,7 +1541,6 @@ ninputs inew <- getIState let tidata = idris_tyinfodata inew- let patdefs = idris_patdefs inew -- If it worked, load the whole thing from all the ibcs together case errSpan inew of Nothing ->@@ -1526,9 +1548,6 @@ ibcfiles <- mapM findNewIBC (nub (concat (map snd ifiles))) tryLoad True (mapMaybe id ibcfiles) _ -> return ()- ist <- getIState- putIState $! ist { idris_tyinfodata = tidata,- idris_patdefs = patdefs } exports <- findExports case opt getOutput opts of@@ -1704,6 +1723,7 @@ iputStrLn banner orig <- getIState+ mods <- if idesl then return [] else loadInputs inputs Nothing let efile = case inputs of [] -> ""
src/Idris/REPLParser.hs view
@@ -1,5 +1,5 @@ -module Idris.REPLParser (parseCmd, help, allHelp) where+module Idris.REPLParser (parseCmd, help, allHelp, setOptions) where import System.FilePath ((</>)) import System.Console.ANSI (Color(..))@@ -32,6 +32,16 @@ type CommandTable = [ ( [String], CmdArg, String , String -> P.IdrisParser (Either String Command) ) ] +setOptions :: [(String, Opt)]+setOptions = [("errorcontext", ErrContext),+ ("showimplicits", ShowImpl),+ ("originalerrors", ShowOrigErr),+ ("autosolve", AutoSolve),+ ("nobanner", NoBanner),+ ("warnreach", WarnReach),+ ("evaltypes", EvalTypes),+ ("desugarnats", DesugarNats)]+ help :: [([String], CmdArg, String)] help = (["<expr>"], NoArg, "Evaluate an expression") : [ (map (':' :) names, args, text) | (names, args, text, _) <- parserCommandsForHelp ]@@ -80,7 +90,7 @@ , (["dynamic"], FileArg, "Dynamically load a C library (similar to %dynamic)", cmd_dynamic) , (["dynamic"], NoArg, "List dynamically loaded C libraries", cmd_dynamic) , noArgCmd ["?", "h", "help"] Help "Display this help text"- , optArgCmd ["set"] SetOpt "Set an option (errorcontext, showimplicits)"+ , optArgCmd ["set"] SetOpt $ "Set an option (" ++ optionsList ++ ")" , optArgCmd ["unset"] UnsetOpt "Unset an option" , (["color", "colour"], ColourArg , "Turn REPL colours on or off; set a specific colour"@@ -100,6 +110,7 @@ , "Pretty prints an Idris function in either LaTeX or HTML and for a specified width." , cmd_pprint) ]+ where optionsList = intercalate ", " $ map fst setOptions parserCommands = [ noArgCmd ["u", "universes"] Universes "Display universe constraints"@@ -163,10 +174,9 @@ pCmd = choice [ do c <- cmd names; parser c | (names, _, _, parser) <- parserCommandsForHelp ++ parserCommands ] <|> unrecognized - <|> nop + <|> nop <|> eval where nop = do eof; return (Right NOP)- eval = exprArg Eval "" unrecognized = do P.lchar ':' cmd <- many anyChar@@ -194,16 +204,26 @@ emptyArgs <|> failure +eval :: P.IdrisParser (Either String Command)+eval = do+ t <- P.fullExpr defaultSyntax+ return $ Right (Eval t)+ exprArg :: (PTerm -> Command) -> String -> P.IdrisParser (Either String Command) exprArg cmd name = do let noArg = do eof return $ Left ("Usage is :" ++ name ++ " <expression>") + let justOperator = do+ (op, fc) <- P.operatorFC+ eof+ return $ Right $ cmd (PRef fc [] (sUN op))+ let properArg = do t <- P.fullExpr defaultSyntax return $ Right (cmd t)- try noArg <|> properArg+ try noArg <|> try justOperator <|> properArg @@ -253,14 +273,7 @@ where pOption :: P.IdrisParser Opt- pOption = do discard (P.symbol "errorcontext"); return ErrContext- <|> do discard (P.symbol "showimplicits"); return ShowImpl- <|> do discard (P.symbol "originalerrors"); return ShowOrigErr- <|> do discard (P.symbol "autosolve"); return AutoSolve- <|> do discard (P.symbol "nobanner") ; return NoBanner- <|> do discard (P.symbol "warnreach"); return WarnReach- <|> do discard (P.symbol "evaltypes"); return EvalTypes- <|> do discard (P.symbol "desugarnats"); return DesugarNats+ pOption = foldl (<|>) empty $ map (\(a, b) -> do discard (P.symbol a); return b) setOptions proofArg :: (Bool -> Int -> Name -> Command) -> String -> P.IdrisParser (Either String Command) proofArg cmd name = do
src/Idris/Reflection.hs view
@@ -1,11 +1,13 @@ {-| Code related to Idris's reflection system. This module contains quoters and unquoters along with some supporting datatypes. -}-{-# LANGUAGE PatternGuards #-}+{-# LANGUAGE PatternGuards, CPP #-} {-# OPTIONS_GHC -fwarn-incomplete-patterns -fwarn-unused-imports #-} module Idris.Reflection where +#if __GLASGOW_HASKELL__ < 710 import Control.Applicative ((<$>), (<*>), pure)+#endif import Control.Monad (liftM, liftM2, liftM4) import Control.Monad.State.Strict (lift) import Data.Maybe (catMaybes)@@ -217,8 +219,6 @@ return $ RBind n' b' x' reifyRawApp t [f, x] | t == reflm "RApp" = liftM2 RApp (reifyRaw f) (reifyRaw x)-reifyRawApp t [t']- | t == reflm "RForce" = liftM RForce (reifyRaw t') reifyRawApp t [c] | t == reflm "RConstant" = liftM RConstant (reifyTTConst c) reifyRawApp t args = fail ("Unknown reflection raw term in reifyRawApp: " ++ show (t, args))@@ -257,9 +257,9 @@ reifySN t [n] | t == reflm "MethodN" = MethodN <$> reifyTTName n- reifySN t [n]+ reifySN t [fc, n] | t == reflm "CaseN" =- CaseN <$> reifyTTName n+ CaseN <$> (FC' <$> reifyFC fc) <*> reifyTTName n reifySN t [n] | t == reflm "ElimN" = ElimN <$> reifyTTName n@@ -270,8 +270,6 @@ | t == reflm "MetaN" = MetaN <$> reifyTTName n1 <*> reifyTTName n2 reifySN t args = fail $ "Can't reify special name " ++ show t ++ show args-reifyTTNameApp t []- | t == reflm "NErased" = return NErased reifyTTNameApp t args = fail ("Unknown reflection term name: " ++ show (t, args)) reifyTTNamespace :: Term -> ElabD [String]@@ -310,8 +308,6 @@ | f == reflm "Pi" = liftM2 (Pi Nothing) (reif t) (reif k) reifyTTBinderApp reif f [x, y] | f == reflm "Let" = liftM2 Let (reif x) (reif y)-reifyTTBinderApp reif f [x, y]- | f == reflm "NLet" = liftM2 NLet (reif x) (reif y) reifyTTBinderApp reif f [t] | f == reflm "Hole" = liftM Hole (reif t) reifyTTBinderApp reif f [t]@@ -473,18 +469,15 @@ = do fill $ reflCall "TConst" [reflectConstant c] solve reflectTTQuotePattern unq (Proj t i)- = do t' <- claimTy (sMN 0 "t") (Var (reflm "TT")) ; movelast t'- fill $ reflCall "Proj" [Var t', RConstant (I i)]- solve- focus t'; reflectTTQuotePattern unq t-reflectTTQuotePattern unq (Erased)+ = lift . tfail . InternalMsg $+ "Phase error! The Proj constructor is for optimization only and should not have been reflected during elaboration."+reflectTTQuotePattern unq Erased = do erased <- claimTy (sMN 0 "erased") (Var (reflm "TT")) movelast erased fill $ (Var erased)- solve-reflectTTQuotePattern unq (Impossible)- = do fill $ Var (reflm "Impossible")- solve+reflectTTQuotePattern unq Impossible+ = lift . tfail . InternalMsg $+ "Phase error! The Impossible constructor is for optimization only and should not have been reflected during elaboration." reflectTTQuotePattern unq (TType exp) = do ue <- getNameFrom (sMN 0 "uexp") claim ue (Var (sNS (sUN "TTUExp") ["Reflection", "Language"]))@@ -537,7 +530,6 @@ freeNamesR (RApp f x) = freeNamesR f ++ freeNamesR x freeNamesR RType = [] freeNamesR (RUType _) = []- freeNamesR (RForce r) = freeNamesR r freeNamesR (RConstant _) = [] reflectRawQuotePattern unq (RApp f x) = do fH <- getNameFrom (sMN 0 "f")@@ -560,13 +552,6 @@ fill $ reflCall "RUType" [Var uH] solve focus uH; fill (reflectUniverse univ); solve-reflectRawQuotePattern unq (RForce r) =- do rH <- getNameFrom (sMN 0 "raw")- claim rH (Var (reflm "Raw"))- movelast rH- fill $ reflCall "RForce" [Var rH]- solve- focus rH; reflectRawQuotePattern unq r reflectRawQuotePattern unq (RConstant c) = do cH <- getNameFrom (sMN 0 "const") claim cH (Var (reflm "Constant"))@@ -597,7 +582,7 @@ reflectBinderQuotePattern q ty unq (NLet x y) = do x' <- claimTy (sMN 0 "ty") ty; movelast x' y' <- claimTy (sMN 0 "v") ty; movelast y'- fill $ reflCall "NLet" [ty, Var x', Var y']+ fill $ reflCall "Let" [ty, Var x', Var y'] solve focus x'; q unq x focus y'; q unq y@@ -649,12 +634,13 @@ = reflCall "App" [reflectTTQuote unq f, reflectTTQuote unq x] reflectTTQuote unq (Constant c) = reflCall "TConst" [reflectConstant c]-reflectTTQuote unq (Proj t i)- = reflCall "Proj" [reflectTTQuote unq t, RConstant (I i)]-reflectTTQuote unq (Erased) = Var (reflm "Erased")-reflectTTQuote unq (Impossible) = Var (reflm "Impossible") reflectTTQuote unq (TType exp) = reflCall "TType" [reflectUExp exp] reflectTTQuote unq (UType u) = reflCall "UType" [reflectUniverse u]+reflectTTQuote _ (Proj _ _) =+ error "Phase error! The Proj constructor is for optimization only and should not have been reflected during elaboration."+reflectTTQuote unq Erased = Var (reflm "Erased")+reflectTTQuote _ Impossible =+ error "Phase error! The Impossible constructor is for optimization only and should not have been reflected during elaboration." reflectRawQuote :: [Name] -> Raw -> Raw reflectRawQuote unq (Var n)@@ -667,7 +653,6 @@ reflectRawQuote unq RType = Var (reflm "RType") reflectRawQuote unq (RUType u) = reflCall "RUType" [reflectUniverse u]-reflectRawQuote unq (RForce r) = reflCall "RForce" [reflectRawQuote unq r] reflectRawQuote unq (RConstant cst) = reflCall "RConstant" [reflectConstant cst] reflectNameType :: NameType -> Raw@@ -692,7 +677,6 @@ ] reflectName (MN i n) = reflCall "MN" [RConstant (I i), RConstant (Str (str n))]-reflectName NErased = Var (reflm "NErased") reflectName (SN sn) = raw_apply (Var (reflm "SN")) [reflectSpecialName sn] reflectName (SymRef _) = error "The impossible happened: symbol table ref survived IBC loading" @@ -711,8 +695,8 @@ reflCall "ParentN" [reflectName n, RConstant (Str (T.unpack s))] reflectSpecialName (MethodN n) = reflCall "MethodN" [reflectName n]-reflectSpecialName (CaseN n) =- reflCall "CaseN" [reflectName n]+reflectSpecialName (CaseN fc n) =+ reflCall "CaseN" [reflectFC (unwrapFC fc), reflectName n] reflectSpecialName (ElimN n) = reflCall "ElimN" [reflectName n] reflectSpecialName (InstanceCtorN n) =@@ -754,7 +738,7 @@ reflectBinderQuote q ty unq (Let x y) = reflCall "Let" [Var ty, q unq x, q unq y] reflectBinderQuote q ty unq (NLet x y)- = reflCall "NLet" [Var ty, q unq x, q unq y]+ = reflCall "Let" [Var ty, q unq x, q unq y] reflectBinderQuote q ty unq (Hole t) = reflCall "Hole" [Var ty, q unq t] reflectBinderQuote q ty unq (GHole _ _ t)@@ -916,7 +900,7 @@ raw_apply (Var $ reflErrName "CantResolveAlts") [rawList (Var $ reflm "TTName") (map reflectName ss)] reflectErr (IncompleteTerm t) = raw_apply (Var $ reflErrName "IncompleteTerm") [reflect t]-reflectErr (NoEliminator str t) +reflectErr (NoEliminator str t) = raw_apply (Var $ reflErrName "NoEliminator") [RConstant (Str str), reflect t] reflectErr (UniverseError fc ue old new tys) =@@ -954,6 +938,12 @@ ] where intTy = RConstant (AType (ATInt ITNative)) +reifyFC :: Term -> ElabD FC+reifyFC tm+ | (P (DCon _ _ _) cn _, [Constant (Str fn), st, end]) <- unApply tm+ , cn == reflm "FileLoc" = FC fn <$> reifyPair reifyInt reifyInt st <*> reifyPair reifyInt reifyInt end+ | otherwise = fail $ "Not a source location: " ++ show tm+ fromTTMaybe :: Term -> Maybe Term -- WARNING: Assumes the term has type Maybe a fromTTMaybe (App _ (App _ (P (DCon _ _ _) (NS (UN just) _) _) ty) tm) | just == txt "Just" = Just tm@@ -970,7 +960,7 @@ Right (TextPart msg) reifyReportPart (App _ (P (DCon _ _ _) n _) ttn) | n == reflm "NamePart" =- case runElab initEState (reifyTTName ttn) (initElaborator NErased initContext emptyContext Erased) of+ case runElab initEState (reifyTTName ttn) (initElaborator (sMN 0 "hole") initContext emptyContext Erased) of Error e -> Left . InternalMsg $ "could not reify name term " ++ show ttn ++@@ -978,7 +968,7 @@ OK (n', _)-> Right $ NamePart n' reifyReportPart (App _ (P (DCon _ _ _) n _) tm) | n == reflm "TermPart" =- case runElab initEState (reifyTT tm) (initElaborator NErased initContext emptyContext Erased) of+ case runElab initEState (reifyTT tm) (initElaborator (sMN 0 "hole") initContext emptyContext Erased) of Error e -> Left . InternalMsg $ "could not reify reflected term " ++ show tm ++@@ -986,7 +976,7 @@ OK (tm', _) -> Right $ TermPart tm' reifyReportPart (App _ (P (DCon _ _ _) n _) tm) | n == reflm "RawPart" =- case runElab initEState (reifyRaw tm) (initElaborator NErased initContext emptyContext Erased) of+ case runElab initEState (reifyRaw tm) (initElaborator (sMN 0 "hole") initContext emptyContext Erased) of Error e -> Left . InternalMsg $ "could not reify reflected raw term " ++ show tm ++@@ -1056,6 +1046,12 @@ = raw_apply (Var pairTy) [ (Var $ reflm "TTName") , (RApp (Var $ reflm "Binder") (Var $ reflm "TT")) ]++reflectList :: Raw -> [Raw] -> Raw+reflectList ty [] = RApp (Var (sNS (sUN "Nil") ["List", "Prelude"])) ty+reflectList ty (x:xs) = RApp (RApp (RApp (Var (sNS (sUN "::") ["List", "Prelude"])) ty)+ x)+ (reflectList ty xs) -- | Apply Idris's implicit info to get a signature. The [PArg] should -- come from a lookup in idris_implicits on IState.
src/Pkg/PParser.hs view
@@ -1,8 +1,7 @@-{-# LANGUAGE CPP #-}+{-# LANGUAGE CPP, ConstraintKinds #-} #if !(MIN_VERSION_base(4,8,0)) {-# LANGUAGE OverlappingInstances #-} #endif- module Pkg.PParser where import Text.Trifecta hiding (span, charLiteral, natural, symbol, char, string, whiteSpace)@@ -15,24 +14,25 @@ import Control.Monad.State.Strict import Control.Applicative+import System.FilePath (takeFileName, isValid)+import Data.Maybe (isNothing, fromJust) import Util.System - type PParser = StateT PkgDesc IdrisInnerParser -data PkgDesc = PkgDesc { pkgname :: String,- libdeps :: [String],- objs :: [String],- makefile :: Maybe String,- idris_opts :: [Opt],- sourcedir :: String,- modules :: [Name],- idris_main :: Name,- execout :: Maybe String,- idris_tests :: [Name]- }- deriving Show+data PkgDesc = PkgDesc {+ pkgname :: String+ , libdeps :: [String]+ , objs :: [String]+ , makefile :: Maybe String+ , idris_opts :: [Opt]+ , sourcedir :: String+ , modules :: [Name]+ , idris_main :: Name+ , execout :: Maybe String+ , idris_tests :: [Name]+ } deriving (Show) instance HasLastTokenSpan PParser where getLastTokenSpan = return Nothing@@ -44,29 +44,75 @@ #endif someSpace = many (simpleWhiteSpace <|> singleLineComment <|> multiLineComment) *> pure () -+defaultPkg :: PkgDesc defaultPkg = PkgDesc "" [] [] Nothing [] "" [] (sUN "") Nothing [] parseDesc :: FilePath -> IO PkgDesc-parseDesc fp = do p <- readFile fp- case runparser pPkg defaultPkg fp p of- Failure err -> fail (show err)- Success x -> return x+parseDesc fp = do+ p <- readFile fp+ case runparser pPkg defaultPkg fp p of+ Failure err -> fail (show err)+ Success x -> return x pPkg :: PParser PkgDesc-pPkg = do reserved "package"; p <- fst <$> identifier- st <- get- put (st { pkgname = p })- some pClause- st <- get- eof- return st+pPkg = do+ reserved "package"; p <- fst <$> identifier+ st <- get+ put (st { pkgname = p })+ some pClause+ st <- get+ eof+ return st ++-- | Parses a filename.+-- |+-- | Treated for now as an identifier or a double-quoted string.+filename :: (MonadicParsing m, HasLastTokenSpan m) => m String+filename = (do+ filename <- token $+ -- Treat a double-quoted string as a filename to support spaces.+ -- This also moves away from tying filenames to identifiers, so+ -- it will also accept hyphens+ -- (https://github.com/idris-lang/Idris-dev/issues/2721)+ stringLiteral+ <|>+ -- Through at least version 0.9.19.1, IPKG executable values were+ -- possibly namespaced identifiers, like foo.bar.baz.+ show <$> fst <$> iName []+ case filenameErrorMessage filename of+ Just errorMessage -> fail errorMessage+ Nothing -> return filename)+ <?> "filename"+ where+ -- TODO: Report failing span better! We could lookAhead,+ -- or do something with DeltaParsing?+ filenameErrorMessage :: FilePath -> Maybe String+ filenameErrorMessage path = either Just (const Nothing) $ do+ checkEmpty path+ checkValid path+ checkNoDirectoryComponent path+ where+ checkThat ok message =+ if ok then Right () else Left message++ checkEmpty path =+ checkThat (path /= "") "filename must not be empty"++ checkValid path =+ checkThat (System.FilePath.isValid path)+ "filename must contain only valid characters"++ checkNoDirectoryComponent path =+ checkThat (path == takeFileName path)+ "filename must contain no directory component"++ pClause :: PParser () pClause = do reserved "executable"; lchar '=';- exec <- fst <$> iName []+ exec <- filename st <- get- put (st { execout = Just (show exec) })+ put (st { execout = Just exec }) <|> do reserved "main"; lchar '='; main <- fst <$> iName [] st <- get@@ -79,7 +125,12 @@ opts <- stringLiteral st <- get let args = pureArgParser (words opts)- put (st { idris_opts = args })+ put (st { idris_opts = args ++ idris_opts st })+ <|> do reserved "pkgs"; lchar '=';+ ps <- sepBy1 (fst <$> identifier) (lchar ',')+ st <- get+ let pkgs = pureArgParser $ concatMap (\x -> ["-p", x]) ps+ put (st {idris_opts = pkgs ++ idris_opts st}) <|> do reserved "modules"; lchar '='; ms <- sepBy1 (fst <$> iName []) (lchar ',') st <- get@@ -100,4 +151,3 @@ ts <- sepBy1 (fst <$> iName []) (lchar ',') st <- get put st { idris_tests = idris_tests st ++ ts }-
src/Pkg/Package.hs view
@@ -164,7 +164,7 @@ do m_ist <- inPkgDir pkgdesc $ do make (makefile pkgdesc) -- Get a temporary file to save the tests' source in- (tmpn, tmph) <- tempIdr+ (tmpn, tmph) <- tempfile ".idr" hPutStrLn tmph $ "module Test_______\n" ++ concat ["import " ++ show m ++ "\n"@@ -175,7 +175,7 @@ concat [show t ++ "\n " | t <- idris_tests pkgdesc] hClose tmph- (tmpn', tmph') <- tempfile+ (tmpn', tmph') <- tempfile "" hClose tmph' m_ist <- idris (Filename tmpn : NoREPL : Verbose : Output tmpn' : idris_opts pkgdesc) rawSystem tmpn' []@@ -187,9 +187,6 @@ case errSpan ist of Just _ -> exitWith (ExitFailure 1) _ -> return ()- where tempIdr :: IO (FilePath, Handle)- tempIdr = do dir <- getTemporaryDirectory- openTempFile (normalise dir) "idristests.idr" -- | Install package installPkg :: PkgDesc -> IO ()@@ -214,7 +211,7 @@ testLib warn p f = do d <- getDataDir gcc <- getCC- (tmpf, tmph) <- tempfile+ (tmpf, tmph) <- tempfile "" hClose tmph let libtest = d </> "rts" </> "libtest.c" e <- rawSystem gcc [libtest, "-l" ++ f, "-o", tmpf]
src/Util/System.hs view
@@ -37,9 +37,10 @@ isWindows :: Bool isWindows = os `elem` ["win32", "mingw32", "cygwin32"] -tempfile :: IO (FilePath, Handle)-tempfile = do dir <- getTemporaryDirectory- openTempFile (normalise dir) "idris"+-- | Create a temp file with the extensiom ext (in the format ".xxx")+tempfile :: String -> IO (FilePath, Handle)+tempfile ext = do dir <- getTemporaryDirectory+ openTempFile (normalise dir) $ "idris" ++ ext -- | Read a source file, same as readFile but make sure the encoding is utf-8. readSource :: FilePath -> IO String
test/basic002/expected view
@@ -1,1 +1,5 @@+test006.idr:25:23-28:+This style of tactic proof is deprecated. See %runElab for the replacement.+test006.idr:32:23-28:+This style of tactic proof is deprecated. See %runElab for the replacement. [False, True, False, True, False, True]
test/basic002/run view
@@ -1,4 +1,4 @@ #!/usr/bin/env bash-idris $@ test006.idr -o test006+idris $@ --nocolour --consolewidth 80 test006.idr -o test006 ./test006 rm -f test006 test006.ibc
test/basic002/test006.idr view
@@ -1,21 +1,21 @@ module Main data Parity : Nat -> Type where- even : {n : Nat} -> Parity (n + n)- odd : {n : Nat} -> Parity (S (n + n))+ Even : {n : Nat} -> Parity (n + n)+ Odd : {n : Nat} -> Parity (S (n + n)) parity : (n:Nat) -> Parity n-parity Z = even {n=Z}-parity (S Z) = odd {n=Z}+parity Z = Even {n=Z}+parity (S Z) = Odd {n=Z} parity (S (S k)) with (parity k)- parity (S (S (j + j))) | (even {n = j}) ?= even {n=S j}- parity (S (S (S (j + j)))) | (odd {n = j}) ?= odd {n=S j}+ parity (S (S (j + j))) | (Even {n = j}) ?= Even {n=S j}+ parity (S (S (S (j + j)))) | (Odd {n = j}) ?= Odd {n=S j} natToBin : Nat -> List Bool natToBin Z = Nil natToBin k with (parity k)- natToBin (j + j) | even {n = j} = False :: natToBin j- natToBin (S (j + j)) | odd {n = j} = True :: natToBin j+ natToBin (j + j) | Even {n = j} = False :: natToBin j+ natToBin (S (j + j)) | Odd {n = j} = True :: natToBin j main : IO () main = do printLn (natToBin 42)
test/basic006/expected view
@@ -1,4 +1,7 @@-test020a.idr:16:18:When checking right hand side of foo:+test020a.idr:16:18:+When checking right hand side of foo with expected type+ List a+ When checking an application of function Prelude.List.reverse: Type mismatch between Vect n a (Type of xs)
test/basic009/expected view
@@ -1,5 +1,8 @@ MAIN-PASS-Faulty.idr:7:7:When checking right hand side of fault:+Faulty.idr:7:7:+When checking right hand side of fault with expected type+ num = 0+ Type mismatch between 0 = 0 (Type of Refl) and
test/basic010/Main.idr view
@@ -9,32 +9,32 @@ qib (S (S n)) = qib n * qib (S n) -- An equality whose size reflects the size of numbers.-data equals : Nat -> Nat -> Type where- eqZ : Z `equals` Z- eqS : m `equals` n -> S m `equals` S n+data Equals : Nat -> Nat -> Type where+ EqZ : Z `Equals` Z+ EqS : m `Equals` n -> S m `Equals` S n -eq_refl : {n : Nat} -> n `equals` n-eq_refl {n = Z} = eqZ-eq_refl {n = S n} = eqS eq_refl+eq_refl : {n : Nat} -> n `Equals` n+eq_refl {n = Z} = EqZ+eq_refl {n = S n} = EqS eq_refl -- Here, the proof is very expensive to compute. -- We add a recursive argument to prevent Idris from inlining the function.-f : (r, n : Nat) -> Subset Nat (\k => qib n `equals` qib k)+f : (r, n : Nat) -> Subset Nat (\k => qib n `Equals` qib k) f Z n = Element n eq_refl f (S r) n = f r n -- A (contrived) relation, just to have something to show.-data represents : Nat -> Nat -> Type where- axiom : (n : Nat) -> qib n `represents` n+data Represents : Nat -> Nat -> Type where+ Axiom : (n : Nat) -> qib n `Represents` n -- Here, the witness is very expensive to compute. -- We add a recursive argument to prevent Idris from inlining the function.-g : (r, n : Nat) -> Exists (\k : Nat => k `represents` n)-g Z n = Evidence (qib n) (axiom n)+g : (r, n : Nat) -> Exists (\k : Nat => k `Represents` n)+g Z n = Evidence (qib n) (Axiom n) g (S r) n = g r n -fmt : qib n `represents` n -> String-fmt (axiom n) = "axiom " ++ show n+fmt : qib n `Represents` n -> String+fmt (Axiom n) = "Axiom " ++ show n main : IO () main = do
test/basic010/expected view
@@ -1,3 +1,3 @@-*oink*-10000-axiom 10000+*oink* +10000 +Axiom 10000
+ test/basic016/CycleA.idr view
@@ -0,0 +1,4 @@+module CycleA++import CycleB+
+ test/basic016/CycleB.idr view
@@ -0,0 +1,5 @@+module CycleB++import CycleC++
+ test/basic016/CycleC.idr view
@@ -0,0 +1,4 @@+module CycleC++import CycleA+
+ test/basic016/expected view
@@ -0,0 +1,1 @@+Cycle detected in imports: CycleA.idr -> CycleB -> CycleC -> CycleA -> CycleB
+ test/basic016/run view
@@ -0,0 +1,3 @@+#!/usr/bin/env bash+idris $@ CycleA.idr --consolewidth 80 --nocolour --check+rm -f *.ibc
test/docs003/expected view
@@ -1,12 +1,13 @@ Type class Functor- Functors+ Functors allow a uniform action over a parameterised type. Parameters:- f -- the action of the functor on objects+ f -- a parameterised type Methods: map : Functor f => (m : a -> b) -> f a -> f b- The action of the functor on morphisms+ Apply a function across everything of type 'a' in a+ parameterised type The function is Total Instances:@@ -15,6 +16,7 @@ Functor Stream Functor Provider Functor Binder+ Functor Elab Functor PrimIO Functor Maybe Functor (Either e)
test/dsl001/test001.idr view
@@ -17,13 +17,13 @@ (::) : interpTy a -> Env G -> Env (a :: G) data HasType : (i : Fin n) -> Vect n Ty -> Ty -> Type where- stop : HasType FZ (t :: G) t- pop : HasType k G t -> HasType (FS k) (u :: G) t+ Stop : HasType FZ (t :: G) t+ Pop : HasType k G t -> HasType (FS k) (u :: G) t lookup : HasType i G t -> Env G -> interpTy t- lookup stop (x :: xs) = x- lookup (pop k) (x :: xs) = lookup k xs- lookup stop [] impossible+ lookup Stop (x :: xs) = x+ lookup (Pop k) (x :: xs) = lookup k xs+ lookup Stop [] impossible data Expr : Vect n Ty -> Ty -> Type where Var : HasType i G t -> Expr G t@@ -41,8 +41,8 @@ dsl expr lambda = lam_ variable = Var- index_first = stop- index_next = pop+ index_first = Stop+ index_next = Pop total interp : Env G -> [static] (e : Expr G t) -> interpTy t@@ -67,7 +67,7 @@ -- eDouble = Lam (App (App (Lam (Lam (Op' (+) (Var FZ) (Var (FS FZ))))) (Var FZ)) (Var FZ)) eDouble : Expr G (TyFun TyInt TyInt)- eDouble = expr (\x => App (App eAdd x) (Var stop))+ eDouble = expr (\x => App (App eAdd x) (Var Stop)) -- app : Lazy (Expr G (TyFun a t)) -> Expr G a -> Expr G t -- app = \f, a => App (Force f) a@@ -81,8 +81,8 @@ eProg : Expr G (TyFun TyInt (TyFun TyInt TyInt)) eProg = Lam (Lam- (Bind (App eDouble (Var (pop stop)))- (\x => Bind (App eDouble (Var stop))+ (Bind (App eDouble (Var (Pop Stop)))+ (\x => Bind (App eDouble (Var Stop)) (\y => Bind (App eDouble (Val x)) (\z => App (App eAdd (Val y)) (Val z))))))
test/dsl002/Resimp.idr view
@@ -49,35 +49,35 @@ interpTy (a :-> b) = a -> interpTy b data HasType : Vect n Ty -> Fin n -> Ty -> Type where- stop : HasType (a :: gam) FZ a- pop : HasType gam i b -> HasType (a :: gam) (FS i) b+ Stop : HasType (a :: gam) FZ a+ Pop : HasType gam i b -> HasType (a :: gam) (FS i) b data Env : Vect n Ty -> Type where Nil : Env Nil (::) : interpTy a -> Env gam -> Env (a :: gam) envLookup : HasType gam i a -> Env gam -> interpTy a- envLookup stop (x :: xs) = x- envLookup (pop k) (x :: xs) = envLookup k xs+ envLookup Stop (x :: xs) = x+ envLookup (Pop k) (x :: xs) = envLookup k xs update : (gam : Vect n Ty) -> HasType gam i b -> Ty -> Vect n Ty- update (x :: xs) stop y = y :: xs- update (x :: xs) (pop k) y = x :: update xs k y- update Nil stop _ impossible+ update (x :: xs) Stop y = y :: xs+ update (x :: xs) (Pop k) y = x :: update xs k y+ update Nil Stop _ impossible total envUpdate : (p:HasType gam i a) -> (val:interpTy b) -> Env gam -> Env (update gam p b)- envUpdate stop val (x :: xs) = val :: xs- envUpdate (pop k) val (x :: xs) = x :: envUpdate k val xs- envUpdate stop _ Nil impossible+ envUpdate Stop val (x :: xs) = val :: xs+ envUpdate (Pop k) val (x :: xs) = x :: envUpdate k val xs+ envUpdate Stop _ Nil impossible total envUpdateVal : (p:HasType gam i a) -> (val:b) -> Env gam -> Env (update gam p (Val b))- envUpdateVal stop val (x :: xs) = val :: xs- envUpdateVal (pop k) val (x :: xs) = x :: envUpdateVal k val xs- envUpdateVal stop _ Nil impossible+ envUpdateVal Stop val (x :: xs) = val :: xs+ envUpdateVal (Pop k) val (x :: xs) = x :: envUpdateVal k val xs+ envUpdateVal Stop _ Nil impossible envTail : Env (a :: gam) -> Env gam envTail (x :: xs) = xs@@ -169,8 +169,8 @@ dsl res variable = id let = let_- index_first = stop- index_next = pop+ index_first = Stop+ index_next = Pop syntax RES [x] = {gam:Vect n Ty} -> Res gam gam (R x)
test/dsl002/test014.idr view
@@ -15,16 +15,17 @@ = test >>= (\b => if b then t else e) open : String -> (p:Purpose) -> Creator (Either () (FILE p))-open fn p = ioc (do h <- fopen fn (pstring p)- ifM validFile h- then return (Right (OpenH h))- else return (Left ()))+open fn p = ioc (do Right h <- fopen fn (pstring p)+ | Left err => return (Left ())+ return (Right (OpenH h))) close : FILE p -> Updater () close (OpenH h) = iou (closeFile h) readLine : FILE Reading -> Reader String-readLine (OpenH h) = ior (fread h)+readLine (OpenH h) = ior (do Right str <- fread h+ | return ""+ return str) eof : FILE Reading -> Reader Bool eof (OpenH h) = ior (feof h)
test/effects003/expected view
@@ -1,3 +1,5 @@+hangman.idr:204:8-13:+This style of tactic proof is deprecated. See %runElab for the replacement. ------------ 6 guesses left
test/effects003/hangman.idr view
@@ -107,7 +107,7 @@ HANGMAN : HState -> EFFECT HANGMAN h = MkEff (Hangman h) HangmanRules --- Promote explicit effecst to Eff programs+-- Promote explicit effects to Eff programs guess : Char -> Eff Bool [HANGMAN (Running (S g) (S w))]@@ -223,3 +223,7 @@ main : IO () main = run runGame++-- Local Variables:+-- idris-load-packages: ("effects")+-- End:
test/effects003/run view
@@ -1,4 +1,4 @@ #!/usr/bin/env bash-idris $@ hangman.idr -p effects -o hangman+idris $@ hangman.idr --consolewidth 80 --nocolour -p effects -o hangman ./hangman < input rm -f hangman *.ibc
test/error003/expected view
@@ -1,2 +1,5 @@-ErrorReflection.idr:68:5:When checking right hand side of bad:+ErrorReflection.idr:68:5:+When checking right hand side of bad with expected type+ Tm [] TUnit+ DSL type error: (t(504) => t'(503)) doesn't match ()
test/error004/expected view
@@ -1,6 +1,12 @@-FunErrTest.idr:35:17:When checking right hand side of badCadr1:+FunErrTest.idr:35:17:+When checking right hand side of badCadr1 with expected type+ Int+ When checking argument cons2 to function FunErrTest.cadr: Could not prove that [] has at least two elements.-FunErrTest.idr:38:17:When checking right hand side of badCadr2:+FunErrTest.idr:38:17:+When checking right hand side of badCadr2 with expected type+ Int+ When checking argument cons2 to function FunErrTest.cadr: Could not prove that [] has at least two elements.
test/error005/expected view
@@ -1,21 +1,36 @@-error005.idr:13:1:When checking right hand side of two:+error005.idr:13:1:+When checking right hand side of two with expected type+ Fin 2+ When checking argument prf to function Data.Fin.fromInteger: When using 2 as a literal for a Fin 2 2 is not strictly less than 2-error005.idr:16:1:When checking right hand side of hahaha:+error005.idr:16:1:+When checking right hand side of hahaha with expected type+ Fin n+ When checking argument prf to function Data.Fin.fromInteger: When using 0 as a literal for a Fin n 0 is not strictly less than n-error005.idr:22:1:When checking right hand side of notOk:+error005.idr:22:1:+When checking right hand side of notOk with expected type+ Fin (plus 2 n)+ When checking argument prf to function Data.Fin.fromInteger: When using 2 as a literal for a Fin (S (S n)) 2 is not strictly less than S (S n)-error005.idr:23:24:When checking right hand side of b0rken:+error005.idr:23:24:+When checking right hand side of b0rken with expected type+ Fin 3+ When checking argument prf to function Data.Fin.fromInteger: When using n as a literal for a Fin 3 Could not show that n is less than 3 because n is a bound variable instead of a constant Integer-error005.idr:28:1:When checking right hand side of x:+error005.idr:28:1:+When checking right hand side of x with expected type+ Fin 4+ When checking argument prf to function Data.Fin.fromInteger: When using 5 as a literal for a Fin 4 5 is not strictly less than 4
test/ffi004/test026.idr view
@@ -10,7 +10,8 @@ -- If the file contains "Int", provide Int as a type, otherwise provide Nat fromFile : String -> IO (Provider Type)-fromFile fname = do str <- readFile fname+fromFile fname = do Right str <- readFile fname+ | Left err => return (Provide Void) return (Provide (strToType (trim str))) %provide (T1 : Type) with fromFile "theType"
test/interactive001/expected view
@@ -11,3 +11,9 @@ [] => ?bar_1 (x :: ys) => ?bar_2 +elemVoid1 Here impossible+elemVoid1 (There _) impossible++ Here impossible+ (There _) impossible+
test/interactive001/input view
@@ -4,3 +4,5 @@ :mw 26 isElem2 :cs 31 p :cs 36 xs'+:cs 39 x+:cs 43 case_val
test/interactive001/test032.idr view
@@ -34,3 +34,12 @@ foo : List a -> List a foo xs = case xs of xs' => ?bar++elemVoid1 : elem.Elem x [] -> Void+elemVoid1 x = ?elemVoid1_rhs++elemVoid2 : elem.Elem x [] -> Void+elemVoid2 x = case x of+ case_val => ?elemVoid2_rhs++
+ test/interactive010/expected view
@@ -0,0 +1,22 @@+Prelude.List.(++) : List a -> List a -> List a+Prelude.Strings.(++) : String -> String -> String+Prelude.Classes./ : (__pi_arg : Float) →+ (__pi_arg1 : Float) → Float+Usage is :doc <functionname>+Usage is :wc <functionname>+Usage is :printdef <functionname>+prim__divFloat+Prelude.Classes./++ : Float -> Float -> Float+(input):1:1: error: expected: ":",+ dependent type signature,+ end of input+/<EOF> +^ +(input):1:1: error: expected: ":",+ dependent type signature,+ end of input+++<EOF> +^ +prim__divFloat
+ test/interactive010/input view
@@ -0,0 +1,10 @@+:type +++:core /+:doc ++:wc ++:printdef -+:spec /+:patt /+/++++:whnf /
+ test/interactive010/run view
@@ -0,0 +1,2 @@+#!/usr/bin/env bash+idris --quiet --nobanner --nocolor --consolewidth 80 < input
test/io001/test004.idr view
@@ -8,20 +8,20 @@ False => return () dumpFile : String -> IO ()-dumpFile fn = do { h <- openFile fn Read+dumpFile fn = do { Right h <- openFile fn Read mwhile (do { -- putStrLn "TEST" x <- feof h return (not x) })- (do { l <- fread h+ (do { Right l <- fread h putStr l }) closeFile h } main : IO ()-main = do { h <- openFile "testfile" Write+main = do { Right h <- openFile "testfile" Write fwrite h "Hello!\nWorld!\n...\n3\n4\nLast line\n" closeFile h putStrLn "Reading testfile"- f <- readFile "testfile"+ Right f <- readFile "testfile" putStrLn f putStrLn "---" dumpFile "testfile"
+ test/meta002/AgdaStyleReflection.idr view
@@ -0,0 +1,247 @@+||| Implement an Agda-style reflection system as a DSL inside of+||| Idris's reflected elaboration. Requires handling type class+||| resolution and implicit arguments - some of the same features as+||| the Idris elaborator itself.+module AgdaStyleReflection+++import Language.Reflection.Utils+import Pruviloj++%default total+++||| Function arguments as provided at the application site+record Arg a where+ constructor MkArg+ plicity : Plicity+ argValue : a++instance Functor Arg where+ map f (MkArg plic x) = MkArg plic (f x)++||| Reflected terms, in the tradition of Agda's reflection library+data Term+ = Var Nat (List (Arg Term))+ | Ctor TTName (List (Arg Term))+ | TyCtor TTName (List (Arg Term))+ | Def TTName (List (Arg Term))+ | Lam Term+ | Pi Term Term+ | Constant Const+ | Ty++unApply : Raw -> (Raw, List Raw)+unApply tm = unApply' tm []+ where unApply' : Raw -> List Raw -> (Raw, List Raw)+ unApply' (RApp f x) xs = unApply' f (x::xs)+ unApply' notApp xs = (notApp, xs)++||| Quote a reflected Idris term to a Term in some induced local context+covering+quoteTerm' : List TTName -> Raw -> Elab Term+quoteTerm' env (Var n) =+ case findIndex (==n) env of+ Just i => return (Var i [])+ Nothing =>+ case findIndex (\(n', _) => n == n') !getEnv of+ Just i => return (Var i [])+ Nothing => do [(n', nt, ty)] <- lookupTy n+ | [] => fail [TextPart "No such variable", NamePart n]+ | vs => fail ([TextPart "Can't disambiguate"] +++ map (NamePart . fst) vs)+ case nt of+ Bound => fail [TextPart "Bound variable not found"]+ Ref => pure $ Def n' []+ DCon _ _ => pure $ Ctor n' []+ TCon _ _ => pure $ TyCtor n' []+quoteTerm' env (RBind n (Lam ty) tm) = Lam <$> quoteTerm' (n::env) tm+quoteTerm' env (RBind n (Pi ty kind) tm) = [| Pi (quoteTerm' env ty)+ (quoteTerm' (n::env) tm) |]+quoteTerm' env (RBind n (Let ty val) tm) = fail [TextPart "can't quote let"]+quoteTerm' env (RBind n (Hole ty) tm) = fail [TextPart "can't quote hole"]+quoteTerm' env (RBind n (GHole ty) tm) = fail [TextPart "can't quote deferred hole"]+quoteTerm' env (RBind n (Guess ty val) tm) = fail [TextPart "can't quote guess"]+quoteTerm' env (RBind n (PVar ty) tm) = fail [TextPart "can't quote patvar"]+quoteTerm' env (RBind n (PVTy ty) tm) = fail [TextPart "can't quote pattern type"]+quoteTerm' env (RApp tm tm') =+ do let (f, args) = unApply (RApp tm tm')+ rawArgs <- traverse (quoteTerm' env) args+ case f of+ Var n => doApp n rawArgs+ tm => fail [RawPart tm, TextPart "not normalized first"]++ where+ mkArgs : List Term -> List FunArg -> List (Arg Term)+ mkArgs [] _ = []+ mkArgs tms [] = map (MkArg Explicit) tms+ mkArgs (tm::tms) (ar::ars) = MkArg (plicity ar) tm :: mkArgs tms ars++ doApp : TTName -> List Term -> Elab Term+ doApp fn xs =+ do (fn', nt, ty) <- lookupTyExact fn+ (_, args, res) <- lookupArgsExact fn'+ let rest = mkArgs xs args+ case nt of+ Bound => fail [TextPart "Bound variable illegal here"]+ Ref => pure $ Def fn' rest+ DCon _ _ => pure $ Ctor fn' rest+ TCon _ _ => pure $ TyCtor fn' rest++quoteTerm' env RType = pure Ty+quoteTerm' env (RUType x) = fail [TextPart "Uniqueness not supported here"]+quoteTerm' env (RConstant c) = pure (Constant c)++||| Quote a reflected Idris term to a Term+covering+quoteTerm : Raw -> Elab Term+quoteTerm = quoteTerm' []++||| Attempt to resolve a de Bruijn index in a context+resolveVar : Nat -> Elab TTName+resolveVar k =+ do env <- getEnv+ getVar k (map fst env)++ where getVar : Nat -> List TTName -> Elab TTName+ getVar _ [] = fail [TextPart "Variable out of scope"]+ getVar Z (n :: _ ) = return n -- NB assumes unique names!+ getVar (S k) (_ :: env) = getVar k env++||| Prepare to apply a global by matching its argument plicities to+||| its argument list.+prepareApply : List FunArg -> List (Arg Term) -> Elab (List (Arg (Maybe Term)))+prepareApply [] tms = pure $ map (map Just) tms -- overapplied OK - it may return a function!+prepareApply ars [] = pure [] -- underapplied is ok too+prepareApply (MkFunArg _ _ Constraint _ :: ars) (MkArg Constraint tm :: tms) =+ [| (pure (MkArg Constraint (Just tm))) :: prepareApply ars tms |]+prepareApply (MkFunArg _ _ Constraint _ :: ars) (MkArg plic tm :: tms) =+ [| (pure (MkArg Constraint Nothing)) :: prepareApply ars (MkArg plic tm :: tms) |]+prepareApply (MkFunArg _ _ Implicit _ :: ars) (MkArg Implicit tm :: tms) =+ [| (pure (MkArg Implicit (Just tm))) :: prepareApply ars tms |]+prepareApply (MkFunArg _ _ Implicit _ :: ars) (MkArg plic tm :: tms) =+ [| (pure (MkArg Implicit Nothing)) :: prepareApply ars (MkArg plic tm :: tms) |]+prepareApply (MkFunArg _ _ Explicit _ :: ars) (MkArg Explicit tm :: tms) =+ [| (pure (MkArg Explicit (Just tm))) :: prepareApply ars tms |]+prepareApply (MkFunArg _ _ Explicit _ :: ars) (MkArg plic tm :: tms) =+ fail [TextPart "Expected explicit argument, got something else!"]++||| Should this argument be solved by unification?+toSolve : Arg (Maybe Term) -> Bool+toSolve (MkArg Explicit _) = False+toSolve (MkArg _ (Just _)) = False+toSolve _ = True++mutual+ covering+ applyGlobal : List TTName -> TTName -> List (Arg Term) -> Elab ()+ applyGlobal locals fn args =+ do (fn', argSpec, _) <- lookupArgsExact fn+ todo <- prepareApply argSpec args+ hs <- apply (Var fn') (map toSolve todo)+ solve+ for_ {b=()} (zip todo hs) $ \(MkArg p tm, h) =>+ case p of+ Constraint => ignore $ inHole h (resolveTC `{applyGlobal})+ _ => case tm of+ Nothing => skip+ Just arg => ignore $ inHole h $ spliceTerm' locals arg++ covering+ spliceTerm' : List TTName -> Term -> Elab ()+ spliceTerm' locals (Var k xs) =+ do n <- resolveVar k+ -- local bindings can't have non-explicit args, so just do a normal application+ hs <- apply (Var n) (map (const True) xs)+ solve+ for_ {b = ()} (zip hs xs) $ \(h, MkArg _ x) =>+ ignore $ inHole h (spliceTerm' locals x)+ spliceTerm' locals (Ctor n xs) = applyGlobal locals n xs+ spliceTerm' locals (TyCtor n xs) = applyGlobal locals n xs+ spliceTerm' locals (Def n xs) = applyGlobal locals n xs+ spliceTerm' locals (Lam body) =+ do x <- gensym "x"+ attack+ intro x+ spliceTerm' (x::locals) body+ solve+ spliceTerm' locals (Pi ty body) =+ do arg <- gensym "arg"+ claim arg `(Type)+ x <- gensym "x"+ attack+ forall x (Var arg)+ focus arg; spliceTerm' locals ty+ spliceTerm' (x::locals) body+ solve+ spliceTerm' locals (Constant c) =+ do fill (quote c); solve+ spliceTerm' locals Ty =+ do fill `(Type); solve++covering+spliceTerm : Term -> Elab ()+spliceTerm = spliceTerm' []++||| Lift an Agda-style tactic into an Idris-style tactic+covering+quoteGoalImpl : (Term -> Term) -> Elab ()+quoteGoalImpl f = do compute+ g <- goalType >>= quoteTerm+ spliceTerm (f g)++syntax "quoteGoal" {x} "in" [expr] = %runElab (quoteGoalImpl (\x => expr))++syntax "tactic" [expr] = %runElab (quoteGoalImpl expr)++++++||| A simple proof search tactic with failure+|||+||| @ goal the type to fill out with search+covering+trivial' : (goal : Term) -> Maybe Term+trivial' (TyCtor `{Nat} []) = pure $ Ctor `{Z} []+trivial' (TyCtor `{Unit} []) = pure $ Ctor `{MkUnit} []+trivial' (TyCtor `{Pair} [MkArg Explicit a, MkArg Explicit b]) =+ pure $+ Ctor `{MkPair}+ [ MkArg Explicit !(trivial' a)+ , MkArg Explicit !(trivial' b)+ ]+trivial' (TyCtor `{Either} [MkArg Explicit a, MkArg Explicit b]) =+ (left <$> trivial' a) <|> (right <$> trivial' b)+ where left : Term -> Term+ left x = Ctor `{Left} [MkArg Explicit x]+ right : Term -> Term+ right x = Ctor `{Right} [MkArg Explicit x]+trivial' (Pi _ body) = Lam <$> trivial' body+trivial' _ = empty++||| Attempt proof search, or fake an error message if it fails.+perhaps : Maybe Term -> Term+perhaps = maybe (Ctor (UN "PROOF SEARCH FAILURE") []) id++||| A simple proof search tactic+|||+||| @ goal the type to fill out with search+covering+trivial : (goal : Term) -> Term+trivial = perhaps . trivial'++foo : (Nat, (), Nat, Either (() -> ()) Void)+foo = quoteGoal x in trivial x++bar : (Nat, (), Either Void Nat, Nat -> ())+bar = tactic trivial++-- When checking right hand side of baz:+-- PROOF SEARCH FAILURE is not defined.+baz : (Nat, Void)+baz = tactic trivial++-- Local Variables:+-- idris-load-packages: ("pruviloj")+-- End:
+ test/meta002/Deriving.idr view
@@ -0,0 +1,31 @@+||| Test some deriving features+module Deriving++import Pruviloj+import Pruviloj.Derive.DecEq++data Vect : Nat -> Type -> Type where+ Nil : Vect Z a+ (::) : a -> Vect n a -> Vect (S n) a++total+decVectEq : DecEq a => (xs, ys : Vect n a) -> Dec (xs = ys)+%runElab (deriveDecEq `{decVectEq})++instance DecEq a => DecEq (Vect n a) where+ decEq xs ys = decVectEq xs ys++forgetProof : Dec a -> Bool+forgetProof (Yes _) = True+forgetProof (No _) = False++test1 : (xs, ys : Vect n Nat) -> Bool+test1 xs ys with (decEq xs ys)+ test1 xs xs | Yes Refl = True+ test1 xs ys | No _ = False++++-- Local Variables:+-- idris-load-packages: ("pruviloj")+-- End:
test/meta002/Tacs.idr view
@@ -11,9 +11,10 @@ import Language.Reflection import Language.Reflection.Errors-import Language.Reflection.Elab import Language.Reflection.Utils +import Pruviloj.Core+ %default total -- Tactics can now query the elaborator and bind variables@@ -33,7 +34,9 @@ solve) -+%runElab (do n <- isTCName `{Nat}+ s <- isTCName `{Show}+ if n || not s then fail [TextPart "nope"] else return ()) -- Note that <|> is equivalent to "try" in the old tactics. -- In these tactics, we use ordinary do notation and ordinary documentation strings!@@ -52,6 +55,7 @@ test2 : Nat test2 = %runElab triv +partial obvious : Elab () obvious = do g <- goalType case g of@@ -119,8 +123,12 @@ unfocus holeName return holeName - foo : %runElab (elabTy $ ARR (ARR UNIT UNIT) (ARR UNIT UNIT))- foo = id+ -- FIXME: Removing the let-bound Elab script showed a deficiency in+ -- how accessible arguments are identified in type signatures. It+ -- would be nice if this worked without the extraneous+ -- `let`. (perhaps a flag on Pi that says it came from the parser?)+ someDef : let x = () in %runElab ((elabTy $ ARR (ARR UNIT UNIT) (ARR UNIT UNIT)))+ someDef = id namespace Untyped ||| Completely untyped terms
test/meta002/expected view
@@ -1,3 +1,10 @@-Tacs.idr:290:15:-When checking right hand side of testElab3:+Tacs.idr:298:15:+When checking right hand side of testElab3 with expected type+ Sigma Ty (Tm [])+ Unifying ty and ARR ty t would lead to infinite value+AgdaStyleReflection.idr:243:5:+When checking right hand side of baz with expected type+ (Nat, Void)++PROOF SEARCH FAILURE is not defined.
test/meta002/run view
@@ -1,3 +1,5 @@ #!/usr/bin/env bash-idris $@ --nocolour --check --consolewidth 70 Tacs.idr+idris $@ -p pruviloj --nocolour --check --consolewidth 70 Tacs.idr+idris $@ -p pruviloj --nocolour --check --consolewidth 70 AgdaStyleReflection.idr+idris $@ -p pruviloj --nocolour --check --consolewidth 70 Deriving.idr rm -f *.ibc
+ test/pkg001/Main.idr view
@@ -0,0 +1,8 @@+module Main++import Effects+import Effect.State+++main : IO ()+main = putStrLn "CouCou!"
+ test/pkg001/expected view
+ test/pkg001/run view
@@ -0,0 +1,3 @@+#!/usr/bin/env bash+idris $@ --build test.ipkg+rm -f *.ibc
+ test/pkg001/test.ipkg view
@@ -0,0 +1,7 @@+package test++pkgs = effects++opts = "--warnpartial --warnreach --nocolour --quiet --consolewidth 80"++modules = Main
test/proof001/expected view
@@ -0,0 +1,4 @@+test029.idr:29:25-30:+This style of tactic proof is deprecated. See %runElab for the replacement.+test029.idr:36:25-30:+This style of tactic proof is deprecated. See %runElab for the replacement.
test/proof001/run view
@@ -1,3 +1,3 @@ #!/usr/bin/env bash-idris $@ test029.idr --check test029+idris $@ test029.idr --consolewidth 80 --nocolour --check test029 rm -f *.ibc
test/proof002/expected view
@@ -1,5 +1,13 @@+Reflect.idr:173:21-26:+This style of tactic proof is deprecated. See %runElab for the replacement.+Reflect.idr:182:21-26:+This style of tactic proof is deprecated. See %runElab for the replacement.+Reflect.idr:190:15-20:+This style of tactic proof is deprecated. See %runElab for the replacement. test030a.idr:12:26-14:1:-When checking right hand side of testReflect1:+When checking right hand side of testReflect1 with expected type+ ys ++ x :: ys ++ xs = (xs ++ [x]) ++ ys ++ xs+ When checking an application of function Reflect.getJust: Type mismatch between IsJust (Just x1) (Type of ItIsJust)
test/proof003/Parity.idr view
@@ -1,15 +1,15 @@ module Parity data Parity : Nat -> Type where- even : {n : Nat} -> Parity (n + n)- odd : {n : Nat} -> Parity (S (n + n))+ Even : {n : Nat} -> Parity (n + n)+ Odd : {n : Nat} -> Parity (S (n + n)) parity : (n:Nat) -> Parity n-parity Z = even {n=Z}-parity (S Z) = odd {n=Z}+parity Z = Even {n=Z}+parity (S Z) = Odd {n=Z} parity (S (S k)) with (parity k)- parity (S (S (j + j))) | even ?= even {n=S j}- parity (S (S (S (j + j)))) | odd ?= odd {n=S j}+ parity (S (S (j + j))) | Even ?= Even {n=S j}+ parity (S (S (S (j + j)))) | Odd ?= Odd {n=S j} parity_lemma_2 = proof {
test/proof003/expected view
@@ -1,3 +1,15 @@+Parity.idr:15:18-23:+This style of tactic proof is deprecated. See %runElab for the replacement.+Parity.idr:22:18-23:+This style of tactic proof is deprecated. See %runElab for the replacement.+test015.idr:88:15-20:+This style of tactic proof is deprecated. See %runElab for the replacement.+test015.idr:97:16-21:+This style of tactic proof is deprecated. See %runElab for the replacement.+test015.idr:108:20-25:+This style of tactic proof is deprecated. See %runElab for the replacement.+test015.idr:136:20-25:+This style of tactic proof is deprecated. See %runElab for the replacement. 00101010 01011001 010000011
test/proof003/run view
@@ -1,4 +1,4 @@ #!/usr/bin/env bash-idris $@ test015.idr -o test015+idris $@ test015.idr --nocolour --consolewidth 80 -o test015 ./test015 rm -f test015 Parity.ibc test015.ibc
test/proof003/test015.idr view
@@ -4,41 +4,41 @@ import System data Bit : Nat -> Type where- b0 : Bit Z- b1 : Bit (S Z)+ B0 : Bit Z+ B1 : Bit (S Z) instance Show (Bit n) where show = show' where show' : Bit x -> String- show' b0 = "0"- show' b1 = "1"+ show' B0 = "0"+ show' B1 = "1" infixl 5 # data Binary : (width : Nat) -> (value : Nat) -> Type where- zero : Binary Z Z+ Zero : Binary Z Z (#) : Binary w v -> Bit bit -> Binary (S w) (bit + 2 * v) instance Show (Binary w k) where- show zero = ""+ show Zero = "" show (bin # bit) = show bin ++ show bit pad : Binary w n -> Binary (S w) n-pad zero = zero # b0+pad Zero = Zero # B0 pad (num # x) = pad num # x natToBin : (width : Nat) -> (n : Nat) -> Maybe (Binary width n) natToBin Z (S k) = Nothing-natToBin Z Z = Just zero+natToBin Z Z = Just Zero natToBin (S k) Z = do x <- natToBin k Z Just (pad x) natToBin (S w) (S k) with (parity k)- natToBin (S w) (S (plus j j)) | even = do jbin <- natToBin w j- let value = jbin # b1+ natToBin (S w) (S (plus j j)) | Even = do jbin <- natToBin w j+ let value = jbin # B1 ?ntbEven- natToBin (S w) (S (S (plus j j))) | odd = do jbin <- natToBin w (S j)- let value = jbin # b0+ natToBin (S w) (S (S (plus j j))) | Odd = do jbin <- natToBin w (S j)+ let value = jbin # B0 ?ntbOdd testBin : Maybe (Binary 8 42)@@ -49,17 +49,17 @@ addBit : Bit x -> Bit y -> Bit c -> (bX ** (bY ** (Bit bX, Bit bY, c + x + y = bY + 2 * bX)))-addBit b0 b0 b0 = bitpair b0 b0-addBit b0 b0 b1 = bitpair b0 b1-addBit b0 b1 b0 = bitpair b0 b1-addBit b0 b1 b1 = bitpair b1 b0-addBit b1 b0 b0 = bitpair b0 b1-addBit b1 b0 b1 = bitpair b1 b0-addBit b1 b1 b0 = bitpair b1 b0-addBit b1 b1 b1 = bitpair b1 b1+addBit B0 B0 B0 = bitpair B0 B0+addBit B0 B0 B1 = bitpair B0 B1+addBit B0 B1 B0 = bitpair B0 B1+addBit B0 B1 B1 = bitpair B1 B0+addBit B1 B0 B0 = bitpair B0 B1+addBit B1 B0 B1 = bitpair B1 B0+addBit B1 B1 B0 = bitpair B1 B0+addBit B1 B1 B1 = bitpair B1 B1 adc : Binary w x -> Binary w y -> Bit c -> Binary (S w) (c + x + y)-adc zero zero carry ?= zero # carry+adc Zero Zero carry ?= Zero # carry adc (numx # bX) (numy # bY) carry ?= let (bitpair carry0 lsb) = addBit bX bY carry in adc numx numy carry0 # lsb@@ -75,7 +75,7 @@ printLn bin1 let Just bin2 = natToBin 8 89 printLn bin2- printLn (adc bin1 bin2 b0)+ printLn (adc bin1 bin2 B0)
test/proof005/DefaultArgSubstitutionSuccess.idr view
@@ -23,11 +23,11 @@ data SameNats : Type where- same : (n:Nat) -> (m:Nat) ->+ Same : (n:Nat) -> (m:Nat) -> { default (decProof (decEq m n)) same : (m=n) } -> SameNats data DiffNats : Type where- diff : (n:Nat) -> (m:Nat) ->+ Diff : (n:Nat) -> (m:Nat) -> { default (decProof (decEq m n)) same : (m=n) -> Void } -> DiffNats @@ -38,7 +38,7 @@ zszArgsAreDiff = argsAreDiff Z (S Z) sameNatZs : SameNats-sameNatZs = same Z Z+sameNatZs = Same Z Z diffNatsZSZ : DiffNats-diffNatsZSZ = diff Z (S Z)+diffNatsZSZ = Diff Z (S Z)
test/proof006/DefaultArgSubstitutionSyntax.idr view
@@ -30,10 +30,10 @@ data SameNats : Type where- same : (n:Nat) -> (m:Nat) -> {{ same : accept (decEq m n) }} -> SameNats+ Same : (n:Nat) -> (m:Nat) -> {{ same : accept (decEq m n) }} -> SameNats data DiffNats : Type where- diff : (n:Nat) -> (m:Nat) -> {{ diff : reject (decEq m n) }} -> DiffNats+ Diff : (n:Nat) -> (m:Nat) -> {{ diff : reject (decEq m n) }} -> DiffNats zArgsAreSame : ()@@ -43,7 +43,7 @@ zszArgsAreDiff = argsAreDiff Z (S Z) sameNatZs : SameNats-sameNatZs = same Z Z+sameNatZs = Same Z Z diffNatsZSZ : DiffNats-diffNatsZSZ = diff Z (S Z)+diffNatsZSZ = Diff Z (S Z)
test/proof007/expected view
@@ -1,4 +1,6 @@ DefaultArgUnknownName.idr:9:6:-When checking right hand side of test:+When checking right hand side of test with expected type+ ()+ When checking argument arg to function DefaultArgUnknownName.funWithBadDefArg: No such variable sadgjhsag
test/proof008/expected view
@@ -0,0 +1,2 @@+ClaimAndUnfocus.idr:8:27-32:+This style of tactic proof is deprecated. See %runElab for the replacement.
test/proof008/run view
@@ -1,3 +1,3 @@ #!/usr/bin/env bash-idris --check $@ ClaimAndUnfocus.idr+idris --nocolour --consolewidth 80 --check $@ ClaimAndUnfocus.idr rm -f *.ibc
test/proof009/expected view
@@ -1,3 +1,4 @@+Warning: this interactive prover is deprecated and will be removed in a future release. Please see :elab for a similar feature that will replace it. ---------- Goal: ----------
test/proofsearch002/Process.idr view
@@ -119,7 +119,7 @@ Pure : a -> Process a iface hs (const hs) p (const p) Quit : a -> Process a iface hs (const hs) p (const (resetReplied p)) - bind : Process a iface hs hs' p p' -> + Bind : Process a iface hs hs' p p' -> ((x : a) -> Process b iface (hs' x) hs'' (p' x) p'') -> Process b iface hs hs'' p p'' @@ -207,7 +207,7 @@ (>>=) : Process a iface hs hs' p p' -> ((x : a) -> Process b iface (hs' x) hs'' (p' x) p'') -> Process b iface hs hs'' p p''-(>>=) = bind+(>>=) = Bind TrySend : (proc : ProcID iface) -> iface ty -> Process (Maybe ty) iface' @@ -371,7 +371,7 @@ k x' st eval st (Pure x) k = k x st eval st (Quit x) k = k x st-eval st (bind x f) k = eval st x (\x', st' => eval st' (f x') k)+eval st (Bind x f) k = eval st x (\x', st' => eval st' (f x') k) eval st (Fork proc) k = do ptr <- fork (eval (MkEvalState [] [] 1 0) proc (\_, _ => pure ()))
+ test/pruviloj001/expected view
+ test/pruviloj001/pruviloj001.idr view
@@ -0,0 +1,69 @@+-- Demonstrate that partial tactics can produce total programs and+-- that the basic parts of Pruviloj are doing what they should.++import Pruviloj+import Pruviloj.Induction++%default total++||| Try some simplification and rewriting heuristics, then attempt to+||| solve the goal+partial+auto : Elab ()+auto = do compute+ attack+ try $ repeatUntilFail intro'+ hs <- map fst <$> getEnv+ for_ hs $+ \ih => try (rewriteWith (Var ih))+ hypothesis <|> search+ solve++||| Common pattern of proofs by induction.+partial+mush : Elab ()+mush =+ do n <- gensym "j"+ intro n+ try intros+ ignore $ induction (Var n) `andThen` auto++plusAssoc : (j, k, l : Nat) -> plus (plus j k) l = plus j (plus k l)+plusAssoc = %runElab mush++plusZeroR : (k : Nat) -> plus k Z = k+plusZeroR = %runElab mush++plusSRightS : (left : Nat) -> (right : Nat) -> S (left + right) = left + (S right)+plusSRightS = %runElab mush++multOneLNeutral : (right : Nat) -> 1 * right = right+multOneLNeutral = %runElab mush++multOneRNeutral : (left : Nat) -> left * 1 = left+multOneRNeutral = %runElab mush++plusMinusLeftCancel : (left : Nat) -> (right : Nat) -> (right' : Nat) ->+ minus (left + right) (left + right') = minus right right'+plusMinusLeftCancel = %runElab mush++powerOneNeutral : (base : Nat) -> power base 1 = base+powerOneNeutral = %runElab mush++-- this silly tactic is controllable by introducing the non-inductive arg first+mapPreservesLen : (f : a -> b) -> (l : List a) ->+ length (map f l) = length l+mapPreservesLen f = %runElab mush++lenAppend : (left : List a) -> (right : List a) ->+ length (left ++ right) = length left + length right+lenAppend = %runElab mush++appendNilRightId : (l : List a) ->+ l ++ [] = l+appendNilRightId = %runElab mush++-- Local Variables:+-- idris-load-packages: ("pruviloj")+-- End:+
+ test/pruviloj001/run view
@@ -0,0 +1,3 @@+#!/usr/bin/env bash+idris $@ -p pruviloj --check --nocolour --consolewidth 70 pruviloj001.idr+rm -f *.ibc
test/quasiquote003/expected view
@@ -1,2 +1,5 @@-NoInfer.idr:11:5:When checking right hand side of zzz:+NoInfer.idr:11:5:+When checking right hand side of zzz with expected type+ TT+ No such variable k
test/quasiquote004/expected view
@@ -1,3 +1,11 @@+Quasiquote004.idr:39:26-31:+This style of tactic proof is deprecated. See %runElab for the replacement.+Quasiquote004.idr:42:28-33:+This style of tactic proof is deprecated. See %runElab for the replacement.+Quasiquote004.idr:50:27-32:+This style of tactic proof is deprecated. See %runElab for the replacement. Quasiquote004.idr:50:25:-When checking right hand side of Quasiquote004.getMeNat':+When checking right hand side of Quasiquote004.getMeNat' with expected type+ String+ Not a Nat goal
test/quasiquote006/expected view
@@ -1,12 +1,18 @@ quasiquote006.idr:9:3:-When checking right hand side of b:+When checking right hand side of b with expected type+ TTName+ Can't disambiguate name: ForeignEnv.Nil, Prelude.List.Nil quasiquote006.idr:12:3:-When checking right hand side of c:+When checking right hand side of c with expected type+ TTName+ No such variable alsdkjflkj quasiquote006.idr:15:3:-When checking right hand side of d:+When checking right hand side of d with expected type+ TTName+ Can't disambiguate name: ForeignEnv.::, Prelude.List.::, Prelude.Stream.::
test/reg001/reg001.idr view
@@ -3,6 +3,7 @@ import Data.So import Data.Vect+import Data.HVect import Data.Fin import Control.Isomorphism @@ -176,4 +177,8 @@ | True = (_ ** (f a) :: (getProof (mapFilter f p as))) | False = mapFilter f p as -+hVectEx1 : HVect [String, List Nat, Nat, (Nat, Nat)]+hVectEx1 = ["Hello",[1,2,3],42,(0,10)]+ +vecfoo : HVect [String, List Nat, Nat, (Nat, Nat)]+vecfoo = put (S (S Z)) hVectEx1
test/reg006/expected view
@@ -1,2 +1,2 @@ reg006.idr:17:1:-RBTree.lookup is possibly not total due to: RBTree.case block in lookup+RBTree.lookup is possibly not total due to: RBTree.case block in lookup at reg006.idr:19:8
test/reg007/expected view
@@ -1,5 +1,8 @@ reg007.lidr:8:1:A.n is already defined-reg007.lidr:12:11-17:When checking right hand side of hurrah:+reg007.lidr:12:11-17:+When checking right hand side of hurrah with expected type+ 0 = 1+ Type mismatch between n = lala (Type of isSame) and
test/reg017/expected view
@@ -1,1 +1,5 @@+reg017.idr:5:17-24:+This style of tactic proof is deprecated. See %runElab for the replacement.+reg017.idr:8:17-24:+This style of tactic proof is deprecated. See %runElab for the replacement. 4
test/reg017/run view
@@ -1,4 +1,4 @@ #!/usr/bin/env bash-idris $@ reg017.idr -o reg017+idris $@ --nocolour --consolewidth 80 reg017.idr -o reg017 ./reg017 rm -f reg017 *.ibc
test/reg023/expected view
@@ -1,4 +1,7 @@-reg023.idr:7:5:When checking right hand side of bad:+reg023.idr:7:5:+When checking right hand side of bad with expected type+ f Nat+ Type mismatch between Nat (Type of 0) and
test/reg028/expected view
@@ -1,4 +1,6 @@ reg028.idr:5:1: tbad.bad is possibly not total due to: with block in tbad.bad+reg028a.idr:17:14-19:+This style of tactic proof is deprecated. See %runElab for the replacement. reg028a.idr:11:1: tbad.qsort' is possibly not total due to: with block in tbad.qsort'
test/reg035/reg035a.lidr view
@@ -28,26 +28,26 @@ > ) > data Set : Type -> Type where-> setify : (as : List a) -> Set a+> Setify : (as : List a) -> Set a > instance (Eq a) => Eq (Set a) where-> (==) (setify as) (setify bs) = setEq as bs+> (==) (Setify as) (Setify bs) = setEq as bs > postulate reflexive_Set_eqeq : (Eq a) => > (as : Set a) -> > So (as == as) > unwrap : Set a -> List a-> unwrap (setify as) = as+> unwrap (Setify as) = as > union : Set (Set a) -> Set a-> union (setify ss) = setify (concat (map unwrap ss)) +> union (Setify ss) = Setify (concat (map unwrap ss)) > listify : (Eq a) => Set a -> List a > listify = nub . unwrap > arePairwiseDisjoint : (Eq a) => Set (Set a) -> Bool-> arePairwiseDisjoint (setify ss) = +> arePairwiseDisjoint (Setify ss) = > hasNoDuplicates (concat (map listify ss)) > isPartition : (Eq a) => Set (Set a) -> Set a -> Bool
test/reg041/expected view
@@ -1,2 +1,2 @@-?prf : (x : Bool) -> (x1 : Bool) -> El (EQ two x two x1) -> El (EQ two x two x1)+?prf : (x : Bool) -> (x1 : Bool) -> El (EQ Two x Two x1) -> El (EQ Two x Two x1) Z
test/reg041/ott.idr view
@@ -3,40 +3,40 @@ mutual data U : Type where- u : U- zero : U- one : U- two : U- pi : (s : U) -> (t : El s -> U) -> U+ MkU : U+ Zero : U+ One : U+ Two : U+ Pi : (s : U) -> (t : El s -> U) -> U El : U -> Type- El u = U- El zero = Void- El one = ()- El two = Bool- El (pi s t) = (x : El s) -> El (t x)+ El MkU = U+ El Zero = Void+ El One = ()+ El Two = Bool+ El (Pi s t) = (x : El s) -> El (t x) infixr 10 ~> (~>) : U -> U -> U-s ~> t = pi s $ const t+s ~> t = Pi s $ const t syntax "<|" [s] "|>" = El s syntax [x] "==" [y] "in" [s] = EQ s x s y %assert_total EQ : (s : U) -> <| s |> -> (t : U) -> <| t |> -> U-EQ u u u u = one-EQ u zero u zero = one-EQ u one u one = one-EQ u two u two = one-EQ u (pi s t) u (pi s' t') = pi s $ \x => pi s' $ \y => EQ s x s' y ~> EQ u (t x) u (t' y)-EQ zero x zero y = one-EQ one x one y = one-EQ two True two True = one-EQ two False two False = one-EQ (pi s t) f (pi s' t') g = pi s $ \x => pi s' $ \y => EQ s x s' y ~> EQ (t x) (f x) (t' y) (g y)-EQ _ _ _ _ = zero+EQ MkU MkU MkU MkU = One+EQ MkU Zero MkU Zero = One+EQ MkU One MkU One = One+EQ MkU Two MkU Two = One+EQ MkU (Pi s t) MkU (Pi s' t') = Pi s $ \x => Pi s' $ \y => EQ s x s' y ~> EQ MkU (t x) MkU (t' y)+EQ Zero x Zero y = One+EQ One x One y = One+EQ Two True Two True = One+EQ Two False Two False = One+EQ (Pi s t) f (Pi s' t') g = Pi s $ \x => Pi s' $ \y => EQ s x s' y ~> EQ (t x) (f x) (t' y) (g y)+EQ _ _ _ _ = Zero -example : <| (Basics.id == Basics.id in (OTT.two ~> OTT.two)) |>+example : <| (Basics.id == Basics.id in (OTT.Two ~> OTT.Two)) |> example = ?prf
test/reg044/expected view
@@ -1,4 +1,9 @@-reg044.idr:4:4:When checking right hand side of Main.pf:+reg044.idr:4:6-11:+This style of tactic proof is deprecated. See %runElab for the replacement.+reg044.idr:4:4:+When checking right hand side of Main.pf with expected type+ (b : Nat) -> (a : Nat) -> (S a = S b) -> a = b+ Type mismatch between b = b (Type of Refl) and
test/reg046/reg046.idr view
@@ -1,19 +1,19 @@ module test data MyList : (A : Type) -> Type where- nil : (A : Type) -> MyList A- cons : (A : Type) -> A -> MyList A -> MyList A+ MyNil : (A : Type) -> MyList A+ MyCons : (A : Type) -> A -> MyList A -> MyList A elimList : (A : Type) -> (m : MyList A -> Type) ->- (f1 : m (nil A)) ->- (f2 : (a : A) -> (as : MyList A) -> m as -> m (cons A a as)) ->+ (f1 : m (MyNil A)) ->+ (f2 : (a : A) -> (as : MyList A) -> m as -> m (MyCons A a as)) -> (e : MyList A) -> m e-elimList A m f1 f2 (nil A) = f1-elimList A m f1 f2 (cons A a as) = f2 a as (elimList A m f1 f2 as)+elimList A m f1 f2 (MyNil A) = f1+elimList A m f1 f2 (MyCons A a as) = f2 a as (elimList A m f1 f2 as) append : (A : Type) -> (b : MyList A) -> (c : MyList A) -> MyList A append A b c = (elimList A (\ d => MyList A) c- (\ d => \ e => \ f => cons A d f)+ (\ d => \ e => \ f => MyCons A d f) b)
test/reg047/reg047.idr view
@@ -1,7 +1,7 @@ module test data TTSigma : (A : Type) -> (B : A -> Type) -> Type where- sigma : (A : Type) -> (B : A -> Type) -> (a : A) -> B a -> TTSigma A B+ Sigma : (A : Type) -> (B : A -> Type) -> (a : A) -> B a -> TTSigma A B data Nat = Zero | Succ Nat @@ -15,4 +15,4 @@ zzz = IdRefl Nat Zero eep : TTSigma Nat (\ a => Id Nat a Zero)-eep = sigma Nat (\ a => Id Nat a Zero) Zero zzz+eep = Sigma Nat (\ a => Id Nat a Zero) Zero zzz
test/reg047/reg047a.idr view
@@ -1,7 +1,7 @@ module test data TTSigma : (A : Type) -> (B : A -> Type) -> Type where- sigma : (A : Type) -> (B : A -> Type) -> (a : A) -> B a -> TTSigma A B+ Sigma : (A : Type) -> (B : A -> Type) -> (a : A) -> B a -> TTSigma A B data MNat = Zero | Succ MNat @@ -15,10 +15,10 @@ zzzz = IdRefl MNat Zero eep : TTSigma MNat (\ c => Id MNat c Zero)-eep = (sigma MNat (\b => Id MNat b Zero) Zero zzzz)+eep = (Sigma MNat (\b => Id MNat b Zero) Zero zzzz) eep2 : TTSigma MNat (\ c => Id MNat c Zero)-eep2 = (sigma MNat (\b => Id MNat b Zero) Zero (IdRefl MNat Zero))+eep2 = (Sigma MNat (\b => Id MNat b Zero) Zero (IdRefl MNat Zero))
test/reg049/expected view
@@ -1,4 +1,7 @@ reg049.idr:2:9:When checking constructor Main.Bogus: Void is not Main.Foo-reg049.idr:5:6:When checking right hand side of uhOh:+reg049.idr:5:6:+When checking right hand side of uhOh with expected type+ Void+ No such variable Bogus
test/sourceLocation001/expected view
@@ -1,3 +1,11 @@+SourceLoc.idr:11:19-26:+This style of tactic proof is deprecated. See %runElab for the replacement.+SourceLoc.idr:20:19-24:+This style of tactic proof is deprecated. See %runElab for the replacement.+SourceLoc.idr:40:20-27:+This style of tactic proof is deprecated. See %runElab for the replacement.+SourceLoc.idr:98:18-23:+This style of tactic proof is deprecated. See %runElab for the replacement. Testing using definition FileLoc "SourceLoc.idr" (16, 11) (16, 17) Testing using inline tactics
test/sourceLocation001/run view
@@ -1,4 +1,4 @@ #!/usr/bin/env bash-idris $@ SourceLoc.idr -o sourceLocation001+idris $@ --nocolour --consolewidth 80 SourceLoc.idr -o sourceLocation001 ./sourceLocation001 rm -f sourceLocation001 *.ibc
test/syntax001/expected view
@@ -1,10 +1,16 @@-Syntax.idr:6:7-9:1:When checking right hand side of foo:+Syntax.idr:6:7-9:1:+When checking right hand side of foo with expected type+ Nat+ When checking an application of function Prelude.Classes.+: Type mismatch between String (Type of "argh") and Nat (Expected type)-SyntaxTest.idr:5:7-6:1:When checking right hand side of foo:+SyntaxTest.idr:5:7-6:1:+When checking right hand side of foo with expected type+ Nat+ When checking an application of function Prelude.Classes.+: Type mismatch between String (Type of "argh")
test/totality002/expected view
@@ -1,3 +1,5 @@+test017.idr:94:26-31:+This style of tactic proof is deprecated. See %runElab for the replacement. test017a.idr:7:1: scg.vtrans is possibly not total due to recursive path scg.vtrans --> scg.vtrans test017b.idr:4:1:
test/totality002/test017.idr view
@@ -62,14 +62,14 @@ ack (S m) Z = ack m (S Z) ack (S m) (S n) = ack m (ack (S m) n) -data Bin = eps | c0 Bin | c1 Bin+data Bin = EPS | C0 Bin | C1 Bin foo : Bin -> Nat-foo eps = Z-foo (c0 eps) = Z-foo (c0 (c1 x)) = S (foo (c1 x))-foo (c0 (c0 x)) = foo (c0 x)-foo (c1 x) = S (foo x)+foo EPS = Z+foo (C0 EPS) = Z+foo (C0 (C1 x)) = S (foo (C1 x))+foo (C0 (C0 x)) = foo (C0 x)+foo (C1 x) = S (foo x) bar : Nat -> Nat -> Nat bar x y = mp x y where
test/totality003/run view
@@ -1,4 +1,4 @@ #!/usr/bin/env bash-idris --consolewidth 80 $@ totality003.idr --check-idris --consolewidth 80 $@ totality003a.idr --check+idris --nocolour --consolewidth 80 $@ totality003.idr --check+idris --nocolour --consolewidth 80 $@ totality003a.idr --check rm -f *.ibc
test/totality004/totality004.idr view
@@ -3,19 +3,19 @@ %default total data SP : Type -> Type -> Type where- get : (a -> SP a b) -> SP a b- put : b -> Inf (SP a b) -> SP a b+ Get : (a -> SP a b) -> SP a b+ Put : b -> Inf (SP a b) -> SP a b copy : SP a a-copy = get (\x => put x copy)+copy = Get (\x => Put x copy) process : SP a b -> Stream a -> Stream b-process (get f) (x :: xs) = process (f x) xs-process (put b sp) xs = b :: process sp xs+process (Get f) (x :: xs) = process (f x) xs+process (Put b sp) xs = b :: process sp xs doubleInt : SP Nat Int-doubleInt = get (\x => put (the Int (cast x)) - (put (the Int (cast x) * 2) doubleInt))+doubleInt = Get (\x => Put (the Int (cast x)) + (Put (the Int (cast x) * 2) doubleInt)) countStream : Nat -> Stream Nat countStream x = x :: countStream (x + 1)
test/totality004/totality004a.idr view
@@ -3,19 +3,19 @@ %default total data SP : Type -> Type -> Type where- get : (a -> SP a b) -> SP a b- put : b -> Inf (SP a b) -> SP a b+ Get : (a -> SP a b) -> SP a b+ Put : b -> Inf (SP a b) -> SP a b copy : SP a a-copy = get (\x => put x copy)+copy = Get (\x => Put x copy) process : SP a b -> Stream a -> Stream b-process (get f) (x :: xs) = process (f x) xs-process (put b sp) xs = process sp xs+process (Get f) (x :: xs) = process (f x) xs+process (Put b sp) xs = process sp xs doubleInt : SP Nat Int-doubleInt = get (\x => put (the Int (cast x)) - (put (the Int (cast x) * 2) doubleInt))+doubleInt = Get (\x => Put (the Int (cast x)) + (Put (the Int (cast x) * 2) doubleInt)) countStream : Nat -> Stream Nat countStream x = x :: countStream (x + 1)
test/totality008/expected view
@@ -1,2 +1,2 @@ totality008.idr:7:1:-Main.ElimT is possibly not total due to: Main.c2+Main.ElimT is possibly not total due to: Main.C2
test/totality008/totality008.idr view
@@ -1,8 +1,8 @@ data T : Type -> Type where- c1 : T Nat- c2 : T (T Nat)+ C1 : T Nat+ C2 : T (T Nat) total ElimT : (A : Type) -> T A -> A-ElimT _ c1 = 3-ElimT _ c2 = c1+ElimT _ C1 = 3+ElimT _ C2 = C1
test/totality009/expected view
@@ -1,8 +1,8 @@-TestLambdaPossible.idr:9:25:Warning - TestLambdaPossible.case block in wrongPossible is not total as there are missing cases-TestLambdaPossible.idr:9:1:Warning - TestLambdaPossible.wrongPossible is possibly not total due to: TestLambdaPossible.case block in wrongPossible-TestLambdaPossible.idr:12:25:Warning - TestLambdaPossible.case block in wrongPossible' is not total as there are missing cases-TestLambdaPossible.idr:12:1:Warning - TestLambdaPossible.wrongPossible' is possibly not total due to: TestLambdaPossible.case block in wrongPossible'-TestLambdaPossible.idr:9:15:Warning - TestLambdaPossible.case block in wrongPossible is not total as there are missing cases-TestLambdaPossible.idr:9:1:Warning - TestLambdaPossible.wrongPossible is possibly not total due to: TestLambdaPossible.case block in wrongPossible-TestLambdaPossible.idr:12:16:Warning - TestLambdaPossible.case block in wrongPossible' is not total as there are missing cases-TestLambdaPossible.idr:12:1:Warning - TestLambdaPossible.wrongPossible' is possibly not total due to: TestLambdaPossible.case block in wrongPossible'+TestLambdaPossible.idr:9:25:Warning - TestLambdaPossible.case block in wrongPossible at TestLambdaPossible.idr:9:25 is not total as there are missing cases+TestLambdaPossible.idr:9:1:Warning - TestLambdaPossible.wrongPossible is possibly not total due to: TestLambdaPossible.case block in wrongPossible at TestLambdaPossible.idr:9:25+TestLambdaPossible.idr:12:25:Warning - TestLambdaPossible.case block in wrongPossible' at TestLambdaPossible.idr:12:25 is not total as there are missing cases+TestLambdaPossible.idr:12:1:Warning - TestLambdaPossible.wrongPossible' is possibly not total due to: TestLambdaPossible.case block in wrongPossible' at TestLambdaPossible.idr:12:25+TestLambdaPossible.idr:9:15:Warning - TestLambdaPossible.case block in wrongPossible at TestLambdaPossible.idr:9:25 is not total as there are missing cases+TestLambdaPossible.idr:9:1:Warning - TestLambdaPossible.wrongPossible is possibly not total due to: TestLambdaPossible.case block in wrongPossible at TestLambdaPossible.idr:9:25+TestLambdaPossible.idr:12:16:Warning - TestLambdaPossible.case block in wrongPossible' at TestLambdaPossible.idr:12:25 is not total as there are missing cases+TestLambdaPossible.idr:12:1:Warning - TestLambdaPossible.wrongPossible' is possibly not total due to: TestLambdaPossible.case block in wrongPossible' at TestLambdaPossible.idr:12:25
test/tutorial002/expected view
@@ -0,0 +1,6 @@+tutorial002.idr:41:25-30:+This style of tactic proof is deprecated. See %runElab for the replacement.+tutorial002.idr:48:18-23:+This style of tactic proof is deprecated. See %runElab for the replacement.+tutorial002.idr:54:18-23:+This style of tactic proof is deprecated. See %runElab for the replacement.
test/tutorial002/run view
@@ -1,3 +1,3 @@ #!/usr/bin/env bash-idris $@ tutorial002.idr --check+idris $@ --nocolour --consolewidth 80 tutorial002.idr --check rm -f *.ibc
test/tutorial002/tutorial002.idr view
@@ -1,31 +1,31 @@ module Main data Binary : Nat -> Type where- bEnd : Binary Z- bO : Binary n -> Binary (n + n)- bI : Binary n -> Binary (S (n + n))+ BEnd : Binary Z+ BO : Binary n -> Binary (n + n)+ BI : Binary n -> Binary (S (n + n)) instance Show (Binary n) where- show (bO x) = show x ++ "0"- show (bI x) = show x ++ "1"- show bEnd = ""+ show (BO x) = show x ++ "0"+ show (BI x) = show x ++ "1"+ show BEnd = "" data Parity : Nat -> Type where- even : Parity (n + n)- odd : Parity (S (n + n))+ Even : Parity (n + n)+ Odd : Parity (S (n + n)) parity : (n:Nat) -> Parity n-parity Z = even {n=Z}-parity (S Z) = odd {n=Z}+parity Z = Even {n=Z}+parity (S Z) = Odd {n=Z} parity (S (S k)) with (parity k)- parity (S (S (j + j))) | even ?= even {n=S j}- parity (S (S (S (j + j)))) | odd ?= odd {n=S j}+ parity (S (S (j + j))) | Even ?= Even {n=S j}+ parity (S (S (S (j + j)))) | Odd ?= Odd {n=S j} natToBin : (n:Nat) -> Binary n-natToBin Z = bEnd+natToBin Z = BEnd natToBin (S k) with (parity k)- natToBin (S (j + j)) | even = bI (natToBin j)- natToBin (S (S (j + j))) | odd ?= bO (natToBin (S j))+ natToBin (S (j + j)) | Even = BI (natToBin j)+ natToBin (S (S (j + j))) | Odd ?= BO (natToBin (S j)) intToNat : Int -> Nat intToNat 0 = Z
test/tutorial004/expected view
@@ -0,0 +1,4 @@+tutorial004.idr:46:14-19:+This style of tactic proof is deprecated. See %runElab for the replacement.+tutorial004.idr:53:14-19:+This style of tactic proof is deprecated. See %runElab for the replacement.
test/tutorial004/run view
@@ -1,3 +1,3 @@ #!/usr/bin/env bash-idris $@ tutorial004.idr --check+idris $@ tutorial004.idr --check --nocolour --consolewidth 80 rm -f *.ibc
test/tutorial006/expected view
@@ -1,4 +1,7 @@-tutorial006a.idr:5:23-25:When checking right hand side of vapp:+tutorial006a.idr:5:23-25:+When checking right hand side of vapp with expected type+ Vect (S k + m) a+ When checking argument xs to constructor Data.Vect.::: Type mismatch between Vect (k + k) a (Type of vapp xs xs)@@ -11,9 +14,11 @@ and plus k m tutorial006b.idr:10:10:-When checking right hand side of with block in Main.parity:+When checking right hand side of with block in Main.parity with expected type+ Parity (S (S (j + j)))+ Type mismatch between- Parity (plus (S j) (S j)) (Type of even)+ Parity (plus (S j) (S j)) (Type of Even) and Parity (S (S (plus j j))) (Expected type)
test/tutorial006/tutorial006b.idr view
@@ -1,12 +1,12 @@ data Parity : Nat -> Type where- even : Parity (n + n)- odd : Parity (S (n + n))+ Even : Parity (n + n)+ Odd : Parity (S (n + n)) parity : (n:Nat) -> Parity n-parity Z = even {n=Z}-parity (S Z) = odd {n=Z}+parity Z = Even {n=Z}+parity (S Z) = Odd {n=Z} parity (S (S k)) with (parity k)- parity (S (S (j + j))) | even = even {n=S j}- parity (S (S (S (j + j)))) | odd = odd {n=S j}+ parity (S (S (j + j))) | Even = Even {n=S j}+ parity (S (S (S (j + j)))) | Odd = Odd {n=S j}