Agda-2.6.2.2.20221128: A dependently typed functional programming language and proof assistant
Safe HaskellSafe-Inferred
LanguageHaskell2010

Agda.TypeChecking.Coverage.SplitTree

Description

Split tree for transforming pattern clauses into case trees.

The coverage checker generates a split tree from the clauses. The clause compiler uses it to transform clauses to case trees.

The initial problem is a set of clauses. The root node designates on which argument to split and has subtrees for all the constructors. Splitting continues until there is only a single clause left at each leaf of the split tree.

Synopsis

Documentation

data SplitTree' a Source #

Abstract case tree shape.

Constructors

SplittingDone

No more splits coming. We are at a single, all-variable clause.

Fields

SplitAt

A split is necessary.

Fields

Instances

Instances details
DropArgs SplitTree Source # 
Instance details

Defined in Agda.TypeChecking.DropArgs

KillRange a => KillRange (SplitTree' a) Source # 
Instance details

Defined in Agda.TypeChecking.Coverage.SplitTree

EmbPrj a => EmbPrj (SplitTree' a) Source # 
Instance details

Defined in Agda.TypeChecking.Serialise.Instances.Internal

Pretty a => Pretty (SplitTree' a) Source # 
Instance details

Defined in Agda.TypeChecking.Coverage.SplitTree

Generic (SplitTree' a) Source # 
Instance details

Defined in Agda.TypeChecking.Coverage.SplitTree

Associated Types

type Rep (SplitTree' a) :: Type -> Type #

Methods

from :: SplitTree' a -> Rep (SplitTree' a) x #

to :: Rep (SplitTree' a) x -> SplitTree' a #

Show a => Show (SplitTree' a) Source # 
Instance details

Defined in Agda.TypeChecking.Coverage.SplitTree

NFData a => NFData (SplitTree' a) Source # 
Instance details

Defined in Agda.TypeChecking.Coverage.SplitTree

Methods

rnf :: SplitTree' a -> () #

type Rep (SplitTree' a) Source # 
Instance details

Defined in Agda.TypeChecking.Coverage.SplitTree

type Rep (SplitTree' a) = D1 ('MetaData "SplitTree'" "Agda.TypeChecking.Coverage.SplitTree" "Agda-2.6.2.2.20221128-inplace" 'False) (C1 ('MetaCons "SplittingDone" 'PrefixI 'True) (S1 ('MetaSel ('Just "splitBindings") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int)) :+: C1 ('MetaCons "SplitAt" 'PrefixI 'True) (S1 ('MetaSel ('Just "splitArg") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Arg Int)) :*: (S1 ('MetaSel ('Just "splitLazy") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 LazySplit) :*: S1 ('MetaSel ('Just "splitTrees") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (SplitTrees' a)))))

data LazySplit Source #

Constructors

LazySplit 
StrictSplit 

Instances

Instances details
EmbPrj LazySplit Source # 
Instance details

Defined in Agda.TypeChecking.Serialise.Instances.Internal

Generic LazySplit Source # 
Instance details

Defined in Agda.TypeChecking.Coverage.SplitTree

Associated Types

type Rep LazySplit :: Type -> Type #

Show LazySplit Source # 
Instance details

Defined in Agda.TypeChecking.Coverage.SplitTree

NFData LazySplit Source # 
Instance details

Defined in Agda.TypeChecking.Coverage.SplitTree

Methods

rnf :: LazySplit -> () #

Eq LazySplit Source # 
Instance details

Defined in Agda.TypeChecking.Coverage.SplitTree

Ord LazySplit Source # 
Instance details

Defined in Agda.TypeChecking.Coverage.SplitTree

type Rep LazySplit Source # 
Instance details

Defined in Agda.TypeChecking.Coverage.SplitTree

type Rep LazySplit = D1 ('MetaData "LazySplit" "Agda.TypeChecking.Coverage.SplitTree" "Agda-2.6.2.2.20221128-inplace" 'False) (C1 ('MetaCons "LazySplit" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "StrictSplit" 'PrefixI 'False) (U1 :: Type -> Type))

type SplitTrees' a = [(a, SplitTree' a)] Source #

Split tree branching. A finite map from constructor names to splittrees A list representation seems appropriate, since we are expecting not so many constructors per data type, and there is no need for random access.

data SplitTag Source #

Tag for labeling branches of a split tree. Each branch is associated to either a constructor or a literal, or is a catchall branch (currently only used for splitting on a literal type).

Instances

Instances details
KillRange SplitTag Source # 
Instance details

Defined in Agda.TypeChecking.Coverage.SplitTree

DropArgs SplitTree Source # 
Instance details

Defined in Agda.TypeChecking.DropArgs

PrettyTCM SplitTag Source # 
Instance details

Defined in Agda.TypeChecking.Pretty

EmbPrj SplitTag Source # 
Instance details

Defined in Agda.TypeChecking.Serialise.Instances.Internal

Pretty SplitTag Source # 
Instance details

Defined in Agda.TypeChecking.Coverage.SplitTree

Generic SplitTag Source # 
Instance details

Defined in Agda.TypeChecking.Coverage.SplitTree

Associated Types

type Rep SplitTag :: Type -> Type #

Methods

from :: SplitTag -> Rep SplitTag x #

to :: Rep SplitTag x -> SplitTag #

Show SplitTag Source # 
Instance details

Defined in Agda.TypeChecking.Coverage.SplitTree

NFData SplitTag Source # 
Instance details

Defined in Agda.TypeChecking.Coverage.SplitTree

Methods

rnf :: SplitTag -> () #

Eq SplitTag Source # 
Instance details

Defined in Agda.TypeChecking.Coverage.SplitTree

Ord SplitTag Source # 
Instance details

Defined in Agda.TypeChecking.Coverage.SplitTree

type Rep SplitTag Source # 
Instance details

Defined in Agda.TypeChecking.Coverage.SplitTree

type Rep SplitTag = D1 ('MetaData "SplitTag" "Agda.TypeChecking.Coverage.SplitTree" "Agda-2.6.2.2.20221128-inplace" 'False) (C1 ('MetaCons "SplitCon" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 QName)) :+: (C1 ('MetaCons "SplitLit" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Literal)) :+: C1 ('MetaCons "SplitCatchall" 'PrefixI 'False) (U1 :: Type -> Type)))

Printing a split tree

data SplitTreeLabel a Source #

Constructors

SplitTreeLabel 

Fields

Instances

Instances details
Pretty a => Pretty (SplitTreeLabel a) Source # 
Instance details

Defined in Agda.TypeChecking.Coverage.SplitTree

toTree :: SplitTree' a -> Tree (SplitTreeLabel a) Source #

Convert a split tree into a Tree (for printing).