| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Web.Hyperbole.HyperView.Types
Documentation
class (ViewId id, ViewAction (Action id)) => HyperView id (es :: [Effect]) where Source #
HyperViews are interactive subsections of a Page
Create an instance with a unique view id type and a sum type describing the actions the HyperView supports. The View Id can contain context (a database id, for example)
#EMBED ExampleDocsInteractive.hs data Message #EMBED ExampleDocsInteractive.hs instance HyperView Message es where
Associated Types
Outline all actions that are permitted in this HyperView
data Action Message = SetMessage Text | ClearMessage deriving (Generic, ViewAction)
type Require id :: [Type] Source #
Include any child hyperviews here. The compiler will make sure that the page knows how to handle them
type Require = '[ChildView]
Methods
update :: Action id -> Eff (Reader id ': es) (View id ()) Source #
Specify how the view should be updated for each Action
update (SetMessage msg) = pure $ messageView msg update ClearMessage = pure $ messageView ""
Instances
| HyperView (Root views) es Source # | |||||||||
Defined in Web.Hyperbole.HyperView.Types Associated Types
| |||||||||
data Root (views :: [Type]) Source #
The top-level view returned by a Page. It carries a type-level list of every HyperView used in our Page so the compiler can check our work and wire everything together.
Constructors
| Root |
Instances
| Generic (Action (Root views)) Source # | |||||||||
Defined in Web.Hyperbole.HyperView.Types | |||||||||
| Generic (Root views) Source # | |||||||||
Defined in Web.Hyperbole.HyperView.Types | |||||||||
| ViewAction (Action (Root views)) Source # | |||||||||
| ViewId (Root views) Source # | |||||||||
| HyperView (Root views) es Source # | |||||||||
Defined in Web.Hyperbole.HyperView.Types Associated Types
| |||||||||
| type Rep (Action (Root views)) Source # | |||||||||
| type Rep (Root views) Source # | |||||||||
| data Action (Root views) Source # | |||||||||
Defined in Web.Hyperbole.HyperView.Types | |||||||||
| type Require (Root views) Source # | |||||||||
Defined in Web.Hyperbole.HyperView.Types | |||||||||