1 2 3 4 5 6 7 8
f :: Int -> [Int] -> [Int] f n [] = [] f n arr | tail arr == [] = arr | otherwise = replicate n (head arr) ++ f n (tail arr) main = getContents >>= mapM_ print. (\(n:arr) -> f n arr). map read. words
1 2
Program error: pattern match failure: main_v3585 []