Advertisement
Guest User

Untitled

a guest
Dec 6th, 2019
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. blocks :: [a] -> [b] -> [c] -> [(a,a,a,b,b,b,c,c,c)]
  2. blocks l1 l2 l3
  3.               = [[(x1,x2,x3,y1,y2,y3,z1,z2,z3) | x1 <- l1,
  4.                                                 x2 <- tail l1,
  5.                                                 x3 <- tail (tail l1),
  6.                                                 y1 <- l2,
  7.                                                 y2 <- tail l2,
  8.                                                 y3 <- tail (tail l2),
  9.                                                 z1 <- l3,
  10.                                                 z2 <- tail l3,
  11.                                                 z3 <- tail (tail l3)]!!0]
  12.  
  13. zip9 :: [a] -> [b] -> [c] ->
  14.         [d] -> [e] -> [f] ->
  15.         [g] -> [h] -> [i] ->
  16.         [(a,b,c,d,e,f,g,h,i)]
  17. zip9 l1 l2 l3 l4 l5 l6 l7 l8 l9
  18.   = [(x1, x2, x3,
  19.       x4, x5, x6,
  20.       x7, x8, x9) | x1 <- l1 | x2 <- l2 | x3 <- l3
  21.                   | x4 <- l4 | x5 <- l5 | x6 <- l6
  22.                   | x7 <- l7 | x8 <- l8 | x9 <- l9
  23.                   ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement