mirror of
https://github.com/Mesabloo/diagnose.git
synced 2024-11-22 09:42:01 +03:00
Remove (direct) dependency on containers
This removes the (+megaparsec-compat dependent) direct dependency on containers. This doesn't reduce the dependency footprint.
This commit is contained in:
parent
d3ffbb7f37
commit
0e9442c7a2
@ -82,8 +82,7 @@ library
|
||||
, bytestring >=0.9 && <1
|
||||
if flag(megaparsec-compat)
|
||||
build-depends:
|
||||
containers ==0.6.*
|
||||
, megaparsec >=9.0.0
|
||||
megaparsec >=9.0.0
|
||||
if flag(parsec-compat)
|
||||
build-depends:
|
||||
parsec >=3.1.14
|
||||
@ -128,8 +127,7 @@ test-suite diagnose-megaparsec-tests
|
||||
, bytestring >=0.9 && <1
|
||||
if flag(megaparsec-compat)
|
||||
build-depends:
|
||||
containers ==0.6.*
|
||||
, megaparsec >=9.0.0
|
||||
megaparsec >=9.0.0
|
||||
if flag(parsec-compat)
|
||||
build-depends:
|
||||
parsec >=3.1.14
|
||||
@ -169,8 +167,7 @@ test-suite diagnose-parsec-tests
|
||||
, bytestring >=0.9 && <1
|
||||
if flag(megaparsec-compat)
|
||||
build-depends:
|
||||
containers ==0.6.*
|
||||
, megaparsec >=9.0.0
|
||||
megaparsec >=9.0.0
|
||||
if flag(parsec-compat)
|
||||
build-depends:
|
||||
parsec >=3.1.14
|
||||
@ -208,8 +205,7 @@ test-suite diagnose-rendering-tests
|
||||
, bytestring >=0.9 && <1
|
||||
if flag(megaparsec-compat)
|
||||
build-depends:
|
||||
containers ==0.6.*
|
||||
, megaparsec >=9.0.0
|
||||
megaparsec >=9.0.0
|
||||
if flag(parsec-compat)
|
||||
build-depends:
|
||||
parsec >=3.1.14
|
||||
|
@ -66,7 +66,6 @@ when:
|
||||
- condition: flag(megaparsec-compat)
|
||||
dependencies:
|
||||
- megaparsec >= 9.0.0
|
||||
- containers == 0.6.*
|
||||
- condition: flag(parsec-compat)
|
||||
dependencies:
|
||||
- parsec >= 3.1.14
|
||||
|
@ -24,8 +24,8 @@ module Error.Diagnose.Compat.Megaparsec
|
||||
where
|
||||
|
||||
import Data.Bifunctor (second)
|
||||
import Data.Foldable (toList)
|
||||
import Data.Maybe (fromMaybe)
|
||||
import qualified Data.Set as Set (toList)
|
||||
import Data.String (IsString (..))
|
||||
import Error.Diagnose
|
||||
import Error.Diagnose.Compat.Hints (HasHints (..))
|
||||
@ -71,7 +71,7 @@ diagnosticFromBundle isError code msg (fromMaybe [] -> trivialHints) MP.ParseErr
|
||||
errorHints :: MP.ParseError s e -> [Note msg]
|
||||
errorHints MP.TrivialError {} = trivialHints
|
||||
errorHints (MP.FancyError _ errs) =
|
||||
Set.toList errs >>= \case
|
||||
toList errs >>= \case
|
||||
MP.ErrorCustom e -> hints e
|
||||
_ -> mempty
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user