Copyright | (C) 2020 Csongor Kiss |
---|---|
License | BSD3 |
Maintainer | Csongor Kiss <kiss.csongor.kiss@gmail.com> |
Stability | experimental |
Portability | non-portable |
Safe Haskell | None |
Language | Haskell2010 |
Data.Generics.Product.Internal.HList
Description
Derive an isomorphism between a product type and a flat HList.
Documentation
class GIsList (f :: Type -> Type) (g :: Type -> Type) (as :: [Type]) (bs :: [Type]) | f -> as, g -> bs, bs f -> g, as g -> f where #
Instances
GIsList (U1 :: Type -> Type) (U1 :: Type -> Type) ('[] :: [Type]) ('[] :: [Type]) # | |
GIsList (Rec0 a) (Rec0 b) '[a] '[b] # | |
(GIsList l l' as as', GIsList r r' bs bs', Appending as bs cs as' bs' cs', cs ~ (as ++ bs), cs' ~ (as' ++ bs')) => GIsList (l :*: r) (l' :*: r') cs cs' # | |
GIsList f g as bs => GIsList (M1 t meta f) (M1 t meta g) as bs # | |
class IndexList (i :: Nat) (as :: [Type]) (bs :: [Type]) a b | i as -> a, i bs -> b, i as b -> bs, i bs a -> as where #
data HList (as :: [Type]) where #
Constructors
Nil :: HList ('[] :: [Type]) | |
(:>) :: forall a (as1 :: [Type]). a -> HList as1 -> HList (a ': as1) infixr 5 |
class ListTuple tuple tuple' (as :: [Type]) (bs :: [Type]) | as -> tuple, bs -> tuple' where #
Minimal complete definition
Methods
tupled :: Iso (HList as) (HList bs) tuple tuple' #
tupleToList :: tuple' -> HList bs #
listToTuple :: HList as -> tuple #
Instances
ListTuple () () ('[] :: [Type]) ('[] :: [Type]) # | |
ListTuple a a' '[a] '[a'] # | |
Defined in Data.Generics.Product.Internal.HList | |
ListTuple (a1, b1) (a2, b2) '[a1, b1] '[a2, b2] # | |
Defined in Data.Generics.Product.Internal.HList | |
ListTuple (a1, b1, c1) (a2, b2, c2) '[a1, b1, c1] '[a2, b2, c2] # | |
Defined in Data.Generics.Product.Internal.HList | |
ListTuple (a1, b1, c1, d1) (a2, b2, c2, d2) '[a1, b1, c1, d1] '[a2, b2, c2, d2] # | |
Defined in Data.Generics.Product.Internal.HList | |
ListTuple (a1, b1, c1, d1, e1) (a2, b2, c2, d2, e2) '[a1, b1, c1, d1, e1] '[a2, b2, c2, d2, e2] # | |
Defined in Data.Generics.Product.Internal.HList | |
ListTuple (a1, b1, c1, d1, e1, f1) (a2, b2, c2, d2, e2, f2) '[a1, b1, c1, d1, e1, f1] '[a2, b2, c2, d2, e2, f2] # | |
Defined in Data.Generics.Product.Internal.HList | |
ListTuple (a1, b1, c1, d1, e1, f1, g1) (a2, b2, c2, d2, e2, f2, g2) '[a1, b1, c1, d1, e1, f1, g1] '[a2, b2, c2, d2, e2, f2, g2] # | |
Defined in Data.Generics.Product.Internal.HList Methods tupled :: Iso (HList '[a1, b1, c1, d1, e1, f1, g1]) (HList '[a2, b2, c2, d2, e2, f2, g2]) (a1, b1, c1, d1, e1, f1, g1) (a2, b2, c2, d2, e2, f2, g2) # tupleToList :: (a2, b2, c2, d2, e2, f2, g2) -> HList '[a2, b2, c2, d2, e2, f2, g2] # listToTuple :: HList '[a1, b1, c1, d1, e1, f1, g1] -> (a1, b1, c1, d1, e1, f1, g1) # | |
ListTuple (a1, b1, c1, d1, e1, f1, g1, h1) (a2, b2, c2, d2, e2, f2, g2, h2) '[a1, b1, c1, d1, e1, f1, g1, h1] '[a2, b2, c2, d2, e2, f2, g2, h2] # | |
Defined in Data.Generics.Product.Internal.HList Methods tupled :: Iso (HList '[a1, b1, c1, d1, e1, f1, g1, h1]) (HList '[a2, b2, c2, d2, e2, f2, g2, h2]) (a1, b1, c1, d1, e1, f1, g1, h1) (a2, b2, c2, d2, e2, f2, g2, h2) # tupleToList :: (a2, b2, c2, d2, e2, f2, g2, h2) -> HList '[a2, b2, c2, d2, e2, f2, g2, h2] # listToTuple :: HList '[a1, b1, c1, d1, e1, f1, g1, h1] -> (a1, b1, c1, d1, e1, f1, g1, h1) # | |
ListTuple (a1, b1, c1, d1, e1, f1, g1, h1, j1) (a2, b2, c2, d2, e2, f2, g2, h2, j2) '[a1, b1, c1, d1, e1, f1, g1, h1, j1] '[a2, b2, c2, d2, e2, f2, g2, h2, j2] # | |
Defined in Data.Generics.Product.Internal.HList Methods tupled :: Iso (HList '[a1, b1, c1, d1, e1, f1, g1, h1, j1]) (HList '[a2, b2, c2, d2, e2, f2, g2, h2, j2]) (a1, b1, c1, d1, e1, f1, g1, h1, j1) (a2, b2, c2, d2, e2, f2, g2, h2, j2) # tupleToList :: (a2, b2, c2, d2, e2, f2, g2, h2, j2) -> HList '[a2, b2, c2, d2, e2, f2, g2, h2, j2] # listToTuple :: HList '[a1, b1, c1, d1, e1, f1, g1, h1, j1] -> (a1, b1, c1, d1, e1, f1, g1, h1, j1) # | |
ListTuple (a1, b1, c1, d1, e1, f1, g1, h1, j1, k1) (a2, b2, c2, d2, e2, f2, g2, h2, j2, k2) '[a1, b1, c1, d1, e1, f1, g1, h1, j1, k1] '[a2, b2, c2, d2, e2, f2, g2, h2, j2, k2] # | |
Defined in Data.Generics.Product.Internal.HList Methods tupled :: Iso (HList '[a1, b1, c1, d1, e1, f1, g1, h1, j1, k1]) (HList '[a2, b2, c2, d2, e2, f2, g2, h2, j2, k2]) (a1, b1, c1, d1, e1, f1, g1, h1, j1, k1) (a2, b2, c2, d2, e2, f2, g2, h2, j2, k2) # tupleToList :: (a2, b2, c2, d2, e2, f2, g2, h2, j2, k2) -> HList '[a2, b2, c2, d2, e2, f2, g2, h2, j2, k2] # listToTuple :: HList '[a1, b1, c1, d1, e1, f1, g1, h1, j1, k1] -> (a1, b1, c1, d1, e1, f1, g1, h1, j1, k1) # | |
ListTuple (a1, b1, c1, d1, e1, f1, g1, h1, j1, k1, l1) (a2, b2, c2, d2, e2, f2, g2, h2, j2, k2, l2) '[a1, b1, c1, d1, e1, f1, g1, h1, j1, k1, l1] '[a2, b2, c2, d2, e2, f2, g2, h2, j2, k2, l2] # | |
Defined in Data.Generics.Product.Internal.HList Methods tupled :: Iso (HList '[a1, b1, c1, d1, e1, f1, g1, h1, j1, k1, l1]) (HList '[a2, b2, c2, d2, e2, f2, g2, h2, j2, k2, l2]) (a1, b1, c1, d1, e1, f1, g1, h1, j1, k1, l1) (a2, b2, c2, d2, e2, f2, g2, h2, j2, k2, l2) # tupleToList :: (a2, b2, c2, d2, e2, f2, g2, h2, j2, k2, l2) -> HList '[a2, b2, c2, d2, e2, f2, g2, h2, j2, k2, l2] # listToTuple :: HList '[a1, b1, c1, d1, e1, f1, g1, h1, j1, k1, l1] -> (a1, b1, c1, d1, e1, f1, g1, h1, j1, k1, l1) # | |
ListTuple (a1, b1, c1, d1, e1, f1, g1, h1, j1, k1, l1, m1) (a2, b2, c2, d2, e2, f2, g2, h2, j2, k2, l2, m2) '[a1, b1, c1, d1, e1, f1, g1, h1, j1, k1, l1, m1] '[a2, b2, c2, d2, e2, f2, g2, h2, j2, k2, l2, m2] # | |
Defined in Data.Generics.Product.Internal.HList Methods tupled :: Iso (HList '[a1, b1, c1, d1, e1, f1, g1, h1, j1, k1, l1, m1]) (HList '[a2, b2, c2, d2, e2, f2, g2, h2, j2, k2, l2, m2]) (a1, b1, c1, d1, e1, f1, g1, h1, j1, k1, l1, m1) (a2, b2, c2, d2, e2, f2, g2, h2, j2, k2, l2, m2) # tupleToList :: (a2, b2, c2, d2, e2, f2, g2, h2, j2, k2, l2, m2) -> HList '[a2, b2, c2, d2, e2, f2, g2, h2, j2, k2, l2, m2] # listToTuple :: HList '[a1, b1, c1, d1, e1, f1, g1, h1, j1, k1, l1, m1] -> (a1, b1, c1, d1, e1, f1, g1, h1, j1, k1, l1, m1) # | |
ListTuple (a1, b1, c1, d1, e1, f1, g1, h1, j1, k1, l1, m1, n1) (a2, b2, c2, d2, e2, f2, g2, h2, j2, k2, l2, m2, n2) '[a1, b1, c1, d1, e1, f1, g1, h1, j1, k1, l1, m1, n1] '[a2, b2, c2, d2, e2, f2, g2, h2, j2, k2, l2, m2, n2] # | |
Defined in Data.Generics.Product.Internal.HList Methods tupled :: Iso (HList '[a1, b1, c1, d1, e1, f1, g1, h1, j1, k1, l1, m1, n1]) (HList '[a2, b2, c2, d2, e2, f2, g2, h2, j2, k2, l2, m2, n2]) (a1, b1, c1, d1, e1, f1, g1, h1, j1, k1, l1, m1, n1) (a2, b2, c2, d2, e2, f2, g2, h2, j2, k2, l2, m2, n2) # tupleToList :: (a2, b2, c2, d2, e2, f2, g2, h2, j2, k2, l2, m2, n2) -> HList '[a2, b2, c2, d2, e2, f2, g2, h2, j2, k2, l2, m2, n2] # listToTuple :: HList '[a1, b1, c1, d1, e1, f1, g1, h1, j1, k1, l1, m1, n1] -> (a1, b1, c1, d1, e1, f1, g1, h1, j1, k1, l1, m1, n1) # | |
ListTuple (a1, b1, c1, d1, e1, f1, g1, h1, j1, k1, l1, m1, n1, o1) (a2, b2, c2, d2, e2, f2, g2, h2, j2, k2, l2, m2, n2, o2) '[a1, b1, c1, d1, e1, f1, g1, h1, j1, k1, l1, m1, n1, o1] '[a2, b2, c2, d2, e2, f2, g2, h2, j2, k2, l2, m2, n2, o2] # | |
Defined in Data.Generics.Product.Internal.HList Methods tupled :: Iso (HList '[a1, b1, c1, d1, e1, f1, g1, h1, j1, k1, l1, m1, n1, o1]) (HList '[a2, b2, c2, d2, e2, f2, g2, h2, j2, k2, l2, m2, n2, o2]) (a1, b1, c1, d1, e1, f1, g1, h1, j1, k1, l1, m1, n1, o1) (a2, b2, c2, d2, e2, f2, g2, h2, j2, k2, l2, m2, n2, o2) # tupleToList :: (a2, b2, c2, d2, e2, f2, g2, h2, j2, k2, l2, m2, n2, o2) -> HList '[a2, b2, c2, d2, e2, f2, g2, h2, j2, k2, l2, m2, n2, o2] # listToTuple :: HList '[a1, b1, c1, d1, e1, f1, g1, h1, j1, k1, l1, m1, n1, o1] -> (a1, b1, c1, d1, e1, f1, g1, h1, j1, k1, l1, m1, n1, o1) # | |
ListTuple (a1, b1, c1, d1, e1, f1, g1, h1, j1, k1, l1, m1, n1, o1, p1) (a2, b2, c2, d2, e2, f2, g2, h2, j2, k2, l2, m2, n2, o2, p2) '[a1, b1, c1, d1, e1, f1, g1, h1, j1, k1, l1, m1, n1, o1, p1] '[a2, b2, c2, d2, e2, f2, g2, h2, j2, k2, l2, m2, n2, o2, p2] # | |
Defined in Data.Generics.Product.Internal.HList Methods tupled :: Iso (HList '[a1, b1, c1, d1, e1, f1, g1, h1, j1, k1, l1, m1, n1, o1, p1]) (HList '[a2, b2, c2, d2, e2, f2, g2, h2, j2, k2, l2, m2, n2, o2, p2]) (a1, b1, c1, d1, e1, f1, g1, h1, j1, k1, l1, m1, n1, o1, p1) (a2, b2, c2, d2, e2, f2, g2, h2, j2, k2, l2, m2, n2, o2, p2) # tupleToList :: (a2, b2, c2, d2, e2, f2, g2, h2, j2, k2, l2, m2, n2, o2, p2) -> HList '[a2, b2, c2, d2, e2, f2, g2, h2, j2, k2, l2, m2, n2, o2, p2] # listToTuple :: HList '[a1, b1, c1, d1, e1, f1, g1, h1, j1, k1, l1, m1, n1, o1, p1] -> (a1, b1, c1, d1, e1, f1, g1, h1, j1, k1, l1, m1, n1, o1, p1) # | |
ListTuple (a1, b1, c1, d1, e1, f1, g1, h1, j1, k1, l1, m1, n1, o1, p1, q1) (a2, b2, c2, d2, e2, f2, g2, h2, j2, k2, l2, m2, n2, o2, p2, q2) '[a1, b1, c1, d1, e1, f1, g1, h1, j1, k1, l1, m1, n1, o1, p1, q1] '[a2, b2, c2, d2, e2, f2, g2, h2, j2, k2, l2, m2, n2, o2, p2, q2] # | |
Defined in Data.Generics.Product.Internal.HList Methods tupled :: Iso (HList '[a1, b1, c1, d1, e1, f1, g1, h1, j1, k1, l1, m1, n1, o1, p1, q1]) (HList '[a2, b2, c2, d2, e2, f2, g2, h2, j2, k2, l2, m2, n2, o2, p2, q2]) (a1, b1, c1, d1, e1, f1, g1, h1, j1, k1, l1, m1, n1, o1, p1, q1) (a2, b2, c2, d2, e2, f2, g2, h2, j2, k2, l2, m2, n2, o2, p2, q2) # tupleToList :: (a2, b2, c2, d2, e2, f2, g2, h2, j2, k2, l2, m2, n2, o2, p2, q2) -> HList '[a2, b2, c2, d2, e2, f2, g2, h2, j2, k2, l2, m2, n2, o2, p2, q2] # listToTuple :: HList '[a1, b1, c1, d1, e1, f1, g1, h1, j1, k1, l1, m1, n1, o1, p1, q1] -> (a1, b1, c1, d1, e1, f1, g1, h1, j1, k1, l1, m1, n1, o1, p1, q1) # | |
ListTuple (a1, b1, c1, d1, e1, f1, g1, h1, j1, k1, l1, m1, n1, o1, p1, q1, r1) (a2, b2, c2, d2, e2, f2, g2, h2, j2, k2, l2, m2, n2, o2, p2, q2, r2) '[a1, b1, c1, d1, e1, f1, g1, h1, j1, k1, l1, m1, n1, o1, p1, q1, r1] '[a2, b2, c2, d2, e2, f2, g2, h2, j2, k2, l2, m2, n2, o2, p2, q2, r2] # | |
Defined in Data.Generics.Product.Internal.HList Methods tupled :: Iso (HList '[a1, b1, c1, d1, e1, f1, g1, h1, j1, k1, l1, m1, n1, o1, p1, q1, r1]) (HList '[a2, b2, c2, d2, e2, f2, g2, h2, j2, k2, l2, m2, n2, o2, p2, q2, r2]) (a1, b1, c1, d1, e1, f1, g1, h1, j1, k1, l1, m1, n1, o1, p1, q1, r1) (a2, b2, c2, d2, e2, f2, g2, h2, j2, k2, l2, m2, n2, o2, p2, q2, r2) # tupleToList :: (a2, b2, c2, d2, e2, f2, g2, h2, j2, k2, l2, m2, n2, o2, p2, q2, r2) -> HList '[a2, b2, c2, d2, e2, f2, g2, h2, j2, k2, l2, m2, n2, o2, p2, q2, r2] # listToTuple :: HList '[a1, b1, c1, d1, e1, f1, g1, h1, j1, k1, l1, m1, n1, o1, p1, q1, r1] -> (a1, b1, c1, d1, e1, f1, g1, h1, j1, k1, l1, m1, n1, o1, p1, q1, r1) # | |
ListTuple (a1, b1, c1, d1, e1, f1, g1, h1, j1, k1, l1, m1, n1, o1, p1, q1, r1, s1) (a2, b2, c2, d2, e2, f2, g2, h2, j2, k2, l2, m2, n2, o2, p2, q2, r2, s2) '[a1, b1, c1, d1, e1, f1, g1, h1, j1, k1, l1, m1, n1, o1, p1, q1, r1, s1] '[a2, b2, c2, d2, e2, f2, g2, h2, j2, k2, l2, m2, n2, o2, p2, q2, r2, s2] # | |
Defined in Data.Generics.Product.Internal.HList Methods tupled :: Iso (HList '[a1, b1, c1, d1, e1, f1, g1, h1, j1, k1, l1, m1, n1, o1, p1, q1, r1, s1]) (HList '[a2, b2, c2, d2, e2, f2, g2, h2, j2, k2, l2, m2, n2, o2, p2, q2, r2, s2]) (a1, b1, c1, d1, e1, f1, g1, h1, j1, k1, l1, m1, n1, o1, p1, q1, r1, s1) (a2, b2, c2, d2, e2, f2, g2, h2, j2, k2, l2, m2, n2, o2, p2, q2, r2, s2) # tupleToList :: (a2, b2, c2, d2, e2, f2, g2, h2, j2, k2, l2, m2, n2, o2, p2, q2, r2, s2) -> HList '[a2, b2, c2, d2, e2, f2, g2, h2, j2, k2, l2, m2, n2, o2, p2, q2, r2, s2] # listToTuple :: HList '[a1, b1, c1, d1, e1, f1, g1, h1, j1, k1, l1, m1, n1, o1, p1, q1, r1, s1] -> (a1, b1, c1, d1, e1, f1, g1, h1, j1, k1, l1, m1, n1, o1, p1, q1, r1, s1) # |
type family TupleToList a :: [Type] where ... #
Equations
TupleToList () = '[] :: [Type] | |
TupleToList (a, b) = '[a, b] | |
TupleToList (a, b, c) = '[a, b, c] | |
TupleToList (a, b, c, d) = '[a, b, c, d] | |
TupleToList (a, b, c, d, e) = '[a, b, c, d, e] | |
TupleToList (a, b, c, d, e, f) = '[a, b, c, d, e, f] | |
TupleToList (a, b, c, d, e, f, g) = '[a, b, c, d, e, f, g] | |
TupleToList (a, b, c, d, e, f, g, h) = '[a, b, c, d, e, f, g, h] | |
TupleToList (a, b, c, d, e, f, g, h, j) = '[a, b, c, d, e, f, g, h, j] | |
TupleToList (a, b, c, d, e, f, g, h, j, k) = '[a, b, c, d, e, f, g, h, j, k] | |
TupleToList (a, b, c, d, e, f, g, h, j, k, l) = '[a, b, c, d, e, f, g, h, j, k, l] | |
TupleToList (a, b, c, d, e, f, g, h, j, k, l, m) = '[a, b, c, d, e, f, g, h, j, k, l, m] | |
TupleToList (a, b, c, d, e, f, g, h, j, k, l, m, n) = '[a, b, c, d, e, f, g, h, j, k, l, m, n] | |
TupleToList (a, b, c, d, e, f, g, h, j, k, l, m, n, o) = '[a, b, c, d, e, f, g, h, j, k, l, m, n, o] | |
TupleToList (a, b, c, d, e, f, g, h, j, k, l, m, n, o, p) = '[a, b, c, d, e, f, g, h, j, k, l, m, n, o, p] | |
TupleToList (a, b, c, d, e, f, g, h, j, k, l, m, n, o, p, q) = '[a, b, c, d, e, f, g, h, j, k, l, m, n, o, p, q] | |
TupleToList (a, b, c, d, e, f, g, h, j, k, l, m, n, o, p, q, r) = '[a, b, c, d, e, f, g, h, j, k, l, m, n, o, p, q, r] | |
TupleToList (a, b, c, d, e, f, g, h, j, k, l, m, n, o, p, q, r, s) = '[a, b, c, d, e, f, g, h, j, k, l, m, n, o, p, q, r, s] | |
TupleToList a = '[a] |