threepenny-editors-0.2.0.9: Composable algebraic editors

Safe HaskellNone
LanguageHaskell2010

Graphics.UI.Threepenny.Editors

Contents

Synopsis

Editors

data Editor a Source #

A widget for editing values of type a.

Constructors

Editor 

Instances

Functor Editor Source # 

Methods

fmap :: (a -> b) -> Editor a -> Editor b #

(<$) :: a -> Editor b -> Editor a #

Widget (Editor a) Source # 

Methods

getElement :: Editor a -> Element #

data EditorFactory a b Source #

A newtype wrapper that provides a Profunctor instance.

Instances

Profunctor EditorFactory Source # 

Methods

dimap :: (a -> b) -> (c -> d) -> EditorFactory b c -> EditorFactory a d #

lmap :: (a -> b) -> EditorFactory b c -> EditorFactory a c #

rmap :: (b -> c) -> EditorFactory a b -> EditorFactory a c #

(#.) :: Coercible * c b => (b -> c) -> EditorFactory a b -> EditorFactory a c #

(.#) :: Coercible * b a => EditorFactory b c -> (a -> b) -> EditorFactory a c #

Functor (EditorFactory a) Source # 

Methods

fmap :: (a -> b) -> EditorFactory a a -> EditorFactory a b #

(<$) :: a -> EditorFactory a b -> EditorFactory a a #

Editor compoosition

(|*|) :: EditorFactory s (b -> a) -> EditorFactory s b -> EditorFactory s a infixl 4 Source #

(|*) :: EditorFactory s a -> UI Element -> EditorFactory s a infixl 5 Source #

(*|) :: UI Element -> EditorFactory s a -> EditorFactory s a infixl 5 Source #

(-*-) :: EditorFactory s (b -> a) -> EditorFactory s b -> EditorFactory s a infixl 4 Source #

(-*) :: EditorFactory s a -> UI Element -> EditorFactory s a infixl 5 Source #

(*-) :: UI Element -> EditorFactory s a -> EditorFactory s a infixl 5 Source #

field :: String -> (out -> inn) -> EditorFactory inn a -> EditorFactory out a Source #

A helper that arranges a label with the field name and the editor horizontally.

Editor constructors

editorSelection :: Ord a => Behavior [a] -> Behavior (a -> UI Element) -> EditorFactory (Maybe a) (Maybe a) Source #

An editor that presents a dynamic list of options

editorSum :: (Show tag, Ord tag) => [(tag, EditorFactory b b)] -> (b -> tag) -> EditorFactory b b Source #

An editor for union types, built from editors for its constructors.

editorJust :: EditorFactory (Maybe a) (Maybe a) -> EditorFactory a a Source #

Ignores Nothing values and only updates for Just values

Generic editors

editorGenericSimple :: forall a xs. (Generic a, HasDatatypeInfo a, All Editable xs, Code a ~ '[xs]) => EditorFactory a a Source #