Module

Polyform.Field.Generic.Option

#Nil

data Nil

"Custom sum" type (heavly inspired by (or ripped from) purescript-variant internals) which allows you to easily provide options (together with order) for you Choice/Multichoice fields "without" defining dedicated type.

Instances

#Cons

data Cons (s :: Symbol) tail

Instances

#type (:-)

Operator alias for Polyform.Field.Generic.Option.Cons (right-associative / precedence 8)

#DropOpt

class DropOpt (s :: Symbol) opts opts' | s opts -> opts'

Instances

#Elem

class Elem (n :: Symbol) l 

Instances

#option

option :: forall opt opts. Elem opt opts => IsSymbol opt => SProxy opt -> Option opts

#Option

data Option :: Type -> Type

Option is our symbol list carrier

Instances

#pop

pop :: forall f opts opts' sym. Alternative f => IsSymbol sym => DropOpt sym opts opts' => SProxy sym -> Option opts -> f (Option opts')

#prepend

prepend :: forall opts sym. SProxy sym -> Option opts -> Option (sym :- opts)

#case_

case_ :: forall a. Option Nil -> a

#on

on :: forall a opts opts' sym. IsSymbol sym => DropOpt sym opts opts' => SProxy sym -> a -> (Option opts' -> a) -> Option opts -> a

#prj

prj :: forall a opts opts' f sym. IsSymbol sym => DropOpt sym opts opts' => Alternative f => SProxy sym -> Option opts -> f a

#choice

choice :: forall opt. SingleChoice (Option opt) => Option opt -> String

#choices

choices :: forall opt. SingleChoice (Option opt) => Proxy opt -> List (Tuple String (Option opt))

#choiceParser

choiceParser :: forall m opt. Monad m => SingleChoice (Option opt) => Proxy opt -> Validation m String String (Option opt)

#multiChoiceParser

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

Modules