vectorTH function updated so that it works in Clash
[matthijs/master-project/support/tfvec.git] / Data / Param / TFVec.hs
index fd620e74887df2bb2349170252573c181e5cfa4b..2357c21a9087bd94a0143b960c1e34e25d2b3e81 100644 (file)
@@ -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