module Language.Haskell.Ghcid.Types(
GhciError(..),
Stream(..),
Load(..), Severity(..), isMessage, isLoading
) where
import Data.Data
import Control.Exception.Base (Exception)
data GhciError = UnexpectedExit String String
deriving (Show,Eq,Ord,Typeable,Data)
instance Exception GhciError
data Stream = Stdout | Stderr
deriving (Show,Eq,Ord,Bounded,Enum,Read,Typeable,Data)
data Severity = Warning | Error
deriving (Show,Eq,Ord,Bounded,Enum,Read,Typeable,Data)
data Load
= Loading
{loadModule :: String
,loadFile :: FilePath
}
| Message
{loadSeverity :: Severity
,loadFile :: FilePath
,loadFilePos :: (Int,Int)
,loadMessage :: [String]
}
deriving (Show, Eq, Ord)
isMessage :: Load -> Bool
isMessage Message{} = True
isMessage _ = False
isLoading :: Load -> Bool
isLoading Loading{} = True
isLoading _ = False