[Haskell-beginners] Question on : usage

Daniel Trstenjak daniel.trstenjak at gmail.com
Mon Dec 23 14:11:08 UTC 2013


Hi Angus,

> testconcat [(x:xs), (y:ys)] = x : xs : y : ys

When you're replacing the x, xs, y, and ys with types you're getting:

   a : [a] : a : [a]

The type of (:) is:

   a -> [a] -> [a]

Can you see the problem? Hint, the problem is the (:) in the middle.


Greetings,
Daniel


More information about the Beginners mailing list