aboutsummaryrefslogtreecommitdiff
path: root/Math
diff options
context:
space:
mode:
authorYuchen Pei <baconp@gmail.com>2017-06-23 07:42:05 -0400
committerYuchen Pei <baconp@gmail.com>2017-06-23 07:42:05 -0400
commitb7095e3e6e703a1bbf1d2d4f4a20f4084d472500 (patch)
tree1bd225cc1b9e3de445e5c5997e82f5bf9d06752a /Math
parent863e44707e87e6a7722f412a41fff66575bbfcd2 (diff)
minor change
Diffstat (limited to 'Math')
-rw-r--r--Math/Combinatorics/YoungTableaux.hs8
1 files changed, 8 insertions, 0 deletions
diff --git a/Math/Combinatorics/YoungTableaux.hs b/Math/Combinatorics/YoungTableaux.hs
index baa11c0..e365ee7 100644
--- a/Math/Combinatorics/YoungTableaux.hs
+++ b/Math/Combinatorics/YoungTableaux.hs
@@ -9,3 +9,11 @@ isRowWord' xs ys zs =
isRowWord :: Ord a => [a] -> Bool
isRowWord = isRowWord' [] []
+
+reduceWord :: Ord a => [a] -> [a]
+reduceWord xs
+ | length xs <= 2 = xs
+ | otherwise = reduceWord' (reduceWord (init xs)) (last xs)
+
+reduceWord' :: Ord a => [a] -> a -> [a]
+reduceWord' xs x =