So i have this function and when i try to use it like this: mergeSortedLists [1,1] [1,1] it gives me an error:
[1,1*** Exception: SortFunctions.hs:(86,1)-(91,89): Non-exhaustive patterns in function mergeSortedLists
85 mergeSortedLists :: (Ord t) => [t] -> [t] -> [t]
86 mergeSortedLists [] [] = []
87 mergeSortedLists (x:[]) [] = x:[]
88 mergeSortedLists [] (y:[]) = y:[]
89 mergeSortedLists (x:[]) (y:[]) = (max x y) : (min x y) : []
90 mergeSortedLists (x:tail1) (y:tail2) | x > y = x : (mergeSortedLists tail1 (y:tail2))
91 | otherwise = y : (mergeSortedLists (x:tail1) tail2)
I can't figure out the source of a problem since i think i covered every case possible. What could be the problem here?