From a748975fba960d8aa82c4b863619c693e649e65e Mon Sep 17 00:00:00 2001 From: Christiaan Baaij Date: Fri, 3 Jul 2009 21:37:59 +0200 Subject: [PATCH 1/1] vectorTH function updated so that it works in Clash Will probebly convert it to something better in the future --- Data/Param/TFVec.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Data/Param/TFVec.hs b/Data/Param/TFVec.hs index fd620e7..2357c21 100644 --- a/Data/Param/TFVec.hs +++ b/Data/Param/TFVec.hs @@ -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 -- 2.30.2