data-validation-0.1.0.1: A library for creating type safe validations.

Safe HaskellSafe
LanguageHaskell2010

Data.Validation.Transforms

Synopsis
  • data V
  • data VM
  • type family VT v a b where ...

Documentation

data V Source #

A type that represents a validated type.

data VM Source #

A type that represents an unvalidated type, often called a View Model.

type family VT v a b where ... Source #

A type that represents a validation transformaion. The unvalidated type is the first parameter which is used when VM is passed in. The second parameter is the validated type which is used when V is passed in.

Examples

Expand

Basic usage:

data ThingV v 
  = Thing 
  { emailAddress :: VT v String EmailAddress
  , confirmEmailAddress :: VT v String () 
  }
type ThingVM = ThingV VM -- A Thing view model.
type Thing = ThingV V    -- A validated Thing.

Equations

VT V a b = b 
VT VM a b = a