compiles (kill me)
man
This commit is contained in:
@@ -1,15 +1,39 @@
|
||||
{-# LANGUAGE TemplateHaskell #-}
|
||||
module Compiler.RlpcError
|
||||
( RlpcError(..)
|
||||
, IsRlpcError(..)
|
||||
, MsgEnvelope(..)
|
||||
, Severity
|
||||
, RlpcErrorDoc(..)
|
||||
, SrcSpan(..)
|
||||
, msgSpan
|
||||
, msgDiagnostic
|
||||
, msgSeverity
|
||||
)
|
||||
where
|
||||
----------------------------------------------------------------------------------
|
||||
import Control.Monad.Errorful
|
||||
import Lens.Micro.TH
|
||||
----------------------------------------------------------------------------------
|
||||
|
||||
data RlpcError = RlpcErr String -- temp
|
||||
deriving Show
|
||||
data MsgEnvelope = MsgEnvelope
|
||||
{ _msgSpan :: SrcSpan
|
||||
, _msgDiagnostic :: forall e. (RlpcError e) => e
|
||||
, _msgSeverity :: Severity
|
||||
}
|
||||
|
||||
class IsRlpcError a where
|
||||
liftRlpcErr :: a -> RlpcError
|
||||
class RlpcError e where
|
||||
liftRlpcError :: e -> RlpcErrorDoc
|
||||
|
||||
data RlpcErrorDoc
|
||||
|
||||
data Severity = SevWarning
|
||||
| SevError
|
||||
deriving Show
|
||||
|
||||
data SrcSpan = SrcSpan
|
||||
!Int -- ^ Line
|
||||
!Int -- ^ Column
|
||||
!Int -- ^ Length
|
||||
|
||||
makeLenses ''MsgEnvelope
|
||||
|
||||
|
||||
Reference in New Issue
Block a user