<div class="gmail_quote">On 17 December 2010 13:59, Jacek Generowicz <span dir="ltr">&lt;<a href="mailto:jacek.generowicz@cern.ch">jacek.generowicz@cern.ch</a>&gt;</span> wrote:<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">


What are some interesting, idiomatic ways of writing something similar to the following<br></blockquote><div> </div><div><div>λ&gt; :m + Safe</div><div>λ&gt; let getValidatedInteger = getLine &gt;&gt;= maybe (do putStrLn &quot;That doesn&#39;t seem to be an integer. Try again.&quot;; getValidatedInteger) return . readMay :: IO Integer</div>

<div>Loading package safe-0.3 ... linking ... done.</div><div>λ&gt; getValidatedInteger</div><div>a</div><div>That doesn&#39;t seem to be an integer. Try again.</div><div>1</div><div>1</div><div>λ&gt; </div></div></div>