Add ghc stage info
[matthijs/master-project/support/tfvec.git] / Data / Param / TFVec.hs
index fd620e74887df2bb2349170252573c181e5cfa4b..7a0fa1dcc0ab1d1d000bd497097944ebbec64297 100644 (file)
@@ -69,7 +69,7 @@ import Prelude hiding (
   zipWith, zip, unzip, concat, reverse, iterate )
 import qualified Data.Foldable as DF (Foldable, foldr)
 import qualified Data.Traversable as DT (Traversable(traverse))
-import Language.Haskell.TH
+import Language.Haskell.TH hiding (Pred)
 import Language.Haskell.TH.Syntax (Lift(..))
 
 newtype (NaturalT s) => TFVec s a = TFVec {unTFVec :: [a]}
@@ -95,8 +95,11 @@ singleton x = x +> empty
 vectorCPS :: [a] -> (forall s . NaturalT s => TFVec s a -> w) -> w
 vectorCPS xs = unsafeVectorCPS (toInteger (P.length xs)) xs
 
+-- FIXME: Not the most elegant solution... but it works for now in clash
 vectorTH :: Lift a => [a] -> ExpQ
-vectorTH xs = (vectorCPS xs) lift
+-- vectorTH xs = (vectorCPS xs) lift
+vectorTH [] = [| empty |]
+vectorTH (x:xs) = [| x +> $(vectorTH xs) |]
 
 unsafeVector :: NaturalT s => s -> [a] -> TFVec s a
 unsafeVector l xs