Module

Formless.Transform.Record

#UnwrapField

data UnwrapField

Unwrap every newtype in a record filled with newtypes

Constructors

Instances

#unwrapRecord

unwrapRecord :: forall r0 r1. HMap UnwrapField r0 r1 => r0 -> r1

#WrapField

data WrapField

Wrap every field in a record with a particular newtype

Constructors

Instances

#wrapRecord

wrapRecord :: forall r0 r1. HMap WrapField r0 r1 => r0 -> r1

#unwrapOutputFields

unwrapOutputFields :: forall form os os'. Newtype (form Record OutputField) (Record os) => HMap UnwrapField (Record os) (Record os') => form Record OutputField -> Record os'

Provided your form type containing a record of only valid outputs from the result of validation, unwraps the form and every value in the record to provide a record of only the output values.

#wrapInputFields

wrapInputFields :: forall form is is'. Newtype (form Record InputField) (Record is') => HMap WrapField (Record is) (Record is') => Record is -> form Record InputField

Provided a record, where each field in the record contains a value of type input, wraps each value in the InputField type for compatibility with Formless

#wrapInputFunctions

wrapInputFunctions :: forall form ifs ifs'. Newtype (form Record InputFunction) (Record ifs') => HMap WrapField (Record ifs) (Record ifs') => Record ifs -> form Record InputFunction

Provided a record, where each field in the record contains a function from input -> input, wraps each function in the InputField type for compatibility with Formless

Modules