Safe Haskell | None |
---|

- data Rec where
- type PlainRec rs = Rec rs Identity
- type LazyPlainRec rs = Rec rs LazyIdentity
- (=:) :: Applicative f => (sy ::: t) -> t -> Rec `[sy ::: t]` f
- (<+>) :: Rec as f -> Rec bs f -> Rec (as ++ bs) f
- (<-:) :: Applicative f => (sy ::: t) -> f t -> Rec `[sy ::: t]` f
- type family as (++) bs :: [*]
- fixRecord :: (forall f. Applicative f => Rec rs f) -> PlainRec rs

# Documentation

A record is parameterized by a list of fields and a functor to be applied to each of those fields.

(Storable t, Storable (PlainRec rs)) => Storable (PlainRec (: * (::: sy t) rs)) | |

Storable (PlainRec ([] *)) | |

Dist (Rec rs) | Records may be distributed to accumulate the effects of their fields. |

(Eq (g t), Eq (Rec fs g)) => Eq (Rec (: * (::: s t) fs) g) | |

Eq (Rec ([] *) f) | |

(SingI Symbol sy, Show (g t), Show (Rec fs g)) => Show (Rec (: * (::: sy t) fs) g) | |

Show (Rec ([] *) f) | |

(Monoid t, Monoid (Rec fs g), Applicative g) => Monoid (Rec (: * (::: s t) fs) g) | |

Monoid (Rec ([] *) f) | |

FoldRec (Rec ([] *) f) a | |

FoldRec (Rec fs g) (g t) => FoldRec (Rec (: * (::: s t) fs) g) (g t) | |

Apply (* -> *) (~> *) (Rec rs) | Records can be applied to each other. |

(~ * y (::: sy t), IElem * y xs, <: (Rec xs f) (Rec ys f)) => (Rec xs f) <: (Rec (: * y ys) f) | |

(Rec xs f) <: (Rec ([] *) f) |

type LazyPlainRec rs = Rec rs LazyIdentitySource

(=:) :: Applicative f => (sy ::: t) -> t -> Rec `[sy ::: t]` fSource

Shorthand for a record with a single field. Lifts the field's value into the chosen functor automatically.

(<-:) :: Applicative f => (sy ::: t) -> f t -> Rec `[sy ::: t]` fSource

Shorthand for a record with a single field of an `Applicative`

type. This is useful for `Applicative`

or `Monad`

ic intialization
of records as in the idiom:

dist $ myField <-: someIO <+> yourField <-: otherIO