
31 Aug
2012
31 Aug
'12
9:52 a.m.
On Fri, Aug 31, 2012 at 09:01:30AM -0300, Ezequiel Hernan Di Giorgi wrote:
*intercalate :: (Eq t) => [t] -> [t] -> [t]* *intercalate (x:xs) (y:ys)* * | xt == [] = []* * | yt == [] = []* * | otherwise = x : y : intercalate xs ys* * where xt=(x:xs)* * yt=(y:ys)*
I should also point out that the tests xt == [] and yt == [] will never be true! That is because xt is defined to be (x:xs) and yt is (y:ys). A list can be *either* the empty list [], or a cons like (x:xs), but not both. -Brent