@@ -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
@@ -189,13 +190,15 @@ data IBCWrite = IBCFix FixDecl
189 | IBCLineApp FilePath Int PTerm
190 | IBCLineApp FilePath Int PTerm
190 deriving Show
191 deriving Show
193+-- | The initial state for the compiler
192idrisInit = IState initContext [] [] emptyContext emptyContext emptyContext
195idrisInit = IState initContext [] [] emptyContext emptyContext emptyContext
193 emptyContext emptyContext emptyContext emptyContext
196 emptyContext emptyContext emptyContext emptyContext
194 emptyContext emptyContext emptyContext emptyContext
197 emptyContext emptyContext emptyContext emptyContext
195 emptyContext
198 emptyContext
196 [] [] defaultOpts 6 [] [] [] [] [] [] [] [] [] [] [] []
199 [] [] defaultOpts 6 [] [] [] [] [] [] [] [] [] [] [] []
197 [] Nothing Nothing [] [] [] Hidden False [] Nothing [] [] RawOutput
200 [] Nothing Nothing [] [] [] Hidden False [] Nothing [] [] RawOutput
198− True defaultTheme stdout
201+ True defaultTheme stdout []
200-- | The monad for the main REPL - reading and processing files and updating
203-- | The monad for the main REPL - reading and processing files and updating
201-- global state (hence the IO inner monad).
204-- global state (hence the IO inner monad).
@@ -380,6 +383,7 @@ data FnOpt = Inlinable -- always evaluate when simplifying
380 -- a function argument, and further evaluation resutls
383 -- a function argument, and further evaluation resutls
381 | Implicit -- implicit coercion
384 | Implicit -- implicit coercion
382 | CExport String -- export, with a C name
385 | CExport String -- export, with a C name
386+ | ErrorHandler -- ^^ an error handler for use with the ErrorReflection extension
383 | Reflection -- a reflecting function, compile-time only
387 | Reflection -- a reflecting function, compile-time only
384 | Specialise [(Name, Maybe Int)] -- specialise it, freeze these names
388 | Specialise [(Name, Maybe Int)] -- specialise it, freeze these names
385 deriving (Show, Eq)
389 deriving (Show, Eq)