Module

Polyform.Field.Generic.Option

Package
purescript-polyform
Repository
paluh/purescript-polyform

#Nil Source

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 Source

data Cons (s :: Symbol) tail

Instances

#type (:-) Source

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

#DropOpt Source

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

Instances

#Elem Source

class Elem (n :: Symbol) l 

Instances

#option Source

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

#Option Source

data Option :: Type -> Type

Option is our symbol list carrier

Instances

#pop Source

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

#prepend Source

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

#case_ Source

case_ :: forall a. Option Nil -> a

#on Source

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

#prj Source

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

#choice Source

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

#choices Source

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

#choiceParser Source

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

#multiChoiceParser Source

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