web-rep-0.2.0: representations of a web page

Safe HaskellNone
LanguageHaskell2010

Web.Page.SharedReps

Synopsis

Documentation

repInput :: (Monad m, ToHtml a) => Parser a -> (a -> Text) -> Input a -> a -> SharedRep m a Source #

create a sharedRep from an Input

repMessage :: (Monad m, ToHtml a) => Parser a -> (a -> Text) -> Input a -> a -> a -> SharedRep m a Source #

does not put a value into the HashMap on instantiation, consumes the value when found in the HashMap, and substitutes a default on lookup failure

sliderI :: (Monad m, ToHtml a, Integral a, Show a) => Maybe Text -> a -> a -> a -> a -> SharedRep m a Source #

dropdown :: (Monad m, ToHtml a) => Parser a -> (a -> Text) -> Maybe Text -> [Text] -> a -> SharedRep m a Source #

dropdownSum :: (Monad m, ToHtml a) => Parser a -> (a -> Text) -> Maybe Text -> [Text] -> a -> SharedRep m a Source #

maybeRep :: Monad m => Maybe Text -> Bool -> SharedRep m a -> SharedRep m (Maybe a) Source #

represent a Maybe type using a checkbox hiding the underlying content on Nothing

fiddle :: Monad m => Concerns Text -> SharedRep m (Concerns Text, Bool) Source #

representation of web concerns (css, js & html)

viaFiddle :: Monad m => SharedRep m a -> SharedRep m (Bool, Concerns Text, a) Source #

turns a SharedRep into a fiddle

accordionList :: Monad m => Maybe Text -> Text -> Maybe Text -> (Text -> a -> SharedRep m a) -> [Text] -> [a] -> SharedRep m [a] Source #

a (fixed-size) list represented in html as an accordion card

listMaybeRep :: Monad m => Maybe Text -> Text -> (Text -> Maybe a -> SharedRep m (Maybe a)) -> Int -> [a] -> SharedRep m [Maybe a] Source #

a fixed-sized list of Maybe a's

listRep Source #

Arguments

:: Monad m 
=> Maybe Text 
-> Text 
-> (Bool -> SharedRep m Bool)

name prefix (should be unique)

-> (a -> SharedRep m a)

Bool Rep

-> Int

a Rep

-> a

maximum length of list

-> [a]

default value for new rows

-> SharedRep m [a]

initial values

a SharedRep of [a]. Due to the applicative nature of the bridge, the size of lists has to be fixed on construction. listRep is a workaround for this, to enable some form of dynamic sizing.