X-Git-Url: https://git.stderr.nl/gitweb?p=matthijs%2Fmaster-project%2Fsupport%2Ftfvec.git;a=blobdiff_plain;f=Data%2FParam%2FTFVec.hs;fp=Data%2FParam%2FTFVec.hs;h=33758f9f5762aec6b422493be1b5b8f22887ac39;hp=1b2051e6e9ba176335d69a01033e06b4dd1e1912;hb=42ea8a52e13b6ca88f86ee60699088fb83eb2b16;hpb=7443b25a5a51e48e00b8af393473d75359947225 diff --git a/Data/Param/TFVec.hs b/Data/Param/TFVec.hs index 1b2051e..33758f9 100644 --- a/Data/Param/TFVec.hs +++ b/Data/Param/TFVec.hs @@ -102,6 +102,7 @@ vectorCPS xs = unsafeVectorCPS (toInteger (P.length xs)) xs vectorTH :: (Lift a, Typeable a) => [a] -> ExpQ -- vectorTH xs = sigE [| (TFVec xs) |] (decTFVecT (toInteger (P.length xs)) xs) vectorTH [] = [| empty |] +vectorTH [x] = [| singleton x |] vectorTH (x:xs) = [| x +> $(vectorTH xs) |] unsafeVector :: NaturalT s => s -> [a] -> TFVec s a @@ -349,4 +350,4 @@ lexTFVec :: ReadS String lexTFVec ('>':rest) = [(">",rest)] lexTFVec ('<':rest) = [("<",rest)] lexTFVec str = lex str - \ No newline at end of file +