Copyright | (c) 2020 Kowainik |
---|---|
License | MPL-2.0 |
Maintainer | Kowainik <xrom.xkov@gmail.com> |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Observation — a suggestion found in the target project by Stan
.
Synopsis
- data Observation = Observation {}
- type Observations = Slist Observation
- mkObservation :: Id Inspection -> HieFile -> RealSrcSpan -> Observation
- mkObservationId :: Id Inspection -> ModuleName -> RealSrcSpan -> Id Observation
- ignoredObservations :: [Id Observation] -> Observations -> ([Id Observation], [Id Observation])
- prettyShowObservation :: OutputSettings -> Observation -> Text
- prettyShowIgnoredObservations :: [Id Observation] -> Observations -> Text
- prettyObservationSource :: Bool -> Observation -> [Text]
Documentation
data Observation Source #
Data type to represent discovered by Stan suggestions.
Instances
Show Observation Source # | |
Defined in Stan.Observation showsPrec :: Int -> Observation -> ShowS # show :: Observation -> String # showList :: [Observation] -> ShowS # | |
Eq Observation Source # | |
Defined in Stan.Observation (==) :: Observation -> Observation -> Bool # (/=) :: Observation -> Observation -> Bool # | |
ToJSON Observation Source # | |
Defined in Stan.Observation toJSON :: Observation -> Value # |
type Observations = Slist Observation Source #
Type alias for the sized list of Observation
s.
Smart constructors
:: Id Inspection | Corresponding |
-> HieFile | |
-> RealSrcSpan | Position. |
-> Observation |
Smart constructor for Observation
s from HieFile
s.
mkObservationId :: Id Inspection -> ModuleName -> RealSrcSpan -> Id Observation Source #
Create a stable Observation
Id
in a such way that:
Id
doesn't depend on other inspections in this file.Id
uniquely identifiesObservation
location.Id
s are guaranteed to be the same if the module content didn't change between differentstan
runs.
The Observation
Id
should look like this:
OBS-STAN-XXXX-module-name-hash-10:42
:: [Id Observation] | |
-> Observations | |
-> ([Id Observation], [Id Observation]) | Ignored ^ Unknown |
Pretty print
prettyShowObservation :: OutputSettings -> Observation -> Text Source #
Show Observation
in a human-friendly format.
prettyShowIgnoredObservations :: [Id Observation] -> Observations -> Text Source #
prettyObservationSource Source #
:: Bool | Use colouring |
-> Observation | |
-> [Text] |