| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Rzk.Check.Monad
Contents
Description
The checker's monad: a reader of the context and a state of what the run records (holes and warnings), with errors raised in their context. The context keeps the diagnostics: the stack of judgements and the location narrowed to the term a judgement is about.
Synopsis
- data Check (n :: S) a
- data CheckLog = CheckLog {}
- emptyCheckLog :: CheckLog
- runCheck :: forall (n :: S) a. Context n -> Check n a -> (Either ErrorInContext a, CheckLog)
- askContext :: forall (n :: S). Check n (Context n)
- inContext :: forall (l :: S) a (n :: S). Context l -> Check l a -> Check n a
- localContext :: forall (n :: S) a. (Context n -> Context n) -> Check n a -> Check n a
- failWith :: forall (n :: S) a. Distinct n => TypeError n -> Check n a
- attempt :: forall (n :: S) a. Check n a -> Check n (Either ErrorInContext a)
- performing :: forall (n :: S) a. Distinct n => Action n -> Check n a -> Check n a
- recordWarning :: forall (n :: S). (Context n -> Warning) -> Check n ()
- recordHint :: forall (n :: S). (Context n -> Hint) -> Check n ()
- recordHole :: forall (n :: S). (Context n -> HoleInfo) -> Check n ()
- asksContext :: forall (n :: S) a. (Context n -> a) -> Check n a
- withLocation :: forall (n :: S) a. LocationInfo -> Check n a -> Check n a
- withOptions :: forall (n :: S) a. (Options -> Options) -> Check n a -> Check n a
- issueTypeError :: forall (n :: S) a. Distinct n => TypeError n -> Check n a
- underTope :: forall (n :: S) a. Tope n -> Check n a -> Check n a
- withVarianceM :: forall (n :: S) a. Variance -> Check n a -> Check n a
Documentation
data Check (n :: S) a Source #
The checker's monad.
What a run records: the holes, warnings, and hints it found, newest first.
runCheck :: forall (n :: S) a. Context n -> Check n a -> (Either ErrorInContext a, CheckLog) Source #
inContext :: forall (l :: S) a (n :: S). Context l -> Check l a -> Check n a Source #
Run a judgement in another scope's context.
failWith :: forall (n :: S) a. Distinct n => TypeError n -> Check n a Source #
Raise an error, in the current context.
attempt :: forall (n :: S) a. Check n a -> Check n (Either ErrorInContext a) Source #
Run a judgement for its outcome, keeping what it recorded.
performing :: forall (n :: S) a. Distinct n => Action n -> Check n a -> Check n a Source #
Run a judgement as an action on the stack, with the location narrowed to the term it is about.
recordWarning :: forall (n :: S). (Context n -> Warning) -> Check n () Source #
Record a warning, rendered from the context, once.
recordHint :: forall (n :: S). (Context n -> Hint) -> Check n () Source #
Record a hint, rendered from the context, once.
recordHole :: forall (n :: S). (Context n -> HoleInfo) -> Check n () Source #
Record a hole, rendered from the context.
Helpers
withLocation :: forall (n :: S) a. LocationInfo -> Check n a -> Check n a Source #