HORIZON HASKELLDocslts/ghc-10.0.xfc4e5982026-10-11Search names, modules, packages, or :: a typeCtrl K

GHC 10.0.0.20260917 · lts/ghc-10.0.x · fc4e598 · 2026-10-11

ModuleAgda-2.8.0.2Haskell2010

Agda.TypeChecking.Positivity

Check that a datatype is strictly positive.

  • 9 types
  • 1 class
  • 12 values
  • PackageAgda-2.8.0.2
  • Exports22
  • LanguageHaskell2010
  • LicenceMIT
  • SourcePositivity.hs

Check that the datatypes in the mutual block containing the given declarations are strictly positive.

Find polarity of datatypes parameters and indices.

Also add information about positivity and recursivity of records to the signature.

datadata Item
#
Instances5Eq, Ord, Show, Pretty, HasRange
  • Eq ItemDefined in Agda-2.8.0.2 · Agda.TypeChecking.Positivity
  • Ord ItemDefined in Agda-2.8.0.2 · Agda.TypeChecking.Positivity
  • Show ItemDefined in Agda-2.8.0.2 · Agda.TypeChecking.Positivity
  • Pretty ItemDefined in Agda-2.8.0.2 · Agda.TypeChecking.Positivity
  • HasRange ItemDefined in Agda-2.8.0.2 · Agda.TypeChecking.Positivity
datadata OccurrencesBuilder
#

Used to build Occurrences and occurrence graphs.

Constructors

Instances2Semigroup, Monoid
datadata OccEnv
#

Context for computing occurrences.

Constructors

  • OccEnv
    • vars :: [Maybe Item]

      Items corresponding to the free variables.

      Potential invariant: It seems as if the list has the form genericReplicate n Nothing ++ map (Just . AnArg) is, for some n and is, where is is decreasing (non-strictly).

    • inf :: Maybe QName

      Name for ∞ builtin.

Instances1Monoid
classclass ComputeOccurrences a where
#
Instances15ComputeOccurrences, …
datadata Node
#

Constructors

Instances4Eq, Ord, Pretty, PrettyTCM
  • Eq NodeDefined in Agda-2.8.0.2 · Agda.TypeChecking.Positivity
  • Ord NodeDefined in Agda-2.8.0.2 · Agda.TypeChecking.Positivity
  • Pretty NodeDefined in Agda-2.8.0.2 · Agda.TypeChecking.Positivity
  • PrettyTCM NodeDefined in Agda-2.8.0.2 · Agda.TypeChecking.Positivity
datadata Edge a
#

Edge labels for the positivity graph.

Constructors

Instances6Functor, Eq, Ord, Show, SemiRing, PrettyTCMWithNode
  • Functor EdgeDefined in Agda-2.8.0.2 · Agda.TypeChecking.Positivity
  • Eq a => Eq (Edge a)Defined in Agda-2.8.0.2 · Agda.TypeChecking.Positivity
  • Ord a => Ord (Edge a)Defined in Agda-2.8.0.2 · Agda.TypeChecking.Positivity
  • Show a => Show (Edge a)Defined in Agda-2.8.0.2 · Agda.TypeChecking.Positivity
  • SemiRing (Edge (Seq OccursWhere))Defined in Agda-2.8.0.2 · Agda.TypeChecking.Positivity

    These operations form a semiring if we quotient by the relation "the Occurrence components are equal".

  • PrettyTCMWithNode (Edge OccursWhere)Defined in Agda-2.8.0.2 · Agda.TypeChecking.Positivity
valuecomputeEdges
  1. :: Set QName

    The names in the current mutual block.

  2. -> QName

    The current name.

  3. -> OccurrencesBuilder
  4. -> TCM [Edge Node (Edge OccursWhere)]
#

Computes all non-ozero occurrence graph edges represented by the given OccurrencesBuilder.

WARNING: There can be lots of sharing between the OccursWhere entries in the edges. Traversing all of these entries could be expensive. For instance, for the function F in benchmarkmiscSlowOccurrences.agda a large number of edges from the argument X to the function F are computed. These edges have polarity StrictPos, JustNeg or JustPos, and contain the following OccursWhere elements:

Orphan instances

1 instance