You seem to have reversed the function composition here.
-- This
typeCheck :: [a] -> [[a]]
typeCheck x = listf (wrap x)
-- is the same as
typeCheck' :: [a] -> [[a]]
typeCheck' = listf . wrap
-- while this
typeError :: [a] -> [[a]]
typeError = wrap . listf
-- is the same as
typeError' :: [a] -> [[a]]
typeError' x = wrap (listf x)
Now it should hopefully be obvious why this doesn't work. listf
requires that its argument is [[a]]
, but the signature of typeError
claims that it works for any [a]
.