compiles (kill me)

man
This commit is contained in:
crumbtoo
2024-01-19 14:09:26 -07:00
parent f22d4238f5
commit f47f325e34
9 changed files with 126 additions and 172 deletions

View File

@@ -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