Sparkle
- Package
- purescript-sparkle
- Repository
- sharkdp/purescript-sparkle
Sparkle is a library that automatically creates interactive user interfaces from type signatures.
#Flammable Source
class Flammable a where
A type class for data types that can be used for interactive Sparkle UIs. Instances for type
a
must provide a way to create a Flare UI which holds a value of type a
.
Members
Instances
Flammable Number
Flammable Int
Flammable String
Flammable Char
Flammable Boolean
(Flammable a, Flammable b) => Flammable (Tuple a b)
(Flammable a) => Flammable (Maybe a)
(Flammable a, Flammable b) => Flammable (Either a b)
Flammable Color
(RowToList row list, FlammableRowList list row) => Flammable (Record row)
Flammable NonNegativeInt
Flammable SmallInt
Flammable SmallNumber
Flammable Multiline
(BoundedEnum a, Show a) => Flammable (WrapEnum a)
(Flammable a) => Flammable (List a)
(Flammable a) => Flammable (Array a)
#FlammableRowList Source
class FlammableRowList (list :: RowList) (row :: Row Type) | list -> row where
A helper type class to implement a Flammable
instance for records.
Members
examplesRecord :: RLProxy list -> NonEmpty List (Record row)
sparkRecord :: forall e. RLProxy list -> UI e (Record row)
Instances
FlammableRowList Nil ()
(Flammable a, FlammableRowList listRest rowRest, RowLacks s rowRest, RowCons s a rowRest rowFull, RowToList rowFull (Cons s a listRest), IsSymbol s) => FlammableRowList (Cons s a listRest) rowFull
#NonNegativeInt Source
#SmallNumber Source
newtype SmallNumber
A newtype for numbers in the closed interval from 0.0 and 1.0.
Constructors
Instances
#WrapEnum Source
newtype WrapEnum a
Constructors
WrapEnum a
Instances
(BoundedEnum a, Show a) => Flammable (WrapEnum a)
(Generic a) => Interactive (WrapEnum a)
#Interactive Source
class Interactive t where
A type class for interactive UIs. Instances must provide a way to create a Flare UI which
returns a Renderable
output.
Members
interactive :: forall e. UI e t -> UI e Renderable
Instances
Interactive Number
Interactive Int
Interactive String
Interactive Char
Interactive Boolean
Interactive Ordering
Interactive GenericSpine
(Generic a) => Interactive (Maybe a)
(Generic a, Generic b) => Interactive (Either a b)
(Generic a, Generic b) => Interactive (Tuple a b)
(Generic a) => Interactive (Array a)
(Generic a) => Interactive (List a)
Interactive Color
(RowToList row list, PrettyPrintRowList list row) => Interactive (Record row)
(Generic a) => Interactive (WrapEnum a)
(Flammable a, Interactive b) => Interactive (a -> b)
#interactiveShow Source
interactiveShow :: forall e t. Show t => UI e t -> UI e Renderable
A default interactive
implementation for any Show
able type.
#interactiveFoldable Source
interactiveFoldable :: forall e a f. Foldable f => Generic a => UI e (f a) -> UI e Renderable
A default interactive
implementation for Foldable
types.
#interactiveGeneric Source
interactiveGeneric :: forall e a. Generic a => UI e a -> UI e Renderable
A default interactive
implementation for types with a Generic
instance.
#PrettyPrintRowList Source
class PrettyPrintRowList (list :: RowList) (row :: Row Type) | list -> row where
A helper type class to implement an Interactive
instance for records.
Members
Instances
PrettyPrintRowList Nil ()
(Generic a, PrettyPrintRowList listRest rowRest, RowLacks s rowRest, RowCons s a rowRest rowFull, RowToList rowFull (Cons s a listRest), IsSymbol s) => PrettyPrintRowList (Cons s a listRest) rowFull
#sparkleDoc' Source
sparkleDoc' :: forall e t. Interactive t => ElementId -> Label -> Maybe String -> t -> Eff (channel :: CHANNEL, dom :: DOM | e) Unit
Run an interactive test. The ID specifies the parent element to which the test will be appended and the label provides a title for the test. The String argument is an optional documentation string.
#sparkleDoc Source
sparkleDoc :: forall e t. Interactive t => Label -> Maybe String -> t -> Eff (channel :: CHANNEL, dom :: DOM | e) Unit
Run an interactive test. The label provides a title for the test. The String
argument is an
optional documentation string.
- Modules
- Sparkle