| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Mikan.TypeChecking.Warnings
Synopsis
- class (MonadPretty m, MonadError TCErr m) => MonadWarning (m :: Type -> Type) where
- addWarning :: Bool -> TCWarning -> m ()
- warning'_ :: (MonadWarning m, Diagnostic e) => CallStack -> Ranged e -> m TCWarning
- warning_ :: (HasCallStack, MonadWarning m, Diagnostic e) => Ranged e -> m TCWarning
- warning' :: (MonadWarning m, Diagnostic e) => CallStack -> e -> m ()
- warning :: (HasCallStack, MonadWarning m, Diagnostic e) => e -> m ()
- warnings :: (HasCallStack, MonadWarning m, Diagnostic e) => List1 (Ranged e) -> m ()
- warnings' :: (MonadWarning m, Diagnostic e) => CallStack -> List1 (Ranged e) -> m ()
- raiseWarningsOnUsage :: MonadWarning m => QName -> m ()
- isUnsolvedWarning :: TCWarning -> Bool
- isMetaTCWarning :: TCWarning -> Bool
- onlyShowIfUnsolved :: TCWarning -> Bool
- warningsAddedBy :: (ReadTCState m, MonadTCState m) => m a -> m (a, Set TCWarning)
- data WhichWarnings
- classifyWarning :: TCWarning -> WhichWarnings
- data WarningsAndNonFatalErrors
- tcWarnings :: WarningsAndNonFatalErrors -> Set TCWarning
- nonFatalErrors :: WarningsAndNonFatalErrors -> Set TCWarning
- classifyWarnings :: Set TCWarning -> WarningsAndNonFatalErrors
Monads which can log warnings
class (MonadPretty m, MonadError TCErr m) => MonadWarning (m :: Type -> Type) where Source #
Minimal complete definition
Nothing
Methods
Arguments
| :: Bool | Should highlighting information be generated for this warning? |
| -> TCWarning | The finished warning. |
| -> m () |
Store a warning in the TC state. Warnings are stored regardless of whether they will be shown to the user, but, in general, highlighting information is only generated from enabled warnings.
This method should generally not be used directly: see warning instead.
default addWarning :: forall (n :: Type -> Type) (t :: (Type -> Type) -> Type -> Type). (MonadWarning n, MonadTrans t, t n ~ m) => Bool -> TCWarning -> m () Source #
Instances
| MonadWarning TCM Source # | |
Defined in Mikan.TypeChecking.Warnings | |
| MonadWarning m => MonadWarning (MaybeT m) Source # | |
Defined in Mikan.TypeChecking.Warnings | |
| MonadWarning m => MonadWarning (ReaderT r m) Source # | |
Defined in Mikan.TypeChecking.Warnings | |
| MonadWarning m => MonadWarning (StateT s m) Source # | |
Defined in Mikan.TypeChecking.Warnings | |
| (MonadWarning m, Monoid w) => MonadWarning (WriterT w m) Source # | |
Defined in Mikan.TypeChecking.Warnings | |
Warning construction
Arguments
| :: (MonadWarning m, Diagnostic e) | |
| => CallStack | Original source location where the warning was added. See |
| -> Ranged e | The diagnostic to wrap. The included |
| -> m TCWarning |
Construct a TCWarning from the given Diagnostic value,
associating it with the Range provided by the Ranged. This
handles pretty-printing the diagnostic into a warning message,
including its range and the elaboration context.
warning_ :: (HasCallStack, MonadWarning m, Diagnostic e) => Ranged e -> m TCWarning Source #
warning' :: (MonadWarning m, Diagnostic e) => CallStack -> e -> m () Source #
Add a single Diagnostic value as a warning to the TC state,
associated with the range of the current elaborator computation.
This function takes the warning mode into account, as with warnings'.
warning :: (HasCallStack, MonadWarning m, Diagnostic e) => e -> m () Source #
warnings :: (HasCallStack, MonadWarning m, Diagnostic e) => List1 (Ranged e) -> m () Source #
Arguments
| :: (MonadWarning m, Diagnostic e) | |
| => CallStack | The original source location to associate with the warnings. See |
| -> List1 (Ranged e) | The diagnostics to record. The positioning note in |
| -> m () |
Add a nonempty list of Ranged Diagnostics to the TC state as
warnings, constructed as per warning'_.
This takes the warning mode into account: if -Werror was given and
any of the warnings in the list were enabled, they are thrown as
NonFatalErrors rather than being added to the state.
raiseWarningsOnUsage :: MonadWarning m => QName -> m () Source #
Raise every WARNING_ON_USAGE connected to a name.
isUnsolvedWarning :: TCWarning -> Bool Source #
isMetaTCWarning :: TCWarning -> Bool Source #
onlyShowIfUnsolved :: TCWarning -> Bool Source #
warningsAddedBy :: (ReadTCState m, MonadTCState m) => m a -> m (a, Set TCWarning) Source #
data WhichWarnings Source #
Classifying warnings: some are benign, others are (non-fatal) errors.
Constructors
| ErrorWarnings | warnings that will be turned into errors |
| AllWarnings | all warnings, including errors and benign ones |
Instances
| Eq WhichWarnings Source # | |
Defined in Mikan.TypeChecking.Warnings Methods (==) :: WhichWarnings -> WhichWarnings -> Bool # (/=) :: WhichWarnings -> WhichWarnings -> Bool # | |
| Ord WhichWarnings Source # | |
Defined in Mikan.TypeChecking.Warnings Methods compare :: WhichWarnings -> WhichWarnings -> Ordering # (<) :: WhichWarnings -> WhichWarnings -> Bool # (<=) :: WhichWarnings -> WhichWarnings -> Bool # (>) :: WhichWarnings -> WhichWarnings -> Bool # (>=) :: WhichWarnings -> WhichWarnings -> Bool # max :: WhichWarnings -> WhichWarnings -> WhichWarnings # min :: WhichWarnings -> WhichWarnings -> WhichWarnings # | |
data WarningsAndNonFatalErrors Source #
Assorted warnings and errors to be displayed to the user
Instances
| EncodeTCM DisplayInfo Source # | |
Defined in Mikan.Interaction.JSONTop | |
| EncodeTCM Response Source # | |
| Null WarningsAndNonFatalErrors Source # | |
Defined in Mikan.TypeChecking.Monad.Base Methods empty :: WarningsAndNonFatalErrors Source # null :: WarningsAndNonFatalErrors -> Bool Source # | |