diff options
Diffstat (limited to 'Math')
-rw-r--r-- | Math/Combinatorics/YoungTableaux.hs | 8 |
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 = |