@@ -128,7 +128,8 @@ data IState = IState {
128 idris_outputmode :: OutputMode,
128 idris_outputmode :: OutputMode,
129 idris_colourRepl :: Bool,
129 idris_colourRepl :: Bool,
130 idris_colourTheme :: ColourTheme,
130 idris_colourTheme :: ColourTheme,
131− idris_outh :: Handle
131+ idris_outh :: Handle,
132+ idris_errorhandlers :: [Name]
134data SizeChange = Smaller | Same | Bigger | Unknown
135data SizeChange = Smaller | Same | Bigger | Unknown
@@ -182,12 +183,14 @@ data IBCWrite = IBCFix FixDecl
182 | IBCLineApp FilePath Int PTerm
183 | IBCLineApp FilePath Int PTerm
183 deriving Show
184 deriving Show
186+-- | The initial state for the compiler
185idrisInit = IState initContext [] [] emptyContext emptyContext emptyContext
188idrisInit = IState initContext [] [] emptyContext emptyContext emptyContext
186 emptyContext emptyContext emptyContext emptyContext
189 emptyContext emptyContext emptyContext emptyContext
187 emptyContext emptyContext emptyContext emptyContext
190 emptyContext emptyContext emptyContext emptyContext
188 [] "" defaultOpts 6 [] [] [] [] [] [] [] [] [] [] [] []
191 [] "" defaultOpts 6 [] [] [] [] [] [] [] [] [] [] [] []
189 [] Nothing Nothing [] [] [] Hidden False [] Nothing [] [] RawOutput
192 [] Nothing Nothing [] [] [] Hidden False [] Nothing [] [] RawOutput
190− True defaultTheme stdout
193+ True defaultTheme stdout []
192-- | The monad for the main REPL - reading and processing files and updating
195-- | The monad for the main REPL - reading and processing files and updating
193-- global state (hence the IO inner monad).
196-- global state (hence the IO inner monad).
@@ -368,6 +371,7 @@ data FnOpt = Inlinable -- always evaluate when simplifying
368 -- a function argument, and further evaluation resutls
371 -- a function argument, and further evaluation resutls
369 | Implicit -- implicit coercion
372 | Implicit -- implicit coercion
370 | CExport String -- export, with a C name
373 | CExport String -- export, with a C name
374+ | ErrorHandler -- ^^ an error handler for use with the ErrorReflection extension
371 | Reflection -- a reflecting function, compile-time only
375 | Reflection -- a reflecting function, compile-time only
372 | Specialise [(Name, Maybe Int)] -- specialise it, freeze these names
376 | Specialise [(Name, Maybe Int)] -- specialise it, freeze these names
373 deriving (Show, Eq)
377 deriving (Show, Eq)