-instance (Lift a, NaturalT nT) => Lift (TFVec nT a) where
- lift (TFVec xs) = [| unsafeTFVecCoerse
- $(decLiteralV (fromIntegerT (undefined :: nT)))
- (TFVec xs) |]
+-- instance (Lift a, NaturalT nT) => Lift (TFVec nT a) where
+-- lift (TFVec xs) = [| unsafeTFVecCoerse
+-- $(decLiteralV (fromIntegerT (undefined :: nT)))
+-- (TFVec xs) |]
+
+instance (Lift a, Typeable a, NaturalT nT) => Lift (TFVec nT a) where
+ lift (TFVec xs) = sigE [| (TFVec xs) |] (decTFVecT (fromIntegerT (undefined :: nT)) xs)
+
+decTFVecT :: Typeable x => Integer -> x -> Q Type
+decTFVecT n a = appT (appT (conT (''TFVec)) (decLiteralT n)) elemT
+ where
+ (con,reps) = splitTyConApp (typeOf a)
+ elemT = typeRep2Type (P.head reps)
+