unison-parser-typechecker-0.0.0
Safe HaskellSafe-Inferred
LanguageHaskell2010

Unison.PatternMatchCoverage.Constraint

Synopsis

Documentation

data Constraint vt v loc Source #

A constraint to add to a normalized constraint set (fig 6) See addConstraint

Constructors

PosCon v ConstructorReference [(v, Type vt loc)]

Positive constraint regarding data type. States that the given variable must be the given constructor, and it also binds variables corresponding to constructor arguments.

NegCon v ConstructorReference

Negative constraint concerning data type. States that the given variable must not be the given constructor.

PosEffect v EffectHandler [(v, Type vt loc)]

Positive constraint regarding data type. States that the given variable must be the given constructor, and it also binds variables corresponding to constructor arguments.

NegEffect v EffectHandler

Negative constraint concerning data type. States that the given variable must not be the given constructor.

PosLit v PmLit

Positive constraint regarding literal

NegLit v PmLit

Negative constraint regarding literal

PosListHead

Positive constraint on list element with position relative to head of list

Fields

  • v

    list root

  • Int

    cons position (0 is head)

  • v

    element variable

PosListTail

Positive constraint on list element with position relative to end of list

Fields

  • v

    list root

  • Int

    snoc position (0 is last)

  • v

    element variable

NegListInterval v IntervalSet

Negative constraint on length of the list (i.e. the list may not be an element of the interval set)

Effectful v

An effect is performed

Eq v v

Equality constraint

Instances

Instances details
(Var vt, Eq v) => Eq (Constraint vt v loc) Source # 
Instance details

Defined in Unison.PatternMatchCoverage.Constraint

Methods

(==) :: Constraint vt v loc -> Constraint vt v loc -> Bool #

(/=) :: Constraint vt v loc -> Constraint vt v loc -> Bool #

(Var vt, Ord v) => Ord (Constraint vt v loc) Source # 
Instance details

Defined in Unison.PatternMatchCoverage.Constraint

Methods

compare :: Constraint vt v loc -> Constraint vt v loc -> Ordering #

(<) :: Constraint vt v loc -> Constraint vt v loc -> Bool #

(<=) :: Constraint vt v loc -> Constraint vt v loc -> Bool #

(>) :: Constraint vt v loc -> Constraint vt v loc -> Bool #

(>=) :: Constraint vt v loc -> Constraint vt v loc -> Bool #

max :: Constraint vt v loc -> Constraint vt v loc -> Constraint vt v loc #

min :: Constraint vt v loc -> Constraint vt v loc -> Constraint vt v loc #

prettyConstraint :: forall vt v loc. (Var vt, Var v) => PrettyPrintEnv -> Constraint vt v loc -> Pretty ColorText Source #