miso
Copyright(C) 2016-2025 David M. Johnson
LicenseBSD3-style (see the file LICENSE)
MaintainerDavid M. Johnson <code@dmj.io>
Stabilityexperimental
Portabilitynon-portable
Safe HaskellSafe-Inferred
LanguageHaskell2010

Miso.Binding

Description

 
Synopsis

Types

data Binding parent child Source #

Binding is used to synchronize parent and child model changes at the granularity specified by a Lens

This can be thought of as establishing an "edge" in the Component graph, whereby events cause model change synchronization to "ripple" or "pulsate" through the views. The "reactivity" of the graph is constructed manually by the end-user, using the edge primitives -->, <--, <--> (reactive combinators).

main :: IO ()
main = run app { bindings = [ parentLens <--> childLens ] }

Since: 1.9.0.0

Constructors

ParentToChild (parent -> field) (field -> child -> child) 
ChildToParent (field -> parent -> parent) (child -> field) 
Bidirectional (parent -> field) (field -> parent -> parent) (child -> field) (field -> child -> child) 

Combinators

(<-->) :: Lens parent field -> Lens child field -> Binding parent child Source #

Bidirectionally binds a child field to a parent field, using Lens

This is a bidirectional reactive combinator for a miso Lens.

Since: 1.9.0.0

(<--) :: Lens parent a -> Lens model a -> Binding parent model Source #

Unidirectionally binds a child field to a parent field

Since: 1.9.0.0

(-->) :: Lens parent a -> Lens model a -> Binding parent model Source #

Unidirectionally binds a parent field to a child field

Since: 1.9.0.0

(<--->) :: Lens' parent field -> Lens' child field -> Binding parent child Source #

Bidirectionally binds a child field to a parent field, using Lens'

This is a bidirectional reactive combinator for a van Laarhoven Lens'

Since: 1.9.0.0

(<---) :: Lens' parent field -> Lens' child field -> Binding parent child Source #

Unidirectionally binds a child field to a parent field, for van Laarhoven style Lens'

Since: 1.9.0.0

(--->) :: Lens' parent field -> Lens' child field -> Binding parent child Source #

Unidirectionally binds a parent field to a child field, for van Laarhoven style Lens'

Since: 1.9.0.0