glazier-react-0.6.0.0: ReactJS binding using Glazier and Pipes.Fluid

Safe HaskellNone
LanguageHaskell2010

Glazier.React.Widget

Synopsis

Documentation

type family CommandOf w where ... Source #

Equations

CommandOf (Widget c a o m p) = c 

type family ActionOf w where ... Source #

Equations

ActionOf (Widget c a o m p) = a 

type family OutlineOf w where ... Source #

Equations

OutlineOf (Widget c a o m p) = o 

type family ModelOf w where ... Source #

Equations

ModelOf (Widget c a o m p) = m 

type family PlanOf w where ... Source #

Equations

PlanOf (Widget c a o m p) = p 

type SceneOf w = Scene (ModelOf w) (PlanOf w) Source #

type FrameOf w = Frame (ModelOf w) (PlanOf w) Source #

type GizmoOf w = Gizmo (ModelOf w) (PlanOf w) Source #

data WithGizmo Source #

tag used to choose Schema that contains Gizmos

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.

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.

Constructors

Widget :: (Disposing m, Disposing p, ToOutline m o) => (o -> F (Maker a) m) -> (Frame m p -> F (Maker a) p) -> WindowT (Scene m p) (ReactMlT Identity) () -> GadgetT a (Gizmo m p) Identity (DList c) -> Widget c a o m p 

Instances

(Disposing m, Disposing p, ToOutline m o) => IsWidget (Widget c a o m p) Source # 

Methods

mkModel :: Widget c a o m p -> OutlineOf (Widget c a o m p) -> F (Maker (ActionOf (Widget c a o m p))) (ModelOf (Widget c a o m p)) Source #

mkPlan :: Widget c a o m p -> Frame (ModelOf (Widget c a o m p)) (PlanOf (Widget c a o m p)) -> F (Maker (ActionOf (Widget c a o m p))) (PlanOf (Widget c a o m p)) Source #

window :: Widget c a o m p -> WindowT (Scene (ModelOf (Widget c a o m p)) (PlanOf (Widget c a o m p))) (ReactMlT Identity) () Source #

gadget :: Widget c a o m p -> GadgetT (ActionOf (Widget c a o m p)) (Gizmo (ModelOf (Widget c a o m p)) (PlanOf (Widget c a o m p))) Identity (DList (CommandOf (Widget c a o m p))) Source #

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

Minimal complete definition

mkModel, mkPlan, window, gadget

Methods

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

Instances

(Disposing m, Disposing p, ToOutline m o) => IsWidget (Widget c a o m p) Source # 

Methods

mkModel :: Widget c a o m p -> OutlineOf (Widget c a o m p) -> F (Maker (ActionOf (Widget c a o m p))) (ModelOf (Widget c a o m p)) Source #

mkPlan :: Widget c a o m p -> Frame (ModelOf (Widget c a o m p)) (PlanOf (Widget c a o m p)) -> F (Maker (ActionOf (Widget c a o m p))) (PlanOf (Widget c a o m p)) Source #

window :: Widget c a o m p -> WindowT (Scene (ModelOf (Widget c a o m p)) (PlanOf (Widget c a o m p))) (ReactMlT Identity) () Source #

gadget :: Widget c a o m p -> GadgetT (ActionOf (Widget c a o m p)) (Gizmo (ModelOf (Widget c a o m p)) (PlanOf (Widget c a o m p))) Identity (DList (CommandOf (Widget c a o m p))) Source #

mkGizmo :: IsWidget w => w -> ModelOf w -> F (Maker (ActionOf w)) (Gizmo (ModelOf w) (PlanOf w)) Source #

Make the required Frame and Plan for a Model

mkGizmo' :: IsWidget w => w -> OutlineOf w -> F (Maker (ActionOf w)) (Gizmo (ModelOf w) (PlanOf w)) Source #

Make the required Frame and Plan from an Outline