Safe Haskell | None |
---|---|
Language | Haskell2010 |
- type family CommandOf w where ...
- type family ActionOf w where ...
- type family OutlineOf w where ...
- type family ModelOf w where ...
- type family PlanOf w where ...
- type SceneOf w = Scene (ModelOf w) (PlanOf w)
- type FrameOf w = Frame (ModelOf w) (PlanOf w)
- type GizmoOf w = Gizmo (ModelOf w) (PlanOf w)
- type WindowOf w = WindowT (SceneOf w) (ReactMlT Identity) ()
- type GadgetOf w = GadgetT (ActionOf w) (GizmoOf w) Identity (DList (CommandOf w))
- data WithGizmo
- data WithOutline
- type family SchemaType tag w where ...
- data Widget c a o m p where
- class (Disposing (ModelOf w), Disposing (PlanOf w), ToOutline (ModelOf w) (OutlineOf w)) => IsWidget w where
- mkGizmo :: IsWidget w => w -> ModelOf w -> F (Maker (ActionOf w)) (Gizmo (ModelOf w) (PlanOf w))
- mkGizmo' :: IsWidget w => w -> OutlineOf w -> F (Maker (ActionOf w)) (Gizmo (ModelOf w) (PlanOf w))
Documentation
data WithOutline Source #
tag used to choose Schema that contains Outlines
type family SchemaType tag w where ... Source #
You can't use type family as a type variable for a data type. The workaround is to use
a tag to choose between different type family functions.
ModelType takes a tag to choose between Gizmo or Outline.
This enables creating a data
type that can specialize to
using the tag.
SchemaType WithGizmo w = GizmoOf w | |
SchemaType WithOutline w = OutlineOf w |
data Widget c a o m p where Source #
Record of functions for a widget. Contains everything you need to make the model, render, and run the event processing. This is a GADT to enforce the Disposing and ToOutline constraints at the time of creating the Widget record.
class (Disposing (ModelOf w), Disposing (PlanOf w), ToOutline (ModelOf w) (OutlineOf w)) => IsWidget w where Source #
This typeclass is convenient as it carries the 'Disposing Model' and 'Disposing Plan' constraints
and allows treating 'Widget c a m p' as a type w
mkModel :: w -> OutlineOf w -> F (Maker (ActionOf w)) (ModelOf w) Source #
Make a Model from an Outline
mkPlan :: w -> Frame (ModelOf w) (PlanOf w) -> F (Maker (ActionOf w)) (PlanOf w) Source #
Given an empty frame, make the Plan that uses the frame for rendering
window :: w -> WindowT (Scene (ModelOf w) (PlanOf w)) (ReactMlT Identity) () Source #
Rendering function that uses the Scene of Model and Plan
gadget :: w -> GadgetT (ActionOf w) (Gizmo (ModelOf w) (PlanOf w)) Identity (DList (CommandOf w)) Source #
Update function that processes Action to update the Frame and Scene