Module

Perspectives.Representation.ADT

An Algebraic Data Type to represent the type of roles with more than one type of binding. a invariably is a newtype representing entities on the type level of Perspectives. The dataconstructor ST is by construction used just with EnumeratedRoleType, never with CalculatedRoleType.

ADT's are constructed for ContextType, too.

Equivalences

  • SUM x EMPTY equals x

  • PROD x EMPTY equals EMPTY

#ADT

data ADT a

Constructors

Instances

#Reducible

class Reducible a b  where

The Reducible class implements a pattern to recursively process an ADT.

Members

Instances

  • Reducible EnumeratedRoleType Boolean

    Reduce an ADT EnumeratedRoleType with f :: EnumeratedRoleType -> MP Boolean Does not take the binding of a role into account.

  • (Eq b) => Reducible a (Array b)

    Reduce an ADT a with f :: a -> MP (Array b) Includes the binding of a role: this means that the computation recurses on the binding. This is expected behaviour for functions like propertiesOfADT, viewsOfADT and roleAspectsOfADT.

  • (Eq b) => Reducible a (ADT b)

    Reduce an ADT a with f :: a -> MP (ADT b). reduce f then has type ADT a -> MP (ADT b)`.

#greaterThanOrEqualTo

greaterThanOrEqualTo :: forall a. Eq a => ADT a -> ADT a -> Boolean

q greaterThanOrEqualTo p means: q is more specific than p, or equal to p If you use less specific instead of more specific, flip the arguments. If you use more general instead of more specific, flip them, too. So less specific instead of more general means flipping twice and is a no-op. Therefore less specific equals more general.

#lessThanOrEqualTo

lessThanOrEqualTo :: forall a. Eq a => ADT a -> ADT a -> Boolean

p lessThanOrEqualTo q means: p is less specific than q, or equal to q. p lessThanOrEqualTo q equals: q greaterThanOrEqualTo p This function is semantically correct only on a fully expanded type: use Perspectives.Representation.Class.Role.expandedADT.

Modules