diagnose-1.8.1: Beautiful error reporting done easily
Copyright(c) Mesabloo 2021
LicenseBSD3
Stabilityexperimental
PortabilityPortable
Safe HaskellNone
LanguageHaskell2010

Error.Diagnose.Compat.Parsec

Description

 
Synopsis

Documentation

diagnosticFromParseError Source #

Arguments

:: forall msg. (IsString msg, HasHints Void msg) 
=> (ParseError -> Bool)

Determine whether the diagnostic is an error or a warning

-> Maybe msg

An optional error code

-> msg

The main error of the diagnostic

-> Maybe [msg]

Default hints

-> ParseError

The ParseError to transform into a Diagnostic

-> Diagnostic msg 

Generates a diagnostic from a ParseError.

errorDiagnosticFromParseError Source #

Arguments

:: forall msg. (IsString msg, HasHints Void msg) 
=> Maybe msg

An optional error code

-> msg

The main error message of the diagnostic

-> Maybe [msg]

Default hints

-> ParseError

The ParseError to convert

-> Diagnostic msg 

Generates an error diagnostic from a ParseError.

warningDiagnosticFromParseError Source #

Arguments

:: forall msg. (IsString msg, HasHints Void msg) 
=> Maybe msg

An optional error code

-> msg

The main error message of the diagnostic

-> Maybe [msg]

Default hints

-> ParseError

The ParseError to convert

-> Diagnostic msg 

Generates a warning diagnostic from a ParseError.

class HasHints e msg where Source #

A class mapping custom errors of type e with messages of type msg.

Methods

hints :: e -> [msg] Source #

Defines all the hints associated with a given custom error.