Module

Perspectives.CoreTypes

#RolInstances

#DomeinCache

#PerspectivesState

type PerspectivesState = CouchdbState (actionAssumptionCache :: ActionAssumptionCache, actionInstanceCache :: ActionInstanceCache, contextInstances :: ContextInstances, domeinCache :: DomeinCache, queryAssumptionRegister :: AssumptionRegister, rolInstances :: RolInstances, variableBindings :: Environment String)

#Assumption

type Assumption = Tuple String String

An Assumption is a combination of a resource (ContextInstance or RoleInstance) and a type (EnumeratedRoleType, CalculatedRoleType, EnumeratedPropertyType or CalculatedPropertyType). However, in the assumption administration we omit these newtypes.

#assumption

#AssumptionRegister

type AssumptionRegister = Object (Object (Array CorrelationIdentifier))

The AssumptionRegister is indexed by the two elements of an Assumption, in order. An instance of the AssumptionRegister is stored in PerspectivesState, so all functions operating on it must be run in MonadPerspectives. The CorrelationIdentifiers identify an effect and a query that depends (partly) on the assumption that it is registered with.

#ActionInstance

data ActionInstance

An ActionInstance represents the applicability of an Action to the instance of a Context.

Constructors

Instances

#ActionAssumptionCache

type ActionAssumptionCache = GLStrMap (GLStrMap (Array ActionInstance))

Actions should be re-run as the Assumptions underlying their computation change. We register the dependency of Actions for ContextInstances with a double registration that allows us to travel from Assumptions to ActionInstances and vice versa by simple lookup. The ActionAssumptionCache is indexed by the two elements of an Assumption, in order. It allows us to cache ActionInstances, signifying those that should be re-applied when an Assumption is touched.

#ActionInstanceCache

type ActionInstanceCache = GLStrMap (GLStrMap (Array Assumption))

The ActionInstanceCache is indexed by the two elements of the ActionInstance, unwrapped. So given an ActionInstance, we can look up the Assumptions used in its computations.

#MonadPerspectives

type MonadPerspectives = ReaderT (AVar PerspectivesState) Aff

MonadPerspectives is an instance of MonadAff. So, with liftAff we lift an operation in Aff to MonadPerspectives.

#ObjectsGetter

type ObjectsGetter s o = s -> MP (Array o)

#type (##>)

Operator alias for Perspectives.CoreTypes.ObjectsGetter (left-associative / precedence 0)

#TypeLevelResults

#TypeLevelGetter

#type (~~~>)

Operator alias for Perspectives.CoreTypes.TypeLevelGetter (left-associative / precedence 0)

#runTypeLevelToArray

runTypeLevelToArray :: forall s o. s -> (s ~~~> o) -> MonadPerspectives (Array o)

Run a TypeLevelGetter on its argument to obtain the Array of results in MonadPerspectives.

#(###=)

Operator alias for Perspectives.CoreTypes.runTypeLevelToArray (left-associative / precedence 1)

#runTypeLevelToMaybeObject

runTypeLevelToMaybeObject :: forall s o. s -> (s ~~~> o) -> (MonadPerspectives) (Maybe o)

#(###>)

Operator alias for Perspectives.CoreTypes.runTypeLevelToMaybeObject (non-associative / precedence 1)

#runTypeLevelToObject

runTypeLevelToObject :: forall s o. s -> (s ~~~> o) -> (MonadPerspectives) o

#(###>>)

Operator alias for Perspectives.CoreTypes.runTypeLevelToObject (non-associative / precedence 1)

#MonadPerspectivesQuery

type MonadPerspectivesQuery = ArrayT (WriterT (Array Assumption) MonadPerspectives)

The QueryEnvironment accumulates Assumptions.

#TrackingObjectsGetter

type TrackingObjectsGetter s o = s -> MPQ o

#type (~~>)

Operator alias for Perspectives.CoreTypes.TrackingObjectsGetter (left-associative / precedence 5)

#PropertyValueGetter

#ContextPropertyValueGetter

#runMonadPerspectivesQuery

runMonadPerspectivesQuery :: forall s o. s -> (s ~~> o) -> (MonadPerspectives (WithAssumptions o))

Run a TrackingObjectsGetter on its argument to obtain both the underlying assumptions and the Array of results in MonadPerspectives.

#WithAssumptions

#evalMonadPerspectivesQuery

evalMonadPerspectivesQuery :: forall s o. s -> (s ~~> o) -> (MonadPerspectives (Array o))

Apply a TrackingObjectsGetter to an argument to obtain an Array of results in MonadPerspectives.

#(##=)

Operator alias for Perspectives.CoreTypes.evalMonadPerspectivesQuery (non-associative / precedence 0)

#evalMonadPerspectivesQueryToMaybeObject

#(##>)

Operator alias for Perspectives.CoreTypes.evalMonadPerspectivesQueryToMaybeObject (non-associative / precedence 0)

#runMonadPerspectivesQueryToObject

#(##>>)

Operator alias for Perspectives.CoreTypes.runMonadPerspectivesQueryToObject (non-associative / precedence 0)

#MonadPerspectivesTransaction

type MonadPerspectivesTransaction = ArrayT (ReaderT (AVar Transaction) MonadPerspectives)

The Transaction accumulates Deltas.

Modules