1 {-# LANGUAGE DeriveGeneric #-}
2 {-# LANGUAGE NoMonomorphismRestriction #-}
3 {-# LANGUAGE TypeFamilies #-}
10 import Generics.SOP ( Code, Generic(..) )
12 -- | Convert a simple product type into a tuple, generically.
16 -- >>> import qualified GHC.Generics as GHC ( Generic )
17 -- >>> data Foo = Bar Int Int Int Int deriving (Show, GHC.Generic)
18 -- >>> instance Generic Foo
19 -- >>> let b = Bar 1 2 3 4
20 -- >>> to_tuple b :: (Int,Int,Int,Int)
23 to_tuple:: (Generic a, Generic c, Code a ~ Code c) => a -> c