Question: I've been attempting to find a solution to this problem for a couple of days now and before getting too frustrated with myself I decided to ask for help.

I have a list of uniform lists, e.g. `[[2], [2, 2], [3], [3, 3] [3, 3, 3], [5]]` and I want to apply a filter so that only the lists which aren't subsets of any of the rest of the lists remain.

That was a complicated sentence. Basically I need a function `f` for which

```
f [[2], [2, 2], [3], [3, 3] [3, 3, 3], [5]]

```

results in

```
[[2, 2], [3, 3, 3], [5]]

```

I hope I've made myself clear. If not, help me clarify!

Answer: 
It looks like you want this:

```
import Data.List
import Data.Function

f :: (Ord a) => [[a]] -> [[a]]
f = map (maximumBy (compare `on` length)) . groupBy ((==) `on` head) . sortBy (compare `on` head)

```

We just group the lists together by their head and select the maximum of each.

If I did not understand you wrong, you want to select the list which is not a sublist of the other lists, which is essentially the longest list for each group.
No list is a proper sublist of the empty list. The empty list is a proper sublist of every non-empty list.

```
import Data.List (delete)

sublist :: Eq a => [a] -> [a] -> Bool
sublist _        []               = False
sublist []       _                = True
sublist (x : xs) ys | x `elem` ys = sublist xs (delete x ys)
                    | otherwise   = False

```

With `none pred = not . any pred`, and without an `Ord` constraint:

```
superlists :: Eq a => [[a]] -> [[a]]
superlists xss = filter (\ xs -> none (xs `sublist`) xss) xss

```

meaning

```
superlists [[1,2,2],[2,2,1],[1],[]]  ==  [[1,2,2],[2,2,1]]

```

and

```
superlists [[2],[2,2],[3],[3,3],[3,3,3],[5]]  ==  [[2,2],[3,3,3],[5]]

```

---

Denotationally equivalent alternative `sublist`:

```
elemDelete :: Eq a => a -> [a] -> (Bool, [a])
elemDelete _ []                   = (False, [])
elemDelete y (x : xs) | x == y    = (True, xs)
                      | otherwise = let (b, zs) = elemDelete y xs
                                    in  (b, x : zs)

sublist :: Eq a => [a] -> [a] -> Bool
sublist _        [] = False
sublist []       _  = True
sublist (x : xs) ys = let (b, dys) = elemDelete x ys
                      in  if b then sublist xs dys 
                               else False

```

But `elemDelete y xs` is actually less efficient than `(elem y xs, delete y xs)`.