ddc-core-0.3.2.1: Disciplined Disciple Compiler core language and type checker.

Safe HaskellSafe-Inferred

DDC.Core.Collect

Contents

Description

Collecting sets of variables and constructors.

Synopsis

Free Variables

freeT :: (BindStruct c, Ord n) => Env n -> c n -> Set (Bound n)Source

Collect the free Spec variables in a thing (level-1).

freeX :: (BindStruct c, Ord n) => Env n -> c n -> Set (Bound n)Source

Collect the free Data and Witness variables in a thing (level-0).

Bounds and Binds

collectBound :: (BindStruct c, Ord n) => c n -> Set (Bound n)Source

Collect all the bound variables in a thing, independent of whether they are free or not.

collectBinds :: (BindStruct c, Ord n) => c n -> ([Bind n], [Bind n])Source

Collect all the spec and exp binders in a thing.

Support

data Support n Source

Constructors

Support 

Fields

supportTyCon :: Set (Bound n)

Type constructors used in the expression.

supportTyConXArg :: Set (Bound n)

Type constructors used in the argument of a value-type application.

supportSpVar :: Set (Bound n)

Free spec variables in an expression.

supportSpVarXArg :: Set (Bound n)

Type constructors used in the argument of a value-type application.

supportWiVar :: Set (Bound n)

Free witness variables in an expression. (from the Witness universe)

supportDaVar :: Set (Bound n)

Free value variables in an expression. (from the Data universe)

Instances

Show n => Show (Support n) 
Ord n => Monoid (Support n) 

class SupportX c whereSource

Methods

support :: Ord n => KindEnv n -> TypeEnv n -> c n -> Support nSource