Module
Polyform.Form.Component
- Package
- purescript-polyform
- Repository
- paluh/purescript-polyform
#Component Source
newtype Component m form i o
Tiny wrapper around validation which also carries default "form" value.
Constructors
Component { default :: form, validation :: Validation m form i o }
Instances
Newtype (Component m e a b) _
(Functor m) => Functor (Component m e a)
(Semigroup e, Monad m) => Apply (Component m e a)
(Monoid e, Monad m) => Applicative (Component m e a)
(Monoid e, Monad m) => Alt (Component m e a)
(Monad m, Semigroup e) => Semigroupoid (Component m e)
(Monad m, Monoid e) => Category (Component m e)
(Monad m, Monoid e) => Profunctor (Component m e)
#runValidation Source
runValidation :: forall m o i form. Component m form i o -> (i -> m (V form o))
#fromValidation Source
fromValidation :: forall m e b a. Monoid e => Validation m e a b -> Component m e a b
#fromField Source
fromField :: forall v q m form e attrs. Monad m => ({ value :: V e v | attrs } -> form) -> { value :: V e v | attrs } -> Validation m e q v -> Component m form q v
Simple helper which combines basic pieces into Component
:
- form constructor (I could use
Applicative.pure
but it seems a bit to heavy constraint ;-)) - default field value
- validation
#fromFieldCoerce Source
fromFieldCoerce :: forall v' v q m form e attrs. Monad m => (v -> v') -> ({ value :: V e v | attrs } -> form) -> { value :: V e v | attrs } -> Validation m e q v -> Component m form q v'
Longer version of previous one which allows coersion of field level value into form level value.
- Modules
- Polyform.
Field - Polyform.
Field. Generic - Polyform.
Field. Generic. Option - Polyform.
Field. Html5 - Polyform.
Field. Validation. Combinators - Polyform.
Form. Component - Polyform.
Input. Foreign - Polyform.
Input. Http - Polyform.
Input. Interpret - Polyform.
Input. Interpret. Http - Polyform.
Input. Interpret. Record - Polyform.
Input. Interpret. Validation - Polyform.
Validation - Polyform.
Validation. Par