diff --git a/src/HSFM/GUI/Gtk/Utils.hs b/src/HSFM/GUI/Gtk/Utils.hs index b976da1..07902ab 100644 --- a/src/HSFM/GUI/Gtk/Utils.hs +++ b/src/HSFM/GUI/Gtk/Utils.hs @@ -152,8 +152,10 @@ rawPathToItem myview tp = do -- |Makes sure the list is max 5. This is probably not very efficient -- but we don't care, since it's a small list anyway. -addHistory :: a -> [a] -> [a] -addHistory i xs +addHistory :: Eq a => a -> [a] -> [a] +addHistory i [] = [i] +addHistory i xs@(x:_) + | i == x = xs | length xs == maxLength = i : take (maxLength - 1) xs | otherwise = i : xs where