Copyright | (c) Edward Kmett and Dan Doel 2012 |
---|---|
License | BSD3 |
Maintainer | Edward Kmett <ekmett@gmail.com> |
Stability | experimental |
Portability | non-portable |
Safe Haskell | None |
Language | Haskell2010 |
This module re-exports Rendering
from trifecta
along with
our in-house diagnostic type.
This allows the non-parsing modules to not have to concern themselves with how we choose to represent source locations.
- data Rendering :: *
- class HasRendering t0 where
- rendering :: Lens' t0 Rendering
- renderingDelta :: Lens' t0 Delta
- renderingLine :: Lens' t0 (Lines -> Lines)
- renderingLineBytes :: Lens' t0 Int64
- renderingLineLen :: Lens' t0 Int64
- renderingOverlays :: Lens' t0 (Delta -> Lines -> Lines)
- data Diagnostic = Diagnostic !Rendering (Maybe Doc) [Doc] (Set String)
- class AsDiagnostic t where
- _Diagnostic :: Prism' t Diagnostic
- class HasDiagnostic t where
- diagnostic :: Lens' t Diagnostic
- diagnosticExpected :: Lens' t (Set String)
- diagnosticMessage :: Lens' t (Maybe Doc)
- diagnosticNotes :: Lens' t [Doc]
- diagnosticRendering :: Lens' t Rendering
- data Err :: * = Err (Maybe Doc) [Doc] (Set String)
- class HasErr t0 where
- die :: HasRendering r => r -> Text -> Diagnostic
Rendering
data Rendering :: *
class HasRendering t0 where
rendering :: Lens' t0 Rendering
renderingDelta :: Lens' t0 Delta
renderingLine :: Lens' t0 (Lines -> Lines)
renderingLineBytes :: Lens' t0 Int64
renderingLineLen :: Lens' t0 Int64
renderingOverlays :: Lens' t0 (Delta -> Lines -> Lines)
Diagnostics
class AsDiagnostic t where Source
This provides the _Diagnostic
prism that can be used when matching against SomeException
or in a custom Error
type.
Nothing
_Diagnostic :: Prism' t Diagnostic Source
class HasDiagnostic t where Source
diagnostic :: Lens' t Diagnostic Source
diagnosticExpected :: Lens' t (Set String) Source
diagnosticMessage :: Lens' t (Maybe Doc) Source
diagnosticNotes :: Lens' t [Doc] Source
diagnosticRendering :: Lens' t Rendering Source
die :: HasRendering r => r -> Text -> Diagnostic Source
Construct a diagnostic