[Haskell-beginners] Re: Sequential IO processing

Heinrich Apfelmus apfelmus at quantentunnel.de
Thu Feb 19 10:32:29 EST 2009


Sergey V. Mikhanov wrote:
> I tried this earlier as well:
> 
> sequenceIO [] = return []
> sequenceIO (x : xs) = do result <- x
>                          resultTail <- sequenceIO xs
>                          return result : resultTail

The last line should be

                           return (result : resultTail)

otherwise it will be parsed as

  (return result) : resultTail

which is not what you want.


Regards,
apfelmus

--
http://apfelmus.nfshost.com



More information about the Beginners mailing list