[Haskell-beginners] iterateM

Adrian May adrian.alexander.may at gmail.com
Tue Jun 18 11:53:51 CEST 2013


Hi Volker,

In the meantime I did something very simple. I just have a step function
taking a maybe state parameter which recurses until the state is nothing.
Then main = step init

Adrian.
 On 18 Jun 2013 13:29, "Karl Voelker" <ktvoelker at gmail.com> wrote:

> I would use the State monad rather than passing the state explicitly. Then
> the "body of the loop" is of type "m a" rather than "a -> m a", and you can
> use "sequence . repeat" on it.
>
> -Karl
>
> _______________________________________________
> Beginners mailing list
> Beginners at haskell.org
> http://www.haskell.org/mailman/listinfo/beginners
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/beginners/attachments/20130618/dd600998/attachment.htm>


More information about the Beginners mailing list