Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Data.Set.Internal error message says Map #902

Closed
erikd opened this issue Jan 22, 2023 · 8 comments
Closed

Data.Set.Internal error message says Map #902

erikd opened this issue Jan 22, 2023 · 8 comments

Comments

@erikd
Copy link
Member

erikd commented Jan 22, 2023

The file containers/src/Data/Set/Internal.hs in function balanceR has the following error:

       (_, _) -> error "Failure in Data.Map.balanceR"

where the "Map" part should be "Set".

I would have submitted a PR, but I got an odd git error when I tried to commit the fix.

@erikd
Copy link
Member Author

erikd commented Jan 22, 2023

diff --git a/containers/src/Data/Set/Internal.hs b/containers/src/Data/Set/Internal.hs
index 6e4d2d6c..d5d7e29d 100644
--- a/containers/src/Data/Set/Internal.hs
+++ b/containers/src/Data/Set/Internal.hs
@@ -1739,7 +1739,7 @@ balanceL x l r = case r of
                    (Bin lls _ _ _, Bin lrs lrx lrl lrr)
                      | lrs < ratio*lls -> Bin (1+ls+rs) lx ll (Bin (1+rs+lrs) x lr r)
                      | otherwise -> Bin (1+ls+rs) lrx (Bin (1+lls+size lrl) lx ll lrl) (Bin (1+rs+size lrr) x lrr r)
-                   (_, _) -> error "Failure in Data.Map.balanceL"
+                   (_, _) -> error "Failure in Data.Set.balanceL"
               | otherwise -> Bin (1+ls+rs) x l r
 {-# NOINLINE balanceL #-}
 
@@ -1764,7 +1764,7 @@ balanceR x l r = case l of
                    (Bin rls rlx rll rlr, Bin rrs _ _ _)
                      | rls < ratio*rrs -> Bin (1+ls+rs) rx (Bin (1+ls+rls) x l rl) rr
                      | otherwise -> Bin (1+ls+rs) rlx (Bin (1+ls+size rll) x l rll) (Bin (1+rrs+size rlr) rx rlr rr)
-                   (_, _) -> error "Failure in Data.Map.balanceR"
+                   (_, _) -> error "Failure in Data.Set.balanceR"
               | otherwise -> Bin (1+ls+rs) x l r
 {-# NOINLINE balanceR #-}

@treeowl
Copy link
Contributor

treeowl commented Jan 22, 2023

Thanks. Do you think you could open a PR?

@erikd
Copy link
Member Author

erikd commented Jan 22, 2023

I would love to open a PR, but I cannot even commit the fix:

> git-commit -m "Fix error message" -- .
error: 'containers/docs/_extensions/haddock-autolink' does not have a commit checked out
fatal: updating files failed

Never seen that before.

@treeowl
Copy link
Contributor

treeowl commented Jan 22, 2023

Paging @m-renaud.

@treeowl
Copy link
Contributor

treeowl commented Jan 22, 2023

This might be a git submodule thing...

@erikd
Copy link
Member Author

erikd commented Jan 22, 2023

Had to remember how to use submodules. PR coming.

@erikd
Copy link
Member Author

erikd commented Jan 22, 2023

#903

@konsumlamm
Copy link
Contributor

Fixed by #903, so this issue can be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants