1{-# LANGUAGE DeriveDataTypeable #-}
3module Idris.Error where
5import Prelude hiding (catch)
11import Core.Constraints
13import System.Console.Haskeline
14import System.Console.Haskeline.MonadException
15import Control.Monad.State
16import Control.Monad.Error (throwError, catchError)
17import System.IO.Error(isUserError, ioeGetErrorString)
22iucheck = do tit <- typeInType
25 (tclift $ ucheck (idris_constraints ist)) `idrisCatch`
26 (\e -> do setErrLine (getErrLine e)
27 iputStrLn (pshow ist e))
29showErr :: Err -> Idris String
30showErr e = getIState >>= return . flip pshow e
33report :: IOError -> String
35 | isUserError e = ioeGetErrorString e
38--idrisCatch :: Idris a -> (SomeException -> Idris a) -> Idris a
41idrisCatch :: Idris a -> (Err -> Idris a) -> Idris a
42idrisCatch = catchError
45ifail :: String -> Idris a
46ifail = throwError . Msg
48ierror :: Err -> Idris a
51tclift :: TC a -> Idris a
52tclift (OK v) = return v
53tclift (Error err@(At (FC f l c) e)) = do setErrLine l ; throwError err
54tclift (Error err) = throwError err
56tctry :: TC a -> TC a -> Idris a
60 Error err -> tclift tc2
62getErrLine :: Err -> Int
63getErrLine (At (FC _ l _) _) = l
66getErrColumn :: Err -> Int
67getErrColumn (At (FC _ _ c) _) = c
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list