Module

Polyform.Field.Generic

Package
purescript-polyform
Repository
paluh/purescript-polyform

#SingleChoice Source

class SingleChoice choice  where

This type class provides basic way to transform simple sum type (constructors without args are only allowed) into: Validation and choices array which can be used in Choice record.

Members

Instances

#choice Source

choice :: forall choiceRep choice. Generic choice choiceRep => SingleChoice choiceRep => choice -> String

#choices Source

choices :: forall choiceRep choice. Generic choice choiceRep => SingleChoice choiceRep => Proxy choice -> List (Tuple String choice)

#choiceParser Source

choiceParser :: forall m choiceRep a. Monad m => Generic a choiceRep => SingleChoice choiceRep => Proxy a -> Validation m String String a

#MultiChoice Source

class MultiChoice c (c' :: Row Type) | c -> c' where

Members

Instances

#multiChoiceParser Source

multiChoiceParser :: forall m row choiceRep a. Monad m => Generic a choiceRep => MultiChoice choiceRep row => Proxy a -> Validation m (Array String) (Array String) { checkChoice :: a -> Boolean, product :: Record row }