diagnose 2.1.0 → 2.1.1
raw patch · 5 files changed
+12/−10 lines, 5 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Error.Diagnose.Compat.Megaparsec: class HasHints e msg
+ Error.Diagnose.Compat.Megaparsec: diagnosticFromBundle :: forall msg s e. (IsString msg, Stream s, HasHints e msg, ShowErrorComponent e, VisualStream s, TraversableStream s) => (ParseError s e -> Bool) -> Maybe msg -> msg -> Maybe [Note msg] -> ParseErrorBundle s e -> Diagnostic msg
+ Error.Diagnose.Compat.Megaparsec: errorDiagnosticFromBundle :: forall msg s e. (IsString msg, Stream s, HasHints e msg, ShowErrorComponent e, VisualStream s, TraversableStream s) => Maybe msg -> msg -> Maybe [Note msg] -> ParseErrorBundle s e -> Diagnostic msg
+ Error.Diagnose.Compat.Megaparsec: hints :: HasHints e msg => e -> [Note msg]
+ Error.Diagnose.Compat.Megaparsec: warningDiagnosticFromBundle :: forall msg s e. (IsString msg, Stream s, HasHints e msg, ShowErrorComponent e, VisualStream s, TraversableStream s) => Maybe msg -> msg -> Maybe [Note msg] -> ParseErrorBundle s e -> Diagnostic msg
+ Error.Diagnose.Compat.Parsec: class HasHints e msg
+ Error.Diagnose.Compat.Parsec: diagnosticFromParseError :: forall msg. (IsString msg, HasHints Void msg) => (ParseError -> Bool) -> Maybe msg -> msg -> Maybe [Note msg] -> ParseError -> Diagnostic msg
+ Error.Diagnose.Compat.Parsec: errorDiagnosticFromParseError :: forall msg. (IsString msg, HasHints Void msg) => Maybe msg -> msg -> Maybe [Note msg] -> ParseError -> Diagnostic msg
+ Error.Diagnose.Compat.Parsec: hints :: HasHints e msg => e -> [Note msg]
+ Error.Diagnose.Compat.Parsec: warningDiagnosticFromParseError :: forall msg. (IsString msg, HasHints Void msg) => Maybe msg -> msg -> Maybe [Note msg] -> ParseError -> Diagnostic msg
+ Error.Diagnose.Diagnostic: diagnosticToJson :: ToJSON msg => Diagnostic msg -> ByteString
+ Error.Diagnose.Position: instance Data.Aeson.Types.ToJSON.ToJSON Error.Diagnose.Position.Position
Files
- diagnose.cabal +1/−1
- src/Error/Diagnose/Compat/Hints.hs +3/−1
- src/Error/Diagnose/Compat/Megaparsec.hs +4/−4
- src/Error/Diagnose/Compat/Parsec.hs +3/−3
- src/Error/Diagnose/Report/Internal.hs +1/−1
diagnose.cabal view
@@ -5,7 +5,7 @@ -- see: https://github.com/sol/hpack name: diagnose-version: 2.1.0+version: 2.1.1 synopsis: Beautiful error reporting done easily description: This package provides a simple way of getting beautiful compiler/interpreter errors using a very simple interface for the programmer.
src/Error/Diagnose/Compat/Hints.hs view
@@ -1,11 +1,13 @@ {-# LANGUAGE MultiParamTypeClasses #-} module Error.Diagnose.Compat.Hints where++import Error.Diagnose (Note) -- | A class mapping custom errors of type @e@ with messages of type @msg@. class HasHints e msg where -- | Defines all the hints associated with a given custom error.- hints :: e -> [msg]+ hints :: e -> [Note msg] -- this is a sane default for 'Void' -- but this can be redefined
src/Error/Diagnose/Compat/Megaparsec.hs view
@@ -42,7 +42,7 @@ -- | The error message of the diagnostic msg -> -- | Default hints when trivial errors are reported- Maybe [msg] ->+ Maybe [Note msg] -> -- | The bundle to create a diagnostic from MP.ParseErrorBundle s e -> Diagnostic msg@@ -68,7 +68,7 @@ end = second (+ 1) start in Position start end sourceName - errorHints :: MP.ParseError s e -> [msg]+ errorHints :: MP.ParseError s e -> [Note msg] errorHints MP.TrivialError {} = trivialHints errorHints (MP.FancyError _ errs) = Set.toList errs >>= \case@@ -84,7 +84,7 @@ -- | The error message of the diagnostic msg -> -- | Default hints when trivial errors are reported- Maybe [msg] ->+ Maybe [Note msg] -> -- | The bundle to create a diagnostic from MP.ParseErrorBundle s e -> Diagnostic msg@@ -99,7 +99,7 @@ -- | The error message of the diagnostic msg -> -- | Default hints when trivial errors are reported- Maybe [msg] ->+ Maybe [Note msg] -> -- | The bundle to create a diagnostic from MP.ParseErrorBundle s e -> Diagnostic msg
src/Error/Diagnose/Compat/Parsec.hs view
@@ -40,7 +40,7 @@ -- | The main error of the diagnostic msg -> -- | Default hints- Maybe [msg] ->+ Maybe [Note msg] -> -- | The 'PE.ParseError' to transform into a 'Diagnostic' PE.ParseError -> Diagnostic msg@@ -81,7 +81,7 @@ -- | The main error message of the diagnostic msg -> -- | Default hints- Maybe [msg] ->+ Maybe [Note msg] -> -- | The 'PE.ParseError' to convert PE.ParseError -> Diagnostic msg@@ -96,7 +96,7 @@ -- | The main error message of the diagnostic msg -> -- | Default hints- Maybe [msg] ->+ Maybe [Note msg] -> -- | The 'PE.ParseError' to convert PE.ParseError -> Diagnostic msg
src/Error/Diagnose/Report/Internal.hs view
@@ -123,7 +123,7 @@ Hint msg #ifdef USE_AESON-instance ToJSON msg => ToJson (Note msg) where+instance ToJSON msg => ToJSON (Note msg) where toJSON (Note msg) = object [ "note" .= msg ] toJSON (Hint msg) = object [ "hint" .= msg ] #endif