complete p001 in haskell