glaze-0.3.0.1: Framework for rendering things with metadata/headers and values

Safe HaskellNone
LanguageHaskell2010

Glaze

Description

Framework for rendering things (or list of things, or things that contain things) that have metadata/header information as well as values.

Synopsis

Documentation

data Glaze a r Source #

Glaze is something that knows how to render some header information and given a value, how to render the value. Ie, the value has been glazeed with meta information.

Constructors

Glaze 

Fields

Instances

Functor (Glaze a) Source # 

Methods

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

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

Applicative (Glaze a) Source # 

Methods

pure :: a -> Glaze a a #

(<*>) :: Glaze a (a -> b) -> Glaze a a -> Glaze a b #

(*>) :: Glaze a a -> Glaze a b -> Glaze a b #

(<*) :: Glaze a a -> Glaze a b -> Glaze a a #

unglazeWith :: (r -> r -> b) -> Glaze a r -> a -> b Source #

Given a wrapping function for the meta and renderer value, and Glaze instructions for a, run them all together.

glazedA :: (Traversable t, Applicative m) => (wrapper -> meta -> t rs -> r) -> m wrapper -> m meta -> t (m rs) -> m r Source #

Lifts glazing function into an Applicative This is used to transform functions like glazeList into glazeListA

glazeList :: ([row] -> r, [field] -> row, [field] -> row) -> r -> [Glaze a field] -> Glaze [a] r Source #

This can be used to make a Glaze for a list of things to render as a table. Given (mainWrapper :: rows -> final render, headerRowWrapper:: fields -> header row, valueRowWrapper -> value row) the rendered meta, and a list of Glaze a columns to use, transform it to a Glaze for a list of as.

glazeListA :: Applicative f => f ([row] -> r, [field] -> row, [field] -> row) -> f r -> [f (Glaze a field)] -> f (Glaze [a] r) Source #

Applicative version of glazeList

glazeFields :: ([(b, b)] -> r) -> r -> [Glaze a b] -> Glaze a r Source #

This can be used to generate a Glaze for a larger supercomponent. Given (wrapper :: list of (meta, rendered value) to final render) the rendered meta, and a list of Glaze a field to use, transform it to a Glaze for a single a. In this case, use reglaze to generate Glaze a for each subcomponent to use as the list of Glaze a

glazeFieldsA :: Applicative f => f ([(b, b)] -> r) -> f r -> [f (Glaze a b)] -> f (Glaze a r) Source #

Applicative versino of glazeFields

reglaze :: Glaze a r -> Getter s a -> Glaze s r Source #

Makes a glaze of the type of a larger component, but only using the information of a smaller component. Given a Glaze and Lens into subcomponent a, create the glaze of the type of the larger component.

reglazeA :: Applicative f => f (Glaze a r) -> Getter s a -> f (Glaze s r) Source #

Applicative version of reglaze