projects
/
matthijs
/
master-project
/
support
/
tfvec.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
vectorTH function updated so that it works in Clash
[matthijs/master-project/support/tfvec.git]
/
Data
/
Param
/
TFVec.hs
diff --git
a/Data/Param/TFVec.hs
b/Data/Param/TFVec.hs
index fd620e74887df2bb2349170252573c181e5cfa4b..2357c21a9087bd94a0143b960c1e34e25d2b3e81 100644
(file)
--- 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
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 :: 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
unsafeVector :: NaturalT s => s -> [a] -> TFVec s a
unsafeVector l xs