aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Math/Combinatorics/RootSystem.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/Math/Combinatorics/RootSystem.hs b/Math/Combinatorics/RootSystem.hs
index 53cf65c..e388a23 100644
--- a/Math/Combinatorics/RootSystem.hs
+++ b/Math/Combinatorics/RootSystem.hs
@@ -76,7 +76,7 @@ longestElement ss = longestElement' [] posRoots
posRoots = positiveRoots ss
longestElement' :: [[Q]] -> [[Q]] -> [[Q]]
longestElement' xs rs =
- let ys = (S.fromList ss) S.\\ (S.fromList $ negateM rs) in
+ let ys = (S.fromList ss) S.\\ (S.fromList $ negateM rs) S.\\ (if null xs then S.empty else S.singleton (head xs)) in
if S.null ys
then xs
else let alpha = (head (S.toList ys)) in