Module
Toestand.Records
- Package
- purescript-toestand
- Repository
- garganscript/purescript-toestand
Utilities for generating focused boxes from boxes that contain records
#useFocusedFields Source
useFocusedFields :: forall l out base box c. RowToList c l => ReadWrite box (Record c) => UseFocusedFields l out base box => box -> Record base -> Hooks (Record out)
Given a Box (or other ReadWrite) which points at a record, create a new record where each field is another Box focused over the corresponding field in the original record.
#useFocusedFields' Source
useFocusedFields' :: forall l out base box c. RowToList c l => ReadWrite box (Record c) => UseFocusedFields l out base box => box -> Hooks (Builder (Record base) (Record out))
Builder-returning variant of useFocusedFields
#UseFocusedFields Source
class UseFocusedFields :: RowList Type -> Row Type -> Row Type -> Type -> Constraint
class UseFocusedFields (list :: RowList Type) (out :: Row Type) (base :: Row Type) box | list -> out base box where
Members
useFocusedFieldsImpl :: Proxy list -> box -> Hooks (Builder base out)
Instances
UseFocusedFields Nil base base box
(ReadWrite box (Record c), Cons label (Box a) out' out, Cons label a b c, Lacks label base, UseFocusedFields tail out' base box) => UseFocusedFields (Cons label a tail) out base box