| Safe Haskell | None | 
|---|---|
| Language | Haskell2010 | 
Agda.TypeChecking.Monad.Debug
Synopsis
- class TraceS a where
- traceS :: MonadDebug m => VerboseKey -> VerboseLevel -> a -> m c -> m c
 
 - class ReportS a where
- reportS :: MonadDebug m => VerboseKey -> VerboseLevel -> a -> m ()
 
 - class (Functor m, Applicative m, Monad m) => MonadDebug m where
- displayDebugMessage :: VerboseKey -> VerboseLevel -> String -> m ()
 - traceDebugMessage :: VerboseKey -> VerboseLevel -> String -> m a -> m a
 - formatDebugMessage :: VerboseKey -> VerboseLevel -> TCM Doc -> m String
 - getVerbosity :: m Verbosity
 - isDebugPrinting :: m Bool
 - nowDebugPrinting :: m a -> m a
 - verboseBracket :: VerboseKey -> VerboseLevel -> String -> m a -> m a
 
 - catchAndPrintImpossible :: (CatchImpossible m, Monad m) => VerboseKey -> VerboseLevel -> m String -> m String
 - reportSLn :: MonadDebug m => VerboseKey -> VerboseLevel -> String -> m ()
 - __IMPOSSIBLE_VERBOSE__ :: (HasCallStack, MonadDebug m) => String -> m a
 - reportSDoc :: MonadDebug m => VerboseKey -> VerboseLevel -> TCM Doc -> m ()
 - reportResult :: MonadDebug m => VerboseKey -> VerboseLevel -> (a -> TCM Doc) -> m a -> m a
 - unlessDebugPrinting :: MonadDebug m => m () -> m ()
 - traceSLn :: MonadDebug m => VerboseKey -> VerboseLevel -> String -> m a -> m a
 - traceSDoc :: MonadDebug m => VerboseKey -> VerboseLevel -> TCM Doc -> m a -> m a
 - openVerboseBracket :: MonadDebug m => VerboseKey -> VerboseLevel -> String -> m ()
 - closeVerboseBracket :: MonadDebug m => VerboseKey -> VerboseLevel -> m ()
 - parseVerboseKey :: VerboseKey -> [String]
 - hasVerbosity :: MonadDebug m => VerboseKey -> VerboseLevel -> m Bool
 - hasExactVerbosity :: MonadDebug m => VerboseKey -> VerboseLevel -> m Bool
 - whenExactVerbosity :: MonadDebug m => VerboseKey -> VerboseLevel -> m () -> m ()
 - __CRASH_WHEN__ :: (HasCallStack, MonadTCM m, MonadDebug m) => VerboseKey -> VerboseLevel -> m ()
 - verboseS :: MonadDebug m => VerboseKey -> VerboseLevel -> m () -> m ()
 - applyWhenVerboseS :: MonadDebug m => VerboseKey -> VerboseLevel -> (m a -> m a) -> m a -> m a
 - verbosity :: VerboseKey -> Lens' VerboseLevel TCState
 - type Verbosity = Trie VerboseKey VerboseLevel
 - type VerboseKey = String
 - type VerboseLevel = Int
 
Documentation
Debug print some lines if the verbosity level for the given
   VerboseKey is at least VerboseLevel.
Note: In the presence of OverloadedStrings, just
 @
   traceS key level "Literate string"
 
 gives an Ambiguous type variable error in GHC@.
 Use the legacy functions traceSLn and traceSDoc instead then.
Methods
traceS :: MonadDebug m => VerboseKey -> VerboseLevel -> a -> m c -> m c Source #
Instances
| TraceS String Source # | |
Defined in Agda.TypeChecking.Monad.Debug Methods traceS :: MonadDebug m => VerboseKey -> VerboseLevel -> String -> m c -> m c Source #  | |
| TraceS Doc Source # | |
Defined in Agda.TypeChecking.Monad.Debug Methods traceS :: MonadDebug m => VerboseKey -> VerboseLevel -> Doc -> m c -> m c Source #  | |
| TraceS [String] Source # | |
Defined in Agda.TypeChecking.Monad.Debug Methods traceS :: MonadDebug m => VerboseKey -> VerboseLevel -> [String] -> m c -> m c Source #  | |
| TraceS [Doc] Source # | |
Defined in Agda.TypeChecking.Monad.Debug Methods traceS :: MonadDebug m => VerboseKey -> VerboseLevel -> [Doc] -> m c -> m c Source #  | |
| TraceS [TCM Doc] Source # | |
Defined in Agda.TypeChecking.Monad.Debug Methods traceS :: MonadDebug m => VerboseKey -> VerboseLevel -> [TCM Doc] -> m c -> m c Source #  | |
| TraceS (TCM Doc) Source # | |
Defined in Agda.TypeChecking.Monad.Debug Methods traceS :: MonadDebug m => VerboseKey -> VerboseLevel -> TCM Doc -> m c -> m c Source #  | |
class ReportS a where Source #
Debug print some lines if the verbosity level for the given
   VerboseKey is at least VerboseLevel.
Note: In the presence of OverloadedStrings, just
 @
   reportS key level "Literate string"
 
 gives an Ambiguous type variable error in GHC@.
 Use the legacy functions reportSLn and reportSDoc instead then.
