2 Vect, VVar, VExpr, VBind,
9 vVar, vType, vNote, vLet,
14 #include "HsVersions.h"
22 type VExpr = Vect CoreExpr
23 type VBind = Vect CoreBind
25 vectorised :: Vect a -> a
31 mapVect :: (a -> b) -> Vect a -> Vect b
32 mapVect f (x,y) = (f x, f y)
34 zipWithVect :: (a -> b -> c) -> Vect a -> Vect b -> Vect c
35 zipWithVect f (x1,y1) (x2,y2) = (f x1 x2, f y1 y2)
40 vType :: Type -> VExpr
41 vType ty = (Type ty, Type ty)
43 vNote :: Note -> VExpr -> VExpr
44 vNote = mapVect . Note
46 vNonRec :: VVar -> VExpr -> VBind
47 vNonRec = zipWithVect NonRec
49 vRec :: [VVar] -> [VExpr] -> VBind
50 vRec vs es = (Rec (zip vvs ves), Rec (zip lvs les))
55 vLet :: VBind -> VExpr -> VExpr
56 vLet = zipWithVect Let
58 vLams :: Var -> [VVar] -> VExpr -> VExpr
59 vLams lc vs (ve, le) = (mkLams vvs ve, mkLams (lc:lvs) le)
63 mkVLams :: [VVar] -> VExpr -> VExpr
64 mkVLams vvs (ve,le) = (mkLams vs ve, mkLams ls le)
68 mkVVarApps :: Var -> VExpr -> [VVar] -> VExpr
69 mkVVarApps lc (ve, le) vvs = (ve `mkVarApps` vs, le `mkVarApps` (lc : ls))