I got this code to make a transposed matrix, but it doesn't work 100% fine.
type Mat a = [[a]]
transpose' :: Eq a => Mat a -> Mat a
transpose' [] = []
transpose' (h:t) = primelem (h:t):transpose' (eliminate' (h:t))
primelem :: Mat a -> [a]
primelem [] = []
primelem [[x]] = [x]
primelem ((x:xs):t) = x : primelem t
eliminate' :: Eq a => Mat a -> Mat a
eliminate' [] = []
eliminate' (h:t) = (delete (head h) h):eliminate' t
*Main> transpose' [[1,2,3],[0,4,5],[0,06]]
[[1,0,0],[2,4,6],[3,5*** Exception:(..)Non-exhaustive patterns in function primelem
I am trying to figure it out, but i really don't know which case is missing.