Compiling the code gives
(+++) :: [a] -> [a] -> [a]
lst1 +++ lst2 = if null lst1
then []
else (head lst1) : (tail lst1 +++ lst2)
main :: IO ()
main = do
putStrLn "start"
[1,2,3] +++ [4,5,6]
putStrLn "end"
Couldn't match expected type ‘IO a0’ with actual type ‘[Integer]’ In a stmt of a 'do' block: [1, 2, 3] +++ [4, 5, 6] In the expression: do { putStrLn "start"; [1, 2, ....] +++ [4, 5, ....]; putStrLn "end" } In an equation for ‘main’: main = do { putStrLn "start"; [1, ....] +++ [4, ....]; putStrLn "end" }
What I failed to do anything about - it looks fine to me.
print $ [1,2,3] +++ [4,5,6]
. – Aadit M Shah