I was reading a Template Haskell tutorial from archive.org since it was lost from haskell.org, and noticed that it is corrupted, as if random parts had been taken out.
I was hoping to read about their implementation of zipn. The only code they have there is:
\ y1 y2 y3 >
case (y1,y2,y3) of
(x1:xs1,x2:xs2,x3:xs3) > (x1,x2,x3) : ff xs1 xs2 xs3
(_,_,_) > []
mkZip :: Int > Expr > Expr
mkZip n name = lam pYs (caseE (tup eYs) [m1,m2])
where
(pXs, eXs) = genPE "x" n
(pYs, eYs) = genPE "y" n
(pXSs,eXSs) = genPE "xs" n
pcons x xs = [p| $x : $xs |]
b = [| $(tup eXs) : $(apps(name : eXSs)) |]
m1 = simpleM (ptup (zipWith pcons pXs pXSs)) b
m2 = simpleM (ptup (copies n pwild)) (con "[]")
This makes no sense to me. Does anyone have a good copy of the tutorial? Or is what's on archive.org what it is?