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 System.IO.Error(isUserError, ioeGetErrorString)
21iucheck = do tit <- typeInType
24 idrisCatch (tclift $ ucheck (idris_constraints ist))
25 (\e -> do let msg = show e
26 setErrLine (getErrLine msg)
29report :: IOError -> String
31 | isUserError e = ioeGetErrorString e
34idrisCatch :: Idris a -> (SomeException -> Idris a) -> Idris a
37data IdrisErr = IErr String
40instance Show IdrisErr where
43instance Exception IdrisErr
45ifail :: String -> Idris ()
46ifail str = throwIO (IErr str)
48ierror :: Err -> Idris ()
49ierror err = do i <- get
50 throwIO (IErr $ pshow i err)
52tclift :: TC a -> Idris a
55 Error err -> do i <- get
57 At (FC f l) e -> setErrLine l
59 throwIO (IErr $ pshow i err)
61tctry :: TC a -> TC a -> Idris a
65 Error err -> tclift tc2
68 = case span (/=':') str of
69 (_, ':':rest) -> case span isDigit rest of
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