@@ -11,16 +11,18 @@
11{-# LANGUAGE TypeOperators #-}
11{-# LANGUAGE TypeOperators #-}
12{-# LANGUAGE UndecidableInstances #-}
12{-# LANGUAGE UndecidableInstances #-}
14+-----------------------------------------------------------------------------
16+-- Module : Data.Generics.Internal.HList
17+-- Copyright : (C) 2017 Csongor Kiss
19+-- Maintainer : Csongor Kiss <kiss.csongor.kiss@gmail.com>
20+-- Stability : experimental
21+-- Portability : non-portable
23+-----------------------------------------------------------------------------
14module Data.Generics.Internal.HList
24module Data.Generics.Internal.HList
25 , ListTuple (..)
27 , ListTuple (..)
@@ -47,9 +49,6 @@ append (x :> xs) ys = x :> append xs ys
47head' :: HList (a ': as) -> a
49head' :: HList (a ': as) -> a
48head' (x :> _) = x
50head' (x :> _) = x
50−tail' :: HList (a ': as) -> HList as
53--------------------------------------------------------------------------------
52--------------------------------------------------------------------------------
54-- * Split HList
53-- * Split HList
@@ -142,6 +141,7 @@ instance ListTuple (a, b, c, d, e, f, g, h, j, k, l) '[a, b, c, d, e, f, g, h, j
142 = (a, b, c, d, e, f, g, h, j, k, l)
141 = (a, b, c, d, e, f, g, h, j, k, l)
144--------------------------------------------------------------------------------
143--------------------------------------------------------------------------------
145class GCollectible (f :: Type -> Type) (as :: [Type]) | f -> as where
145class GCollectible (f :: Type -> Type) (as :: [Type]) | f -> as where
146 gtoCollection :: f x -> HList as
146 gtoCollection :: f x -> HList as
147 gfromCollection :: HList as -> f x
147 gfromCollection :: HList as -> f x