sindre-0.6: A programming language for simple GUIs
LicenseMIT-style (see LICENSE)
Stabilityprovisional
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

Sindre.Widgets

Description

Portable Sindre gadgets and helper functions that can be used by any backend.

Synopsis

Documentation

mkHorizontally :: MonadBackend m => Constructor m Source #

A widget that arranges its children in a horizontal row.

mkVertically :: MonadBackend m => Constructor m Source #

A widget that arranges its children in a vertical column.

changeField :: MonadFail im => FieldDesc s im v -> (v -> ObjectM s im v) -> ObjectM s im v Source #

changeField field m applies m to the current value of the field field, updates field with the value returned by m, and returns the new value.

changeField_ :: MonadFail im => FieldDesc s im v -> (v -> ObjectM s im v) -> ObjectM s im () Source #

Like changeField, but without a return value.

changingField :: (MonadBackend im, Mold v) => FieldDesc s im v -> ObjectM s im a -> ObjectM s im a Source #

changingFields fields m evaluates m, then emits field change events for those fields whose names are in fields that changed while evaluating m.

data Match Source #

The result of using match to apply a user-provided pattern to a string.

Instances

Instances details
Eq Match Source # 
Instance details

Defined in Sindre.Widgets

Methods

(==) :: Match -> Match -> Bool #

(/=) :: Match -> Match -> Bool #

Ord Match Source # 
Instance details

Defined in Sindre.Widgets

Methods

compare :: Match -> Match -> Ordering #

(<) :: Match -> Match -> Bool #

(<=) :: Match -> Match -> Bool #

(>) :: Match -> Match -> Bool #

(>=) :: Match -> Match -> Bool #

max :: Match -> Match -> Match #

min :: Match -> Match -> Match #

Show Match Source # 
Instance details

Defined in Sindre.Widgets

Methods

showsPrec :: Int -> Match -> ShowS #

show :: Match -> String #

showList :: [Match] -> ShowS #

match :: Text -> Text -> Maybe Match Source #

match pat s applies the pattern pat to s and returns a Match describing the kind of match if any, or Nothing otherwise. The pattern is interpreted as tokens delimited by whitespace, and each token must be present somewhere in s.

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.