Portability | portable |
---|---|
Stability | provisional |
Portable Sindre gadgets and helper functions that can be used by any backend.
- mkHorizontally :: MonadBackend m => Constructor m
- mkVertically :: MonadBackend m => Constructor m
- changeFields :: MonadBackend im => [(Identifier, a -> Value)] -> (a -> ObjectM a im a) -> ObjectM a im ()
- data Match
- = ExactMatch
- | PrefixMatch
- | InfixMatch
- match :: Text -> Text -> Maybe Match
- filterMatches :: (a -> Text) -> Text -> [a] -> [a]
- sortMatches :: (a -> Text) -> Text -> [a] -> [a]
Documentation
mkHorizontally :: MonadBackend m => Constructor mSource
A widget that arranges its children in a horizontal row.
mkVertically :: MonadBackend m => Constructor mSource
A widget that arranges its children in a vertical column.
changeFields :: MonadBackend im => [(Identifier, a -> Value)] -> (a -> ObjectM a im a) -> ObjectM a im ()Source
changeFields fs m
applies m
to the state of the object,
replacing the state with the return value of m
. Value-changed
events are sent for each pair of field-name and accessor function
passed in fs
.
The result of using match
to apply a user-provided pattern to a
string.
filterMatches :: (a -> Text) -> Text -> [a] -> [a]Source
filterMatches f pat l
returns only those elements of l
that
match pat
, using f
to convert each element to a Text
. The
result will be ordered equivalently to l
sortMatches :: (a -> Text) -> Text -> [a] -> [a]Source
sortMatches f pat l
returns only those elements of l
that
match pat
, using f
to convert each element to a Text
. The
result will be reordered such that exact matches come first, then
prefixes, then infixes, although original order will be maintained
within these three groups.