Skip to content
Snippets Groups Projects
Commit c9354b7d authored by Hans-Peter Deifel's avatar Hans-Peter Deifel
Browse files

SumBag: Fix typos in error messages and comments

parent c2feee5d
No related branches found
No related tags found
No related merge requests found
...@@ -113,7 +113,7 @@ rotateSingleRight _ _ _ = error "rotateSingleRight called with empty left tree" ...@@ -113,7 +113,7 @@ rotateSingleRight _ _ _ = error "rotateSingleRight called with empty left tree"
rotateDoubleLeft :: Monoid a => Element a -> Tree a -> Tree a -> Tree a rotateDoubleLeft :: Monoid a => Element a -> Tree a -> Tree a -> Tree a
rotateDoubleLeft a x (Node _ c (Node _ b y1 y2) z) = node b (node a x y1) (node c y2 z) rotateDoubleLeft a x (Node _ c (Node _ b y1 y2) z) = node b (node a x y1) (node c y2 z)
rotateDoubleLeft _ _ _ = error "rotateDoubleLeft called with too small left tree" rotateDoubleLeft _ _ _ = error "rotateDoubleLeft called with too small right tree"
rotateDoubleRight :: Monoid a => Element a -> Tree a -> Tree a -> Tree a rotateDoubleRight :: Monoid a => Element a -> Tree a -> Tree a -> Tree a
rotateDoubleRight c (Node _ a x (Node _ b y1 y2)) z = node b (node a x y1) (node c y2 z) rotateDoubleRight c (Node _ a x (Node _ b y1 y2)) z = node b (node a x y1) (node c y2 z)
...@@ -136,7 +136,7 @@ balance1 a left right ...@@ -136,7 +136,7 @@ balance1 a left right
sizeLL = size lleft sizeLL = size lleft
sizeLR = size lright sizeLR = size lright
in if sizeLL < sizeLR then rotateSingleRight a left right else rotateDoubleRight a left right in if sizeLL < sizeLR then rotateSingleRight a left right else rotateDoubleRight a left right
-- No subtree is too heave, we can just form a new tree straight away -- No subtree is too heavy, we can just form a new tree straight away
| otherwise = node a left right | otherwise = node a left right
addOnce :: Semigroup a => Element a -> Element a addOnce :: Semigroup a => Element a -> Element a
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment