Advertisement
Guest User

Untitled

a guest
Jun 22nd, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. compressQTree i t = if(((depthQTree t) - i) < 0)
  2. then let (x,y) = sizeQTree t in (Cell (searchCell t) x y)
  3. else anaQTree f ((depthQTree t) - i, t)
  4. where f (_, (Cell a b c)) = i1(a, (b, c))
  5. f (0, s@(Block a b c d)) = let (x,y) = sizeQTree s in i1 ((searchCell a), (x, y))
  6. f (n, (Block a b c d)) = i2( (n-1 , a) , ((n-1 , b), ((n-1 , c), (n-1 , d))))
  7.  
  8. searchCell = cataQTree (either g1 g2)
  9. where g1 (a,(b, c)) = a
  10. g2 (a,(b,(c,d))) = a
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement