Advertisement
Guest User

Untitled

a guest
Jun 21st, 2018
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. tamanho1 :: QTree a -> Int
  2. tamanho1 (Cell a b c) = b
  3. tamanho1 (Block a b c d) = tamanho1(a) + tamanho1(b)
  4.  
  5. tamanho2 :: QTree a -> Int
  6. tamanho2 (Cell a b c) = c
  7. tamanho2 (Block a b c d) = tamanho2(a) + tamanho2(c)
  8.  
  9. g b@(Cell a x y) = b
  10. g b@(Block (Cell a _ _) (Cell _ _ _) (Cell _ _ _) (Cell _ _ _)) = let x = tamanho1 b
  11. y = tamanho2 b
  12. in (Cell a (fromIntegral(x)) y)
  13. g h@(Block a b c d) = Block(g a) (g b) (g c) (g d)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement