69
transpose = foldr
auxForTranspose
[]
%where
auxForTranspose Xs Xss = zipWith (:) Xs (Xss ++ repeat [])
%% (\\) is used to remove the first occurrence of each element in the second
%% list from the first list. It is a kind of inverse of (++) in the sense
%% that (xs ++ ys) \\ xs = ys for any finite list xs of proper values xs.
infix 50 \\
(\\) :: [A] -> [A] -> [A]
(\\) = foldl del
%where
[] ‘del‘ Y = []
[X|Xs] ‘del‘ Y = if X == Y then Xs
else [X|Xs] ‘del‘ Y
Comentários a estes Manuais