stan-0.2.0.0: Haskell STatic ANalyser

Copyright | (c) 2020 Kowainik
License | MPL-2.0
Maintainer | Kowainik <xrom.xkov@gmail.com>
Safe Haskell | None
Language | Haskell2010

Stan.Severity

Contents

- Pretty printing

Description

This module introduces `Severity` data type for expressing how severe the message is. Also, it contains useful functions to work with `Severity`.

Synopsis

- data Severity
  - = Style
  - | Performance
  - | PotentialBug
  - | Warning
  - | Error
- severityDescription :: Severity -> Text
- severityColour :: Severity -> Text
- prettyShowSeverity :: Severity -> Text

# Documentation

data Severity #

Severity level of the inspection.

Severity | Example
--- | ---
`Style` | Missing `infix`, or type signature in `where`
`Performance` | Usage of `sum`, `foldl`
`PotentialBug` | Some common user errors: `[0 .. length xs]`
`Warning` | Partial functions, like `head`
`Error` | Usage of `undefined` in code

Constructors

Style | Code style issues. Usually harmless.
Performance | Serious defects that could cause slowness and space leaking.
PotentialBug | Human errors in code.
Warning | Potential runtime errors on some inputs.
Error | Dangerous behaviour.

#### Instances

Instances details

Bounded Severity # |
Instance details Defined in Stan.Severity Methods minBound :: Severity # maxBound :: Severity #
Enum Severity # |
Instance details Defined in Stan.Severity Methods succ :: Severity -> Severity # pred :: Severity -> Severity # toEnum :: Int -> Severity # fromEnum :: Severity -> Int # enumFrom :: Severity -> [Severity] # enumFromThen :: Severity -> Severity -> [Severity] # enumFromTo :: Severity -> Severity -> [Severity] # enumFromThenTo :: Severity -> Severity -> Severity -> [Severity] #
Read Severity # |
Instance details Defined in Stan.Severity Methods readsPrec :: Int -> ReadS Severity # readList :: ReadS [Severity] # readPrec :: ReadPrec Severity # readListPrec :: ReadPrec [Severity] #
Show Severity # |
Instance details Defined in Stan.Severity Methods showsPrec :: Int -> Severity -> ShowS # show :: Severity -> String # showList :: [Severity] -> ShowS #
Eq Severity # |
Instance details Defined in Stan.Severity Methods (==) :: Severity -> Severity -> Bool # (/=) :: Severity -> Severity -> Bool #
Ord Severity # |
Instance details Defined in Stan.Severity Methods compare :: Severity -> Severity -> Ordering # (<) :: Severity -> Severity -> Bool # (<=) :: Severity -> Severity -> Bool # (>) :: Severity -> Severity -> Bool # (>=) :: Severity -> Severity -> Bool # max :: Severity -> Severity -> Severity # min :: Severity -> Severity -> Severity #
ToJSON Severity # |
Instance details Defined in Stan.Severity Methods toJSON :: Severity -> Value #

# Pretty printing

severityDescription :: Severity -> Text #

Description of each `Severity` level.

severityColour :: Severity -> Text #

Get the colour of the severity level.

prettyShowSeverity :: Severity -> Text #

Show `Severity` in a human-friendly format.