
Ezequiel Hernan Di Giorgi
*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)*
As a beginner it's almost always wrong to use the comparison operator (==). Use it only to compare numbers, for everything else use pattern-matching. In particular use guards ("| ... = ...") only when they are really necessary. In this case they are not. Put differently, if your function needs an Eq constraint (or any constraint) you're doing it wrong. The type signature should be: intercalate :: [a] -> [a] -> [a] Greets, Ertugrul -- Not to be or to be and (not to be or to be and (not to be or to be and (not to be or to be and ... that is the list monad.