Methods
reportS :: MonadDebug m => VerboseKey -> VerboseLevel -> a -> m () Source #
Instances
| ReportS String Source # | |
Defined in Agda.TypeChecking.Monad.Debug Methods reportS :: MonadDebug m => VerboseKey -> VerboseLevel -> String -> m () Source #  | |
| ReportS Doc Source # | |
Defined in Agda.TypeChecking.Monad.Debug Methods reportS :: MonadDebug m => VerboseKey -> VerboseLevel -> Doc -> m () Source #  | |
| ReportS [String] Source # | |
Defined in Agda.TypeChecking.Monad.Debug Methods reportS :: MonadDebug m => VerboseKey -> VerboseLevel -> [String] -> m () Source #  | |
| ReportS [Doc] Source # | |
Defined in Agda.TypeChecking.Monad.Debug Methods reportS :: MonadDebug m => VerboseKey -> VerboseLevel -> [Doc] -> m () Source #  | |
| ReportS [TCM Doc] Source # | |
Defined in Agda.TypeChecking.Monad.Debug Methods reportS :: MonadDebug m => VerboseKey -> VerboseLevel -> [TCM Doc] -> m () Source #  | |
| ReportS (TCM Doc) Source # | |
Defined in Agda.TypeChecking.Monad.Debug Methods reportS :: MonadDebug m => VerboseKey -> VerboseLevel -> TCM Doc -> m () Source #  | |
class (Functor m, Applicative m, Monad m) => MonadDebug m where Source #
Minimal complete definition
Methods
displayDebugMessage :: VerboseKey -> VerboseLevel -> String -> m () Source #
traceDebugMessage :: VerboseKey -> VerboseLevel -> String -> m a -> m a Source #
formatDebugMessage :: VerboseKey -> VerboseLevel -> TCM Doc -> m String Source #
getVerbosity :: m Verbosity Source #
getVerbosity :: HasOptions m => m Verbosity Source #
isDebugPrinting :: m Bool Source #
isDebugPrinting :: MonadTCEnv m => m Bool Source #
nowDebugPrinting :: m a -> m a Source #
nowDebugPrinting :: MonadTCEnv m => m a -> m a Source #
verboseBracket :: VerboseKey -> VerboseLevel -> String -> m a -> m a Source #
Print brackets around debug messages issued by a computation.
Instances
catchAndPrintImpossible :: (CatchImpossible m, Monad m) => VerboseKey -> VerboseLevel -> m String -> m String Source #
During printing, catch internal errors of kind Impossible and print them.
reportSLn :: MonadDebug m => VerboseKey -> VerboseLevel -> String -> m () Source #
Conditionally println debug string.
__IMPOSSIBLE_VERBOSE__ :: (HasCallStack, MonadDebug m) => String -> m a Source #
reportSDoc :: MonadDebug m => VerboseKey -> VerboseLevel -> TCM Doc -> m () Source #
Conditionally render debug Doc and print it.
reportResult :: MonadDebug m => VerboseKey -> VerboseLevel -> (a -> TCM Doc) -> m a -> m a Source #
Debug print the result of a computation.
unlessDebugPrinting :: MonadDebug m => m () -> m () Source #
traceSLn :: MonadDebug m => VerboseKey -> VerboseLevel -> String -> m a -> m a Source #
traceSDoc :: MonadDebug m => VerboseKey -> VerboseLevel -> TCM Doc -> m a -> m a Source #
Conditionally render debug Doc, print it, and then continue.
openVerboseBracket :: MonadDebug m => VerboseKey -> VerboseLevel -> String -> m () Source #
closeVerboseBracket :: MonadDebug m => VerboseKey -> VerboseLevel -> m () Source #
parseVerboseKey :: VerboseKey -> [String] Source #
hasVerbosity :: MonadDebug m => VerboseKey -> VerboseLevel -> m Bool Source #
Check whether a certain verbosity level is activated.
Precondition: The level must be non-negative.
hasExactVerbosity :: MonadDebug m => VerboseKey -> VerboseLevel -> m Bool Source #
Check whether a certain verbosity level is activated (exact match).
whenExactVerbosity :: MonadDebug m => VerboseKey -> VerboseLevel -> m () -> m () Source #
Run a computation if a certain verbosity level is activated (exact match).
__CRASH_WHEN__ :: (HasCallStack, MonadTCM m, MonadDebug m) => VerboseKey -> VerboseLevel -> m () Source #
verboseS :: MonadDebug m => VerboseKey -> VerboseLevel -> m () -> m () Source #
Run a computation if a certain verbosity level is activated.
Precondition: The level must be non-negative.
applyWhenVerboseS :: MonadDebug m => VerboseKey -> VerboseLevel -> (m a -> m a) -> m a -> m a Source #
Apply a function if a certain verbosity level is activated.
Precondition: The level must be non-negative.
verbosity :: VerboseKey -> Lens' VerboseLevel TCState Source #
Verbosity lens.
type Verbosity = Trie VerboseKey VerboseLevel Source #
type VerboseKey = String Source #
type VerboseLevel = Int Source #