Module
MVC.Variant
- Package
- purescript-mvc
- Repository
- thought2/purescript-mvc
Re-exports from MVC.Variant.Types
#VariantState Source
newtype VariantState :: Row Type -> Type
newtype VariantState r
Constructors
VariantState (Variant r)
Instances
Newtype (VariantState r) _
Generic (VariantState r) _
(RowToList r rl, VariantTags rl, VariantShows rl) => Show (VariantState r)
(RowToList r rl, VariantTags rl, VariantEqs rl) => Eq (VariantState r)
#VariantMsg Source
data VariantMsg :: Row Type -> Row Type -> Type
data VariantMsg rcase rmsg
Constructors
ChildCaseMsg (Variant rmsg)
ChangeCase (Variant rcase)
ErrMsg String
Instances
Generic (VariantMsg rcase rmsg) _
(RowToList rcase rlcase, RowToList rmsg rlmsg, VariantTags rlcase, VariantTags rlmsg, VariantShows rlcase, VariantShows rlmsg) => Show (VariantMsg rcase rmsg)
(RowToList rcase rlcase, RowToList rmsg rlmsg, VariantTags rlcase, VariantTags rlmsg, VariantEqs rlcase, VariantEqs rlmsg) => Eq (VariantMsg rcase rmsg)
Re-exports from MVC.Variant.Update
#MatchCase Source
#MatchCaseRL Source
class MatchCaseRL :: RowList Type -> Row Type -> Row Type -> Row Type -> Constraint
class MatchCaseRL (rl :: RowList Type) (rcase :: Row Type) (initstates :: Row Type) (rsta :: Row Type) | rl -> rcase where
Members
matchCaseRL :: Proxy rl -> Record initstates -> Variant rcase -> Variant rsta
Instances
MatchCaseRL Nil () initstates rsta
(Cons sym sta rstax rsta, Cons sym sta initstatesx initstates, Cons sym Unit rcase' rcase, Lacks sym rcase', MatchCaseRL rl' rcase' initstates rsta, IsSymbol sym) => MatchCaseRL (Cons sym x rl') rcase initstates rsta
#UpdateVariant Source
class UpdateVariant :: Row Type -> Row Type -> Row Type -> Row Type -> Row Type -> Constraint
class UpdateVariant (initstates :: Row Type) (updates :: Row Type) (rcase :: Row Type) (rmsg :: Row Type) (rsta :: Row Type) where
Members
updateVariant :: Record initstates -> Record updates -> (VariantMsg rcase rmsg -> VariantState rsta -> VariantState rsta)
Instances
(UpdateVariantRL rl updates rmsg rsta, RowToList updates rl, MatchCase rcase initstates rsta) => UpdateVariant initstates updates rcase rmsg rsta
#UpdateVariantRL Source
class UpdateVariantRL :: RowList Type -> Row Type -> Row Type -> Row Type -> Constraint
class UpdateVariantRL (rl :: RowList Type) (updates :: Row Type) (rmsg :: Row Type) (rsta :: Row Type) | rl -> rsta where
Members
Instances
UpdateVariantRL Nil updates rmsg ()
(Cons sym (msg -> sta -> sta) updatesx updates, Cons sym msg rmsgx rmsg, Cons sym sta rsta' rsta, Lacks sym rsta', Lacks sym updatesx, UpdateVariantRL rl' updates rmsg rsta', IsSymbol sym, Union rsta' rstax rsta, RowToList rsta msgRL) => UpdateVariantRL (Cons sym x rl') updates rmsg rsta
Re-exports from MVC.Variant.View
#ViewVariantProps Source
type ViewVariantProps :: (Type -> Type) -> Type
type ViewVariantProps html = { view :: forall msg. ViewArgs html msg -> html msg }
#CaseKeyToVariant Source
class CaseKeyToVariant :: Row Type -> Constraint
class CaseKeyToVariant (rcase :: Row Type) where
Members
caseKeyToVariant :: CaseKey -> Maybe (Variant rcase)
Instances
(CaseKeyToVariantRL rl rcase, RowToList rcase rl) => CaseKeyToVariant rcase
#CaseKeyToVariantRL Source
class CaseKeyToVariantRL :: RowList Type -> Row Type -> Constraint
class CaseKeyToVariantRL (rl :: RowList Type) (rcase :: Row Type) | rl -> rcase where
Members
caseKeyToVariantRL :: Proxy rl -> CaseKey -> Maybe (Variant rcase)
Instances
CaseKeyToVariantRL Nil ()
(CaseKeyToVariantRL rl' rcase', Cons sym Unit rcase' rcase, Lacks sym rcase', IsSymbol sym, Union rcase' rcasex rcase) => CaseKeyToVariantRL (Cons sym x rl') rcase
#GetSymRL Source
#ViewVariant Source
class ViewVariant :: (Type -> Type) -> Row Type -> Row Type -> Row Type -> Row Type -> Constraint
class ViewVariant (html :: Type -> Type) (views :: Row Type) (rcase :: Row Type) (rmsg :: Row Type) (rsta :: Row Type) where
Members
viewVariant :: ViewVariantProps html -> (Record views -> VariantState rsta -> html (VariantMsg rcase rmsg))
Instances
(ViewVariantRL rl html views rmsg rsta, RowToList views rl, CaseKeyToVariant rcase, Functor html, GetKeys rl, GetSym rsta) => ViewVariant html views rcase rmsg rsta
#ViewVariantRL Source
class ViewVariantRL :: RowList Type -> (Type -> Type) -> Row Type -> Row Type -> Row Type -> Constraint
class ViewVariantRL (rl :: RowList Type) (html :: Type -> Type) (views :: Row Type) (rmsg :: Row Type) (rsta :: Row Type) | rl -> rmsg rsta where
Members
viewVariantRL :: Proxy rl -> Record views -> Variant rsta -> html (Variant rmsg)
Instances
ViewVariantRL Nil html views () ()
(ViewVariantRL rl' html views rmsg' rsta', Cons sym msg rmsg' rmsg, Cons sym sta rsta' rsta, Cons sym (sta -> html msg) viewsx views, Lacks sym rmsg', Lacks sym rsta', Functor html, IsSymbol sym, Union rmsg' rmsgx rmsg) => ViewVariantRL (Cons sym x rl') html views rmsg rsta