Module
Data.Homogeneous
- Package
- purescript-homogeneous
- Repository
- paluh/purescript-homogeneous
#ListToHomogeneous Source
class ListToHomogeneous :: forall k. RowList Type -> k -> Row Type -> Constraint
class ListToHomogeneous (rl :: RowList Type) a (r :: Row Type) | rl a -> r
Fold a RowList
into a row but use a
type
to fill all values type.
Instances
ListToHomogeneous Nil a ()
(Cons l a ls_ ls, ListToHomogeneous t a ls_) => ListToHomogeneous (Cons l b t) a ls
#HomogeneousRowLabels Source
class HomogeneousRowLabels :: forall a b. Row a -> a -> Row b -> Constraint
class HomogeneousRowLabels r a ls | r -> a ls
We provide two different versions of constraints so you can get your homogeneous row from labels and value type alone and you can get labels and value type just from row. This can be useful when we don't know the type of the row yet etc.
Instances
(RowToList r rl, ListToHomogeneous rl Void ls, Homogeneous r a) => HomogeneousRowLabels r a ls
#ToHomogeneousRow Source
class ToHomogeneousRow :: forall a b. Row a -> b -> Row b -> Constraint
class ToHomogeneousRow ls b r | ls b -> r
Instances
(RowToList ls ll, ToHomogeneousRow' ll a r) => ToHomogeneousRow ls a r
#ToHomogeneousRow' Source
class ToHomogeneousRow' :: forall a b. RowList a -> b -> Row b -> Constraint
class ToHomogeneousRow' ll b r | ll b -> r
Instances
ToHomogeneousRow' Nil a ()
(Cons h a r_ r, ToHomogeneousRow' t a r_) => ToHomogeneousRow' (Cons h b t) a r