Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- newtype Nice a = Nice {}
- runNice :: Nice a -> (Either DeclarationException a, NiceWarnings)
- data NiceEnv = NiceEnv {}
- data LoneSig = LoneSig {}
- type LoneSigs = Map Name LoneSig
- type NiceWarnings = [DeclarationWarning]
- initNiceEnv :: NiceEnv
- lensNameId :: Lens' NameId NiceEnv
- nextNameId :: Nice NameId
- loneSigs :: Lens' LoneSigs NiceEnv
- addLoneSig :: Range -> Name -> DataRecOrFun -> Nice Name
- removeLoneSig :: Name -> Nice ()
- getSig :: Name -> Nice (Maybe DataRecOrFun)
- noLoneSigs :: Nice Bool
- forgetLoneSigs :: Nice ()
- checkLoneSigs :: LoneSigs -> Nice ()
- loneFuns :: LoneSigs -> [(Name, Name)]
- loneSigsFromLoneNames :: [(Range, Name, DataRecOrFun)] -> LoneSigs
- terminationCheckPragma :: Lens' TerminationCheck NiceEnv
- withTerminationCheckPragma :: TerminationCheck -> Nice a -> Nice a
- coverageCheckPragma :: Lens' CoverageCheck NiceEnv
- withCoverageCheckPragma :: CoverageCheck -> Nice a -> Nice a
- positivityCheckPragma :: Lens' PositivityCheck NiceEnv
- withPositivityCheckPragma :: PositivityCheck -> Nice a -> Nice a
- universeCheckPragma :: Lens' UniverseCheck NiceEnv
- withUniverseCheckPragma :: UniverseCheck -> Nice a -> Nice a
- getUniverseCheckFromSig :: Name -> Nice UniverseCheck
- catchallPragma :: Lens' Catchall NiceEnv
- popCatchallPragma :: Nice Catchall
- withCatchallPragma :: Catchall -> Nice a -> Nice a
- niceWarning :: DeclarationWarning -> Nice ()
- declarationException :: HasCallStack => DeclarationException' -> Nice a
- declarationWarning' :: DeclarationWarning' -> CallStack -> Nice ()
- declarationWarning :: HasCallStack => DeclarationWarning' -> Nice ()
Documentation
Nicifier monad. Preserve the state when throwing an exception.
Instances
Applicative Nice Source # | |
Functor Nice Source # | |
Monad Nice Source # | |
MonadError DeclarationException Nice Source # | |
Defined in Agda.Syntax.Concrete.Definitions.Monad throwError :: DeclarationException -> Nice a # catchError :: Nice a -> (DeclarationException -> Nice a) -> Nice a # | |
MonadState NiceEnv Nice Source # | |
runNice :: Nice a -> (Either DeclarationException a, NiceWarnings) Source #
Run a Nicifier computation, return result and warnings (in chronological order).
Nicifier state.
NiceEnv | |
|
= Map Name LoneSig | We retain the Another reason is that we want to distinguish different
occurrences of |
type NiceWarnings Source #
= [DeclarationWarning] | Stack of warnings. Head is last warning. |
initNiceEnv :: NiceEnv Source #
Initial nicifier state.
nextNameId :: Nice NameId Source #
Handling the lone signatures, stored to infer mutual blocks.
addLoneSig :: Range -> Name -> DataRecOrFun -> Nice Name Source #
Adding a lone signature to the state.
Return the name (which is made unique if isNoName
).
removeLoneSig :: Name -> Nice () Source #
Remove a lone signature from the state.
noLoneSigs :: Nice Bool Source #
Check that no lone signatures are left in the state.
forgetLoneSigs :: Nice () Source #
Ensure that all forward declarations have been given a definition.
checkLoneSigs :: LoneSigs -> Nice () Source #
loneFuns :: LoneSigs -> [(Name, Name)] Source #
Get names of lone function signatures, plus their unique names.
loneSigsFromLoneNames :: [(Range, Name, DataRecOrFun)] -> LoneSigs Source #
Create a LoneSigs
map from an association list.
terminationCheckPragma :: Lens' TerminationCheck NiceEnv Source #
Lens for field _termChk
.
withTerminationCheckPragma :: TerminationCheck -> Nice a -> Nice a Source #
withCoverageCheckPragma :: CoverageCheck -> Nice a -> Nice a Source #
positivityCheckPragma :: Lens' PositivityCheck NiceEnv Source #
Lens for field _posChk
.
withPositivityCheckPragma :: PositivityCheck -> Nice a -> Nice a Source #
universeCheckPragma :: Lens' UniverseCheck NiceEnv Source #
Lens for field _uniChk
.
withUniverseCheckPragma :: UniverseCheck -> Nice a -> Nice a Source #
getUniverseCheckFromSig :: Name -> Nice UniverseCheck Source #
Get universe check pragma from a data/rec signature.
Defaults to YesUniverseCheck
.
popCatchallPragma :: Nice Catchall Source #
Get current catchall pragma, and reset it for the next clause.
niceWarning :: DeclarationWarning -> Nice () Source #
Add a new warning.
declarationException :: HasCallStack => DeclarationException' -> Nice a Source #
declarationWarning' :: DeclarationWarning' -> CallStack -> Nice () Source #
declarationWarning :: HasCallStack => DeclarationWarning' -> Nice () Source #