2 Vect, VVar, VExpr, VBind,
9 vVar, vType, vNote, vLet,
10 vLams, vLamsWithoutLC, vVarApps
13 #include "HsVersions.h"
21 type VExpr = Vect CoreExpr
22 type VBind = Vect CoreBind
24 vectorised :: Vect a -> a
30 mapVect :: (a -> b) -> Vect a -> Vect b
31 mapVect f (x,y) = (f x, f y)
33 zipWithVect :: (a -> b -> c) -> Vect a -> Vect b -> Vect c
34 zipWithVect f (x1,y1) (x2,y2) = (f x1 x2, f y1 y2)
39 vType :: Type -> VExpr
40 vType ty = (Type ty, Type ty)
42 vNote :: Note -> VExpr -> VExpr
43 vNote = mapVect . Note
45 vNonRec :: VVar -> VExpr -> VBind
46 vNonRec = zipWithVect NonRec
48 vRec :: [VVar] -> [VExpr] -> VBind
49 vRec vs es = (Rec (zip vvs ves), Rec (zip lvs les))
54 vLet :: VBind -> VExpr -> VExpr
55 vLet = zipWithVect Let
57 vLams :: Var -> [VVar] -> VExpr -> VExpr
58 vLams lc vs (ve, le) = (mkLams vvs ve, mkLams (lc:lvs) le)
62 vLamsWithoutLC :: [VVar] -> VExpr -> VExpr
63 vLamsWithoutLC vvs (ve,le) = (mkLams vs ve, mkLams ls le)
67 vVarApps :: Var -> VExpr -> [VVar] -> VExpr
68 vVarApps lc (ve, le) vvs = (ve `mkVarApps` vs, le `mkVarApps` (lc : ls))