From b7095e3e6e703a1bbf1d2d4f4a20f4084d472500 Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Fri, 23 Jun 2017 07:42:05 -0400 Subject: minor change --- Math/Combinatorics/YoungTableaux.hs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'Math') 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 = -- cgit v1.2.3