@@ -131,7 +131,8 @@ data IState = IState {
131 idris_outputmode :: OutputMode,
131 idris_outputmode :: OutputMode,
132 idris_colourRepl :: Bool,
132 idris_colourRepl :: Bool,
133 idris_colourTheme :: ColourTheme,
133 idris_colourTheme :: ColourTheme,
134− idris_outh :: Handle
134+ idris_outh :: Handle,
135+ idris_errorhandlers :: [Name]
137data SizeChange = Smaller | Same | Bigger | Unknown
138data SizeChange = Smaller | Same | Bigger | Unknown
@@ -188,13 +189,15 @@ data IBCWrite = IBCFix FixDecl
188 | IBCLineApp FilePath Int PTerm
189 | IBCLineApp FilePath Int PTerm
189 deriving Show
190 deriving Show
192+-- | The initial state for the compiler
191idrisInit = IState initContext [] [] emptyContext emptyContext emptyContext
194idrisInit = IState initContext [] [] emptyContext emptyContext emptyContext
192 emptyContext emptyContext emptyContext emptyContext
195 emptyContext emptyContext emptyContext emptyContext
193 emptyContext emptyContext emptyContext emptyContext
196 emptyContext emptyContext emptyContext emptyContext
194 emptyContext
197 emptyContext
195 [] [] defaultOpts 6 [] [] [] [] [] [] [] [] [] [] [] []
198 [] [] defaultOpts 6 [] [] [] [] [] [] [] [] [] [] [] []
196 [] Nothing Nothing [] [] [] Hidden False [] Nothing [] [] RawOutput
199 [] Nothing Nothing [] [] [] Hidden False [] Nothing [] [] RawOutput
197− True defaultTheme stdout
200+ True defaultTheme stdout []
199-- | The monad for the main REPL - reading and processing files and updating
202-- | The monad for the main REPL - reading and processing files and updating
200-- global state (hence the IO inner monad).
203-- global state (hence the IO inner monad).
@@ -379,6 +382,7 @@ data FnOpt = Inlinable -- always evaluate when simplifying
379 -- a function argument, and further evaluation resutls
382 -- a function argument, and further evaluation resutls
380 | Implicit -- implicit coercion
383 | Implicit -- implicit coercion
381 | CExport String -- export, with a C name
384 | CExport String -- export, with a C name
385+ | ErrorHandler -- ^^ an error handler for use with the ErrorReflection extension
382 | Reflection -- a reflecting function, compile-time only
386 | Reflection -- a reflecting function, compile-time only
383 | Specialise [(Name, Maybe Int)] -- specialise it, freeze these names
387 | Specialise [(Name, Maybe Int)] -- specialise it, freeze these names
384 deriving (Show, Eq)
388 deriving (Show, Eq)