Module
Formless.Class.Initial
- Package
- purescript-formless-aj
- Repository
- ajnsit/purescript-formless-independent
#Initial Source
class Initial v where
A type class that provides initial values for form fields. While superficially similar to
Haskell's Default
type class, this class is only meant for the purposes of defining
initial form values. If you need a default value for a field in your form, you are better
off defining it as a Maybe
field and providing a default as part of validation.
In general, if you find yourself reaching for this type class without defining your form as a row and generating your form spec from it, then you are probably not doing what you intend.
Members
initial :: v
Instances
Initial Unit
Initial Boolean
Initial Int
Initial Number
Initial String
Initial Ordering
Initial (Maybe a)
Initial (Array a)
Initial (List a)
(Ord k) => Initial (Map k v)
(Monoid b) => Initial (a -> b)
(Initial a, Initial b) => Initial (Tuple a b)
(RowToList row list, MonoidRecord list row row) => Initial (Record row)