Module

Halogen.Aff.Driver.State

#LifecycleHandlers

type LifecycleHandlers = { initializers :: List (Aff Unit), finalizers :: List (Aff Unit) }

#DriverState

newtype DriverState h r s f z g p i o

The type used to track a driver's persistent state.

  • h is the type of value the components produce for rendering.
  • r is the type for the render state for the driver.
  • s is the component state type.
  • f is the projected component query algebra - used for multi-child-type components, by projecting to z we can avoid the need to remap the entire component.
  • z is the unprojected component query algebra.
  • g is the component child query algebra.
  • p is the type of slots for the component.
  • i is the invput value type.
  • o is the type of output messages from the component.
  • eff is theect row for the target Aff

Constructors

#DriverStateRec

type DriverStateRec h r s f z g p i o = { component :: Component' h s z g p i o Aff, state :: s, refs :: Map String Element, children :: Map (OrdBox p) (Ref (DriverStateX h r g)), childrenIn :: Ref (Map (OrdBox p) (Ref (DriverStateX h r g))), childrenOut :: Ref (Map (OrdBox p) (Ref (DriverStateX h r g))), selfRef :: Ref (DriverState h r s f z g p i o), handler :: o -> Aff Unit, pendingQueries :: Ref (Maybe (List (Aff Unit))), pendingOuts :: Ref (Maybe (List (Aff Unit))), pendingHandlers :: Ref (Maybe (List (Aff Unit))), rendering :: Maybe (r s z g p o), prjQuery :: forall x. f x -> Maybe (z x), fresh :: Ref Int, subscriptions :: Ref (Maybe (Map Int (Aff Unit))), lifecycleHandlers :: Ref LifecycleHandlers }

#DriverStateX

data DriverStateX (h :: Type -> Type -> Type) (r :: Type -> (Type -> Type) -> (Type -> Type) -> Type -> Type -> Type) (f :: Type -> Type)

A version of DriverState with the aspects relating to child components existentially hidden.

#unDriverStateX

unDriverStateX :: forall h r f x. (forall s z g p i o. DriverStateRec h r s f z g p i o -> x) -> DriverStateX h r f -> x

#mkDriverStateXRef

mkDriverStateXRef :: forall h r s f z g p i o. Ref (DriverState h r s f z g p i o) -> Ref (DriverStateX h r f)

#RenderStateX

data RenderStateX (r :: Type -> (Type -> Type) -> (Type -> Type) -> Type -> Type -> Type)

A wrapper of r from DriverState with the aspects relating to child components existentially hidden.

#renderStateX

renderStateX :: forall m h r f. Functor m => (forall z s g p o. Maybe (r s z g p o) -> m (r s z g p o)) -> DriverStateX h r f -> m (RenderStateX r)

#renderStateX_

renderStateX_ :: forall m h r f. Applicative m => (forall z s g p o. r s z g p o -> m Unit) -> DriverStateX h r f -> m Unit

#unRenderStateX

unRenderStateX :: forall r x. (forall z s g p o. r s z g p o -> x) -> RenderStateX r -> x

#initDriverState

initDriverState :: forall h r s f z g p i o. Component' h s z g p i o Aff -> i -> (o -> Aff Unit) -> (forall x. f x -> Maybe (z x)) -> Ref LifecycleHandlers -> Effect (Ref (DriverStateX h r f))

Modules