Module

Polyform.Field.Generic

#SingleChoice

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

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

#choices

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

#choiceParser

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

#MultiChoice

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

Members

Instances

#multiChoiceParser

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

Modules