Safe Haskell | None |
---|---|
Language | Haskell98 |
Language.Haskell.Liquid.UX.Tidy
Description
This module contains functions for cleaning up types before they are rendered, e.g. in error messages or annoations, and also some PPrint instances that rely upon tidying.
Synopsis
- tidySpecType :: Tidy -> SpecType -> SpecType
- tidyInternalRefas :: SpecType -> SpecType
- tidySymbol :: Symbol -> Symbol
- panicError :: Error -> a
- class Result a where
- errorToUserError :: Error -> UserError
- cinfoError :: Cinfo -> Error
Tidying functions
tidyInternalRefas :: SpecType -> SpecType Source #
Drop conjuncts that contain data constructor testing or selector functions.
tidySymbol :: Symbol -> Symbol #
tidySymbol
is used to prettify the names of parameters of kvars appearing in solutions.(*)
For example, if you have a kvar $k0 with two parameters, you may have a solution that looks like
0 < lq_karg$nnf_arg$##k0
where we know it is a kvar-arg because of the
- kArgPrefix
(lq_arg
)
- hvarArgPrefix
(nnf_arg
)
- k0
the name of the kvar
- `0` the parameter index
- k0
again (IDK why?!)
all of which are separated by ##
So tidySymbol
tests if indeed it is a kArgPrefix
-ed symbol and if so converts
`lq_karg$nnf_arg$##k0` ----> `$k0##0`
Panic and Exit
panicError :: Error -> a Source #
Show an Error, then crash
This function is put in this module as it depends on the Exception instance, which depends on the PPrint instance, which depends on tidySpecType.
Final result
Converting Results To Answers -------------------------------------
Error to UserError
errorToUserError :: Error -> UserError Source #
MOVE TO TYPES
cinfoError :: Cinfo -> Error Source #
Orphan instances
Exception Error Source # | |
Methods toException :: Error -> SomeException # fromException :: SomeException -> Maybe Error # displayException :: Error -> String # backtraceDesired :: Error -> Bool # | |
Show Error Source # | |
PPrint Error Source # | |
Exception [Error] Source # | |
Methods toException :: [Error] -> SomeException # fromException :: SomeException -> Maybe [Error] # displayException :: [Error] -> String # backtraceDesired :: [Error] -> Bool # | |
PPrint (CtxError SpecType) Source # | |
PPrint (CtxError Doc) Source # | Pretty Printing Error Messages -------------------------------------------- Need to put |