The general solution to concatenating two lists of integers is as follows:
concatInt [] xs = xs concatInt xs [] = xs concatInt xs ys = [join xy | x <- xs , y <- ys ] where join xy = firstPart + secondPart where firstPart = x * 10 ^ lengthSecondPart lengthSecondPart = 1 + (truncate $ logBase 10 (fromIntegral y)) secondPart = y
Example: concatInt [1,2,3] [4,5,6] == [14,15,16,24,25,26,34,35,36]
A more complex example: concatInt [0,2,10,1,100,200] [24,2999,44,3] == [24,2,999,44,3,224,22,2999,244,23,1024,102,10999,1044, 103,124,12, 1999,144,13,10024,1002,100999,10044,1003,20024,2002,200999,20044,2003]