threepenny-editors-0.5.3: Composable algebraic editors

Safe HaskellSafe
LanguageHaskell2010

Graphics.UI.Threepenny.Editors.Validation

Description

Simple helpers to perform validation of user input.

    -- update only if valid
    value <- accumB def updateIfValid userEdits

    -- collect validation warnings
    warnings <- stepper ok validate userEdits
  

Synopsis

Documentation

ok :: ValidationResult Source #

All is good

fromWarnings :: [String] -> ValidationResult Source #

Create a validation result from a list of warnings.

fromWarnings [] = ok

class Validable a where Source #

The class of values that support validation.

Minimal complete definition

validate

updateIfValid :: Validable a => a -> a -> a Source #