Module

Formless.Transform.Record

Package
purescript-formless-aj
Repository
ajnsit/purescript-formless-independent

#UnwrapField Source

data UnwrapField

Unwrap every newtype in a record filled with newtypes

Constructors

Instances

#unwrapRecord Source

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

#WrapField Source

data WrapField

Wrap every field in a record with a particular newtype

Constructors

Instances

#wrapRecord Source

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

#unwrapOutputFields Source

unwrapOutputFields :: forall os' os form. 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 Source

wrapInputFields :: forall is' is form. 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 Source

wrapInputFunctions :: forall ifs' ifs form. 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