-- create a list a = [1,2,3,4] -- prepend an element to a list b = 0 : a -- iterate through a list and print foo [] = putStr "" foo a = do putStrLn(show(head a)) foo(tail a) main = do putStrLn(show(b)) foo b -- look up element 3 of the list putStrLn("b!!3="++show(b!!3)) putStrLn("b!!0 to b!!3="++show(take 4 b)) putStrLn("tail b="++show(tail b))