HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

ModuleAgda-2.7.0.1Haskell2010

Agda.TypeChecking.Positivity

Check that a datatype is strictly positive.

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

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

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

datadata Item
#

Constructors

Instances5Eq, Ord, Show, Pretty, HasRange
  • Eq ItemDefined in Agda-2.7.0.1 · Agda.TypeChecking.Positivity
  • Ord ItemDefined in Agda-2.7.0.1 · Agda.TypeChecking.Positivity
  • Show ItemDefined in Agda-2.7.0.1 · Agda.TypeChecking.Positivity
  • Pretty ItemDefined in Agda-2.7.0.1 · Agda.TypeChecking.Positivity
  • HasRange ItemDefined in Agda-2.7.0.1 · 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
#
Instances13ComputeOccurrences, …
datadata Node
#

Constructors

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

Edge labels for the positivity graph.

Constructors

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

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

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