futhark-0.25.27: An optimising compiler for a functional, array-oriented language.

Safe Haskell | Safe-Inferred
Language | GHC2021

Language.Futhark.Warnings

Description

A very simple representation of collections of warnings. Warnings have a position (so they can be ordered), and their `Pretty`-instance produces a human-readable string.

Synopsis

- data Warnings
- anyWarnings :: Warnings -> Bool
- singleWarning :: Loc -> Doc () -> Warnings
- singleWarning' :: Loc -> [Loc] -> Doc () -> Warnings
- listWarnings :: Warnings -> [(Loc, Doc ())]
- prettyWarnings :: Warnings -> Doc AnsiStyle

# Documentation

data Warnings Source #

The warnings produced by the compiler. The `Show` instance produces a human-readable description.

#### Instances

Instances details

Monoid Warnings Source # |
Instance details Defined in Language.Futhark.Warnings Methods mempty :: Warnings Source # mappend :: Warnings -> Warnings -> Warnings Source # mconcat :: [Warnings] -> Warnings Source #
Semigroup Warnings Source # |
Instance details Defined in Language.Futhark.Warnings Methods (<>) :: Warnings -> Warnings -> Warnings Source # sconcat :: NonEmpty Warnings -> Warnings Source # stimes :: Integral b => b -> Warnings -> Warnings Source #

anyWarnings :: Warnings -> Bool Source #

True if there are any warnings in the set.

singleWarning :: Loc -> Doc () -> Warnings Source #

A single warning at the given location.

singleWarning' :: Loc -> [Loc] -> Doc () -> Warnings Source #

A single warning at the given location, but also with a stack trace (sort of) to the location.

listWarnings :: Warnings -> [(Loc, Doc ())] Source #

Exports Warnings into a list of (location, problem).

prettyWarnings :: Warnings -> Doc AnsiStyle Source #

Prettyprint warnings, making use of colours and such.