Safe Haskell | None |
---|---|
Language | Haskell98 |
Language.Haskell.Liquid.Types.Specs
Description
This module contains the top-level structures that hold information about specifications.
Synopsis
- data TargetInfo = TargetInfo {
- giSrc :: !TargetSrc
- giSpec :: !TargetSpec
- data TargetSrc = TargetSrc {}
- data TargetSpec = TargetSpec {
- gsSig :: !GhcSpecSig
- gsQual :: !GhcSpecQual
- gsData :: !GhcSpecData
- gsName :: !GhcSpecNames
- gsVars :: !GhcSpecVars
- gsTerm :: !GhcSpecTerm
- gsRefl :: !GhcSpecRefl
- gsImps :: ![(Symbol, Sort)]
- gsConfig :: !Config
- type BareSpec = Spec Symbol BareType
- type BareSpecLHName = Spec LHName BareTypeLHName
- type BareSpecParsed = Spec LocSymbol BareTypeParsed
- data LiftedSpec = LiftedSpec {
- liftedMeasures :: HashMap Symbol (MeasureV LHName LocBareTypeLHName (Located LHName))
- liftedExpSigs :: HashSet (LHName, Sort)
- liftedPrivateReflects :: HashSet LocSymbol
- liftedAsmSigs :: HashSet (Located LHName, LocBareTypeLHName)
- liftedSigs :: HashSet (Located LHName, LocBareTypeLHName)
- liftedInvariants :: HashSet (Maybe LocSymbol, LocBareTypeLHName)
- liftedIaliases :: HashSet (LocBareTypeLHName, LocBareTypeLHName)
- liftedDataDecls :: HashSet DataDeclLHName
- liftedNewtyDecls :: HashSet DataDeclLHName
- liftedAliases :: HashSet (Located (RTAlias Symbol BareTypeLHName))
- liftedEaliases :: HashSet (Located (RTAlias Symbol (ExprV LHName)))
- liftedEmbeds :: TCEmb (Located LHName)
- liftedQualifiers :: HashSet (QualifierV LHName)
- liftedLvars :: HashSet (Located LHName)
- liftedAutois :: HashSet (Located LHName)
- liftedAutosize :: HashSet (Located LHName)
- liftedCmeasures :: HashMap Symbol (MeasureV LHName LocBareTypeLHName ())
- liftedImeasures :: HashSet (MeasureV LHName LocBareTypeLHName (Located LHName))
- liftedOmeasures :: HashSet (MeasureV LHName LocBareTypeLHName (Located LHName))
- liftedClasses :: HashSet (RClass LocBareTypeLHName)
- liftedRinstance :: HashSet (RInstance LocBareTypeLHName)
- liftedDsize :: [([LocBareTypeLHName], LHName)]
- liftedDvariance :: HashSet (Located LHName, [Variance])
- liftedBounds :: RRBEnvV LHName LocBareTypeLHName
- liftedAxeqs :: HashSet (EquationV LHName)
- liftedDefines :: HashMap Symbol (LMapV LHName)
- liftedUsedDataCons :: HashSet LHName
- newtype TargetDependencies = TargetDependencies {}
- dropDependency :: StableModule -> TargetDependencies -> TargetDependencies
- isPLEVar :: TargetSpec -> Var -> Bool
- isExportedVar :: TargetSrc -> Var -> Bool
- data QImports = QImports {}
- data Spec lname ty = Spec {
- measures :: ![MeasureV lname (Located ty) (Located LHName)]
- expSigs :: ![(lname, Sort)]
- asmSigs :: ![(Located LHName, Located ty)]
- asmReflectSigs :: ![(Located LHName, Located LHName)]
- sigs :: ![(Located LHName, Located (BareTypeV lname))]
- invariants :: ![(Maybe LocSymbol, Located ty)]
- ialiases :: ![(Located ty, Located ty)]
- dataDecls :: ![DataDeclP lname ty]
- newtyDecls :: ![DataDeclP lname ty]
- aliases :: ![Located (RTAlias Symbol (BareTypeV lname))]
- ealiases :: ![Located (RTAlias Symbol (ExprV lname))]
- embeds :: !(TCEmb (Located LHName))
- qualifiers :: ![QualifierV lname]
- lvars :: !(HashSet (Located LHName))
- lazy :: !(HashSet (Located LHName))
- rewrites :: !(HashSet (Located LHName))
- rewriteWith :: !(HashMap (Located LHName) [Located LHName])
- fails :: !(HashSet (Located LHName))
- reflects :: !(HashSet (Located LHName))
- privateReflects :: !(HashSet LocSymbol)
- opaqueReflects :: !(HashSet (Located LHName))
- autois :: !(HashSet (Located LHName))
- hmeas :: !(HashSet (Located LHName))
- inlines :: !(HashSet (Located LHName))
- ignores :: !(HashSet (Located LHName))
- autosize :: !(HashSet (Located LHName))
- pragmas :: ![Located String]
- cmeasures :: ![MeasureV lname (Located ty) ()]
- imeasures :: ![MeasureV lname (Located ty) (Located LHName)]
- omeasures :: ![MeasureV lname (Located ty) (Located LHName)]
- classes :: ![RClass (Located ty)]
- relational :: ![(Located LHName, Located LHName, Located (BareTypeV lname), Located (BareTypeV lname), RelExprV lname, RelExprV lname)]
- asmRel :: ![(Located LHName, Located LHName, Located (BareTypeV lname), Located (BareTypeV lname), RelExprV lname, RelExprV lname)]
- termexprs :: ![(Located LHName, [Located (ExprV lname)])]
- rinstance :: ![RInstance (Located ty)]
- dvariance :: ![(Located LHName, [Variance])]
- dsize :: ![([Located ty], lname)]
- bounds :: !(RRBEnvV lname (Located ty))
- axeqs :: ![EquationV lname]
- defines :: ![(Located LHName, LMapV lname)]
- usedDataCons :: HashSet LHName
- data GhcSpecVars = SpVar {
- gsTgtVars :: ![Var]
- gsIgnoreVars :: !(HashSet Var)
- gsLvars :: !(HashSet Var)
- gsCMethods :: ![Var]
- data GhcSpecSig = SpSig {
- gsTySigs :: ![(Var, LocSpecType)]
- gsAsmSigs :: ![(Var, LocSpecType)]
- gsAsmReflects :: ![(Var, Var)]
- gsRefSigs :: ![(Var, LocSpecType)]
- gsInSigs :: ![(Var, LocSpecType)]
- gsNewTypes :: ![(TyCon, LocSpecType)]
- gsDicts :: !(DEnv Var LocSpecType)
- gsMethods :: ![(Var, MethodType LocSpecType)]
- gsTexprs :: ![(Var, LocSpecType, [Located Expr])]
- gsRelation :: ![(Var, Var, LocSpecType, LocSpecType, RelExpr, RelExpr)]
- gsAsmRel :: ![(Var, Var, LocSpecType, LocSpecType, RelExpr, RelExpr)]
- data GhcSpecNames = SpNames {
- gsDconsP :: ![Located DataCon]
- gsTconsP :: ![TyConP]
- gsTcEmbeds :: !(TCEmb TyCon)
- gsADTs :: ![DataDecl]
- gsTyconEnv :: !TyConMap
- gsDataConIds :: [Var]
- data GhcSpecTerm = SpTerm {}
- data GhcSpecRefl = SpRefl {
- gsAutoInst :: !(HashSet Var)
- gsHAxioms :: ![(Var, LocSpecType, Equation)]
- gsImpAxioms :: ![Equation]
- gsMyAxioms :: ![Equation]
- gsReflects :: ![Var]
- gsLogicMap :: !LogicMap
- gsRewrites :: HashSet (Located Var)
- gsRewritesWith :: HashMap Var [Var]
- data GhcSpecData = SpData {
- gsCtors :: ![(Var, LocSpecType)]
- gsMeas :: ![(Symbol, LocSpecType)]
- gsInvariants :: ![(Maybe Var, LocSpecType)]
- gsIaliases :: ![(LocSpecType, LocSpecType)]
- gsMeasures :: ![Measure SpecType DataCon]
- gsOpaqueRefls :: ![Var]
- gsUnsorted :: ![UnSortedExpr]
- data GhcSpecQual = SpQual {
- gsQualifiers :: ![Qualifier]
- gsRTAliases :: ![Located SpecRTAlias]
- type BareDef = Def LocBareType (Located LHName)
- type BareMeasure = Measure LocBareType (Located LHName)
- type SpecMeasure = Measure LocSpecType DataCon
- type VarOrLocSymbol = Either Var LocSymbol
- emapSpecM :: Monad m => Bool -> (LHName -> [Symbol]) -> ([Symbol] -> lname0 -> m lname1) -> ([Symbol] -> ty0 -> m ty1) -> Spec lname0 ty0 -> m (Spec lname1 ty1)
- fromBareSpecLHName :: BareSpecLHName -> BareSpec
- fromBareSpecParsed :: BareSpecParsed -> BareSpec
- mapSpecLName :: (lname0 -> lname1) -> Spec lname0 ty -> Spec lname1 ty
- mapSpecTy :: (ty0 -> ty1) -> Spec lname ty0 -> Spec lname ty1
- data GhcSrc = Src {
- _giTarget :: !FilePath
- _giTargetMod :: !ModName
- _giCbs :: ![CoreBind]
- _gsTcs :: ![TyCon]
- _gsCls :: !(Maybe [ClsInst])
- _giDerVars :: !(HashSet Var)
- _giImpVars :: ![Var]
- _giDefVars :: ![Var]
- _giUseVars :: ![Var]
- _gsExports :: !(HashSet StableName)
- _gsFiTcs :: ![TyCon]
- _gsFiDcs :: ![(Symbol, DataCon)]
- _gsPrimTcs :: ![TyCon]
- data GhcSpec = SP {
- _gsSig :: !GhcSpecSig
- _gsQual :: !GhcSpecQual
- _gsData :: !GhcSpecData
- _gsName :: !GhcSpecNames
- _gsVars :: !GhcSpecVars
- _gsTerm :: !GhcSpecTerm
- _gsRefl :: !GhcSpecRefl
- _gsImps :: ![(Symbol, Sort)]
- _gsConfig :: !Config
- _gsLSpec :: !(Spec Symbol BareType)
- toTargetSrc :: GhcSrc -> TargetSrc
- fromTargetSrc :: TargetSrc -> GhcSrc
- toTargetSpec :: GhcSpec -> TargetSpec
- toLiftedSpec :: BareSpecLHName -> LiftedSpec
- unsafeFromLiftedSpec :: LiftedSpec -> BareSpecLHName
- emptyLiftedSpec :: LiftedSpec
Different types of specifications
There are different types or "flavours" for a specification, depending on its lifecycle. The main goal is always the same, i.e. refining the Haskell types and produce a final statement (i.e. safe or unsafe) about the input program. In order to do so, a specification is transformed in the way described by this picture:
+---------------+ +-------------------+ | BareSpec | | | checked by liquid/liquidOne | | ------------| TargetSpec |----------------------------- .. |(input module) | / | | +---------------+ makeTargetSpec / +-------------------+ + -----------------/ +---------------+ \ +-------------------+ | {LiftedSpec} | \ | | serialised on disk | | -------------| LiftedSpec |----------------------------- .. |(dependencies) | | | +---------------+ +-------------------+ ^ | | used-as | +----------------------------------------------------+
More specifically, we distinguish:
BareSpec
- is the specification obtained by parsing the Liquid annotations of the input Haskell file. It typically contains information about the associated input Haskell module, with the exceptions of assumptions that can refer to functions defined in other modules.LiftedSpec
- is the specification we obtain by "lifting" theBareSpec
. Most importantly, aLiftedSpec
gets serialised on disk and becomes a dependency for the verification of otherBareSpec
s.
Lifting in this context consist of:
- Perform name-resolution (e.g. make all the relevant GHC's
Var
s qualified, resolve GHC'sName
s, etc); - Strip the final
LiftedSpec
with information which are relevant (read: local) to just the inputBareSpec
. An example would be local signatures, used to annotate internal, auxiliary functions within aModule
; - Strip termination checks, which are required (if specified) for a
BareSpec
but not for theLiftedSpec
.
TargetSpec
- is the specification we actually use for refinement, and is conceptually an "augmented"BareSpec
. You can create aTargetSpec
by callingmakeTargetSpec
.
In order to produce these spec types we have to gather information about the module being compiled by using
the GHC API and retain enough context of the compiled Module
in order to be able to construct the types
introduced aboves. The rest of this module introduced also these intermediate structures.
The following is the overall type for specifications obtained from
parsing the target source and dependent libraries.
IMPORTANT: A TargetInfo
is what is checked by LH itself and it NEVER contains the LiftedSpec
,
because the checking happens only on the BareSpec
of the target module.
data TargetInfo Source #
Constructors
TargetInfo | |
Fields
|
Instances
Show TargetInfo Source # | |
Defined in Language.Haskell.Liquid.GHC.Interface Methods showsPrec :: Int -> TargetInfo -> ShowS # show :: TargetInfo -> String # showList :: [TargetInfo] -> ShowS # | |
PPrint TargetInfo Source # | |
Defined in Language.Haskell.Liquid.GHC.Interface | |
HasConfig TargetInfo Source # | |
Defined in Language.Haskell.Liquid.Types.Specs Methods getConfig :: TargetInfo -> Config Source # |
Gathering information about a module
The TargetSrc
type is a collection of all the things we know about a module being currently
checked. It include things like the name of the module, the list of CoreBind
s,
the TyCon
s declared in this module (that includes TyCon
s for classes), typeclass instances
and so and so forth. It might be consider a sort of ModGuts
embellished with LH-specific
information (for example, giDefVars
are populated with datacons from the module plus the
let vars derived from the A-normalisation).
Constructors
TargetSrc | |
Fields
|
TargetSpec
data TargetSpec Source #
A TargetSpec
is what we actually check via LiquidHaskell. It is created as part of mkTargetSpec
alongside the LiftedSpec
. It shares a similar structure with a BareSpec
, but manipulates and
transforms the data in preparation to the checking process.
Constructors
TargetSpec | |
Fields
|
Instances
Show TargetSpec Source # | |
Defined in Language.Haskell.Liquid.Types.Specs Methods showsPrec :: Int -> TargetSpec -> ShowS # show :: TargetSpec -> String # showList :: [TargetSpec] -> ShowS # | |
PPrint TargetSpec Source # | Pretty Printing ----------------------------------------------------------- |
Defined in Language.Haskell.Liquid.GHC.Interface | |
HasConfig TargetSpec Source # | |
Defined in Language.Haskell.Liquid.Types.Specs Methods getConfig :: TargetSpec -> Config Source # |
BareSpec
type BareSpec = Spec Symbol BareType Source #
A BareSpec
is the spec we derive by parsing the Liquid Haskell annotations of a single file. As
such, it contains things which are relevant for validation and lifting; it contains things like
the pragmas the user defined, the termination condition (if termination-checking is enabled) and so
on and so forth. Crucially, as a BareSpec
is still subject to "preflight checks", it may contain
duplicates (e.g. duplicate measures, duplicate type declarations etc.) and therefore most of the fields
for a BareSpec
are lists, so that we can report these errors to the end user: it would be an error
to silently ignore the duplication and leave the duplicate resolution to whichever Eq
instance is
implemented for the relevant field.
Also, a BareSpec
has not yet been subject to name resolution, so it may refer
to undefined or out-of-scope entities.
type BareSpecLHName = Spec LHName BareTypeLHName Source #
type BareSpecParsed = Spec LocSymbol BareTypeParsed Source #
LiftedSpec
data LiftedSpec Source #
A LiftedSpec
is derived from an input BareSpec
and a set of its dependencies.
The general motivations for lifting a spec are (a) name resolution, (b) the fact that some info is
only relevant for checking the body of functions but does not need to be exported, e.g.
termination measures, or the fact that a type signature was assumed.
A LiftedSpec
is what we serialise on disk and what the clients should will be using.
What we do not have compared to a BareSpec
:
- The
reflSigs
, they are now just "normal" signatures; - The
lazy
, we don't do termination checking in lifted specs; - The
reflects
, the reflection has already happened at this point; - The
hmeas
, we have already turned these into measures at this point; - The
inlines
, ditto ashmeas
; - The
ignores
, ditto ashmeas
; - The
pragmas
, we can't make any use of this information for lifted specs; - The
termexprs
, we don't do termination checking in lifted specs;
Apart from less fields, a LiftedSpec
replaces all instances of lists with sets, to enforce
duplicate detection and removal on what we serialise on disk.
Constructors
LiftedSpec | |
Fields
|
Instances
Tracking dependencies
newtype TargetDependencies Source #
The target dependencies that concur to the creation of a TargetSpec
and a LiftedSpec
.
Constructors
TargetDependencies | |
Fields |
Instances
Binary TargetDependencies Source # | |||||
Defined in Language.Haskell.Liquid.Types.Specs Methods put :: TargetDependencies -> Put # get :: Get TargetDependencies # putList :: [TargetDependencies] -> Put # | |||||
Monoid TargetDependencies Source # | |||||
Defined in Language.Haskell.Liquid.Types.Specs Methods mempty :: TargetDependencies # mappend :: TargetDependencies -> TargetDependencies -> TargetDependencies # mconcat :: [TargetDependencies] -> TargetDependencies # | |||||
Semigroup TargetDependencies Source # | |||||
Defined in Language.Haskell.Liquid.Types.Specs Methods (<>) :: TargetDependencies -> TargetDependencies -> TargetDependencies # sconcat :: NonEmpty TargetDependencies -> TargetDependencies # stimes :: Integral b => b -> TargetDependencies -> TargetDependencies # | |||||
Data TargetDependencies Source # | |||||
Defined in Language.Haskell.Liquid.Types.Specs Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> TargetDependencies -> c TargetDependencies # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c TargetDependencies # toConstr :: TargetDependencies -> Constr # dataTypeOf :: TargetDependencies -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c TargetDependencies) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c TargetDependencies) # gmapT :: (forall b. Data b => b -> b) -> TargetDependencies -> TargetDependencies # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> TargetDependencies -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> TargetDependencies -> r # gmapQ :: (forall d. Data d => d -> u) -> TargetDependencies -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> TargetDependencies -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> TargetDependencies -> m TargetDependencies # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> TargetDependencies -> m TargetDependencies # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> TargetDependencies -> m TargetDependencies # | |||||
Generic TargetDependencies Source # | |||||
Defined in Language.Haskell.Liquid.Types.Specs Associated Types
Methods from :: TargetDependencies -> Rep TargetDependencies x # to :: Rep TargetDependencies x -> TargetDependencies # | |||||
Show TargetDependencies Source # | |||||
Defined in Language.Haskell.Liquid.Types.Specs Methods showsPrec :: Int -> TargetDependencies -> ShowS # show :: TargetDependencies -> String # showList :: [TargetDependencies] -> ShowS # | |||||
Eq TargetDependencies Source # | |||||
Defined in Language.Haskell.Liquid.Types.Specs Methods (==) :: TargetDependencies -> TargetDependencies -> Bool # (/=) :: TargetDependencies -> TargetDependencies -> Bool # | |||||
type Rep TargetDependencies Source # | |||||
Defined in Language.Haskell.Liquid.Types.Specs type Rep TargetDependencies = D1 ('MetaData "TargetDependencies" "Language.Haskell.Liquid.Types.Specs" "liquidhaskell-boot-0.9.10.1.2-inplace" 'True) (C1 ('MetaCons "TargetDependencies" 'PrefixI 'True) (S1 ('MetaSel ('Just "getDependencies") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (HashMap StableModule LiftedSpec)))) |
dropDependency :: StableModule -> TargetDependencies -> TargetDependencies Source #
Drop the given StableModule
from the dependencies.
Predicates on spec types
Other types
A generic Spec
type, polymorphic over the inner choice of type and binders.
lname
corresponds to the names used for entities only known to LH like
non-interpreted functions and type aliases.
Constructors
Spec | |
Fields
|
Instances
Show BareSpec Source # | |||||
Expand BareSpec Source # | |||||
Monoid (Spec lname ty) Source # | |||||
Semigroup (Spec lname ty) Source # | |||||
(Data lname, Data ty) => Data (Spec lname ty) Source # | |||||
Defined in Language.Haskell.Liquid.Types.Specs Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Spec lname ty -> c (Spec lname ty) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Spec lname ty) # toConstr :: Spec lname ty -> Constr # dataTypeOf :: Spec lname ty -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Spec lname ty)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Spec lname ty)) # gmapT :: (forall b. Data b => b -> b) -> Spec lname ty -> Spec lname ty # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Spec lname ty -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Spec lname ty -> r # gmapQ :: (forall d. Data d => d -> u) -> Spec lname ty -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Spec lname ty -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Spec lname ty -> m (Spec lname ty) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Spec lname ty -> m (Spec lname ty) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Spec lname ty -> m (Spec lname ty) # | |||||
Generic (Spec lname ty) Source # | |||||
Defined in Language.Haskell.Liquid.Types.Specs Associated Types
| |||||
(Show lname, PPrint lname, Show ty, PPrint ty, PPrint (RTypeV lname BTyCon BTyVar (RReftV lname))) => PPrint (Spec lname ty) Source # | |||||
Defined in Language.Haskell.Liquid.Types.Specs | |||||
type Rep (Spec lname ty) Source # | |||||
Defined in Language.Haskell.Liquid.Types.Specs type Rep (Spec lname ty) = D1 ('MetaData "Spec" "Language.Haskell.Liquid.Types.Specs" "liquidhaskell-boot-0.9.10.1.2-inplace" 'False) (C1 ('MetaCons "Spec" 'PrefixI 'True) (((((S1 ('MetaSel ('Just "measures") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 [MeasureV lname (Located ty) (Located LHName)]) :*: S1 ('MetaSel ('Just "expSigs") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 [(lname, Sort)])) :*: (S1 ('MetaSel ('Just "asmSigs") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 [(Located LHName, Located ty)]) :*: (S1 ('MetaSel ('Just "asmReflectSigs") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 [(Located LHName, Located LHName)]) :*: S1 ('MetaSel ('Just "sigs") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 [(Located LHName, Located (BareTypeV lname))])))) :*: ((S1 ('MetaSel ('Just "invariants") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 [(Maybe LocSymbol, Located ty)]) :*: S1 ('MetaSel ('Just "ialiases") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 [(Located ty, Located ty)])) :*: (S1 ('MetaSel ('Just "dataDecls") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 [DataDeclP lname ty]) :*: (S1 ('MetaSel ('Just "newtyDecls") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 [DataDeclP lname ty]) :*: S1 ('MetaSel ('Just "aliases") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 [Located (RTAlias Symbol (BareTypeV lname))]))))) :*: (((S1 ('MetaSel ('Just "ealiases") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 [Located (RTAlias Symbol (ExprV lname))]) :*: S1 ('MetaSel ('Just "embeds") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (TCEmb (Located LHName)))) :*: (S1 ('MetaSel ('Just "qualifiers") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 [QualifierV lname]) :*: (S1 ('MetaSel ('Just "lvars") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (HashSet (Located LHName))) :*: S1 ('MetaSel ('Just "lazy") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (HashSet (Located LHName)))))) :*: ((S1 ('MetaSel ('Just "rewrites") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (HashSet (Located LHName))) :*: S1 ('MetaSel ('Just "rewriteWith") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (HashMap (Located LHName) [Located LHName]))) :*: (S1 ('MetaSel ('Just "fails") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (HashSet (Located LHName))) :*: (S1 ('MetaSel ('Just "reflects") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (HashSet (Located LHName))) :*: S1 ('MetaSel ('Just "privateReflects") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (HashSet LocSymbol))))))) :*: ((((S1 ('MetaSel ('Just "opaqueReflects") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (HashSet (Located LHName))) :*: S1 ('MetaSel ('Just "autois") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (HashSet (Located LHName)))) :*: (S1 ('MetaSel ('Just "hmeas") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (HashSet (Located LHName))) :*: (S1 ('MetaSel ('Just "inlines") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (HashSet (Located LHName))) :*: S1 ('MetaSel ('Just "ignores") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (HashSet (Located LHName)))))) :*: ((S1 ('MetaSel ('Just "autosize") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (HashSet (Located LHName))) :*: S1 ('MetaSel ('Just "pragmas") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 [Located String])) :*: (S1 ('MetaSel ('Just "cmeasures") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 [MeasureV lname (Located ty) ()]) :*: (S1 ('MetaSel ('Just "imeasures") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 [MeasureV lname (Located ty) (Located LHName)]) :*: S1 ('MetaSel ('Just "omeasures") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 [MeasureV lname (Located ty) (Located LHName)]))))) :*: (((S1 ('MetaSel ('Just "classes") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 [RClass (Located ty)]) :*: S1 ('MetaSel ('Just "relational") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 [(Located LHName, Located LHName, Located (BareTypeV lname), Located (BareTypeV lname), RelExprV lname, RelExprV lname)])) :*: (S1 ('MetaSel ('Just "asmRel") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 [(Located LHName, Located LHName, Located (BareTypeV lname), Located (BareTypeV lname), RelExprV lname, RelExprV lname)]) :*: (S1 ('MetaSel ('Just "termexprs") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 [(Located LHName, [Located (ExprV lname)])]) :*: S1 ('MetaSel ('Just "rinstance") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 [RInstance (Located ty)])))) :*: ((S1 ('MetaSel ('Just "dvariance") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 [(Located LHName, [Variance])]) :*: (S1 ('MetaSel ('Just "dsize") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 [([Located ty], lname)]) :*: S1 ('MetaSel ('Just "bounds") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (RRBEnvV lname (Located ty))))) :*: (S1 ('MetaSel ('Just "axeqs") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 [EquationV lname]) :*: (S1 ('MetaSel ('Just "defines") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 [(Located LHName, LMapV lname)]) :*: S1 ('MetaSel ('Just "usedDataCons") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (HashSet LHName))))))))) |
data GhcSpecVars Source #
The collection of GHC Var
s that a TargetSpec
needs to verify (or skip).
Constructors
SpVar | |
Fields
|
Instances
Monoid GhcSpecVars Source # | |
Defined in Language.Haskell.Liquid.Types.Specs Methods mempty :: GhcSpecVars # mappend :: GhcSpecVars -> GhcSpecVars -> GhcSpecVars # mconcat :: [GhcSpecVars] -> GhcSpecVars # | |
Semigroup GhcSpecVars Source # | |
Defined in Language.Haskell.Liquid.Types.Specs Methods (<>) :: GhcSpecVars -> GhcSpecVars -> GhcSpecVars # sconcat :: NonEmpty GhcSpecVars -> GhcSpecVars # stimes :: Integral b => b -> GhcSpecVars -> GhcSpecVars # | |
Show GhcSpecVars Source # | |
Defined in Language.Haskell.Liquid.Types.Specs Methods showsPrec :: Int -> GhcSpecVars -> ShowS # show :: GhcSpecVars -> String # showList :: [GhcSpecVars] -> ShowS # |
data GhcSpecSig Source #
Constructors
SpSig | |
Fields
|
Instances
Monoid GhcSpecSig Source # | |
Defined in Language.Haskell.Liquid.Types.Specs Methods mempty :: GhcSpecSig # mappend :: GhcSpecSig -> GhcSpecSig -> GhcSpecSig # mconcat :: [GhcSpecSig] -> GhcSpecSig # | |
Semigroup GhcSpecSig Source # | |
Defined in Language.Haskell.Liquid.Types.Specs Methods (<>) :: GhcSpecSig -> GhcSpecSig -> GhcSpecSig # sconcat :: NonEmpty GhcSpecSig -> GhcSpecSig # stimes :: Integral b => b -> GhcSpecSig -> GhcSpecSig # | |
Show GhcSpecSig Source # | |
Defined in Language.Haskell.Liquid.Types.Specs Methods showsPrec :: Int -> GhcSpecSig -> ShowS # show :: GhcSpecSig -> String # showList :: [GhcSpecSig] -> ShowS # |
data GhcSpecNames Source #
Constructors
SpNames | |
Fields
|
Instances
Show GhcSpecNames Source # | |
Defined in Language.Haskell.Liquid.Types.Specs Methods showsPrec :: Int -> GhcSpecNames -> ShowS # show :: GhcSpecNames -> String # showList :: [GhcSpecNames] -> ShowS # |
data GhcSpecTerm Source #
Constructors
SpTerm | |
Fields
|
Instances
Monoid GhcSpecTerm Source # | |
Defined in Language.Haskell.Liquid.Types.Specs Methods mempty :: GhcSpecTerm # mappend :: GhcSpecTerm -> GhcSpecTerm -> GhcSpecTerm # mconcat :: [GhcSpecTerm] -> GhcSpecTerm # | |
Semigroup GhcSpecTerm Source # | |
Defined in Language.Haskell.Liquid.Types.Specs Methods (<>) :: GhcSpecTerm -> GhcSpecTerm -> GhcSpecTerm # sconcat :: NonEmpty GhcSpecTerm -> GhcSpecTerm # stimes :: Integral b => b -> GhcSpecTerm -> GhcSpecTerm # | |
Show GhcSpecTerm Source # | |
Defined in Language.Haskell.Liquid.Types.Specs Methods showsPrec :: Int -> GhcSpecTerm -> ShowS # show :: GhcSpecTerm -> String # showList :: [GhcSpecTerm] -> ShowS # |
data GhcSpecRefl Source #
Constructors
SpRefl | |
Fields
|
Instances
Monoid GhcSpecRefl Source # | |
Defined in Language.Haskell.Liquid.Types.Specs Methods mempty :: GhcSpecRefl # mappend :: GhcSpecRefl -> GhcSpecRefl -> GhcSpecRefl # mconcat :: [GhcSpecRefl] -> GhcSpecRefl # | |
Semigroup GhcSpecRefl Source # | |
Defined in Language.Haskell.Liquid.Types.Specs Methods (<>) :: GhcSpecRefl -> GhcSpecRefl -> GhcSpecRefl # sconcat :: NonEmpty GhcSpecRefl -> GhcSpecRefl # stimes :: Integral b => b -> GhcSpecRefl -> GhcSpecRefl # | |
Show GhcSpecRefl Source # | |
Defined in Language.Haskell.Liquid.Types.Specs Methods showsPrec :: Int -> GhcSpecRefl -> ShowS # show :: GhcSpecRefl -> String # showList :: [GhcSpecRefl] -> ShowS # |
data GhcSpecData Source #
Constructors
SpData | |
Fields
|
Instances
Show GhcSpecData Source # | |
Defined in Language.Haskell.Liquid.Types.Specs Methods showsPrec :: Int -> GhcSpecData -> ShowS # show :: GhcSpecData -> String # showList :: [GhcSpecData] -> ShowS # |
data GhcSpecQual Source #
Constructors
SpQual | |
Fields
|
Instances
Show GhcSpecQual Source # | |
Defined in Language.Haskell.Liquid.Types.Specs Methods showsPrec :: Int -> GhcSpecQual -> ShowS # show :: GhcSpecQual -> String # showList :: [GhcSpecQual] -> ShowS # |
type BareMeasure = Measure LocBareType (Located LHName) Source #
type SpecMeasure = Measure LocSpecType DataCon Source #
Arguments
:: Monad m | |
=> Bool | The bscope setting, which affects which names are considered to be in scope in refinment types. |
-> (LHName -> [Symbol]) | For names that have a local environment return the names in scope. |
-> ([Symbol] -> lname0 -> m lname1) | The first parameter of the function argument are the variables in scope. |
-> ([Symbol] -> ty0 -> m ty1) | |
-> Spec lname0 ty0 | |
-> m (Spec lname1 ty1) |
A function to resolve names in the ty parameter of Spec
mapSpecLName :: (lname0 -> lname1) -> Spec lname0 ty -> Spec lname1 ty Source #
Legacy data structures
Constructors
Src | |
Fields
|
Constructors
SP | |
Fields
|
Provisional compatibility exports & optics
toTargetSrc :: GhcSrc -> TargetSrc Source #
fromTargetSrc :: TargetSrc -> GhcSrc Source #
toTargetSpec :: GhcSpec -> TargetSpec Source #