Implementing Transpose
I see a few problems, mostly similar to my remarks in a previous answer:


Your definition of head' is unconventional.  Its definition should be

head' :: [a] -&gt; a
head (x:_) = x


Furthermore, your problematic definition of head' is making you define flatten'.  If you fix head' as suggested above, thenflatten' becomes unnecessary.
The definition of tail' is too complicated.  It could just be

tail' :: [a] -&gt; [a]
tail (_:xs) = xs

For clarity, I would rename the parameter to transpose' from ys to rows.
The base case of transpose' is too complicated.  Also, it can be done using pattern matching.

transpose' [[]]    = []
transpose' [[], _] = []

Prefer x:xs to [x] ++ xs.
Scope your helper functions using where.


Here's what I came up with:

transpose' :: [[a]] -&gt; [[a]]
transpose' [[]]    = []
transpose' [[], _] = []
transpose' rows    = (map head' rows) : transpose' (map tail' rows)
  where
    head' (x:_) = x
    tail' (_:xs) = xs