[Haskell-cafe] [Newbie question] -- Looping stdin until condition is met

2008-05-30 Thread Martin Blais
Allright, this is a definitely a newbie question. I'm learning Haskell and going through the exercises in the beautiful Hutton book, and one of them requires for me to write a loop that queries a line from the user (stdin), looping until the user enters a valid integer (at least that's how I want

Re: [Haskell-cafe] [Newbie question] -- Looping stdin until condition is met

2008-05-30 Thread Martin Blais
On Fri, 30 May 2008 16:54:18 -0700, "Philip Weaver" <[EMAIL PROTECTED]> said: > > 1. How do I catch the exception that is raised from "read"? > > > I think you want readIO, which yields a computation in the IO monad, > so it can be caught. Holy schmoly, there it is, words of wisdom, written as cle

Re: [Haskell-cafe] [Newbie question] -- Looping stdin until condition is met

2008-05-30 Thread Martin Blais
On Fri, 30 May 2008 17:19:54 -0700, "Philip Weaver" <[EMAIL PROTECTED]> said: > > Dear Philip, could you point your virtual finger towards a > > reference/paper/book/any-bleeping-thing that would help this simple > > beginner understand why it doesn't work in this case? I'm trying to > > picture wh

Fwd: Re: [Haskell-cafe] [Newbie question] -- Looping stdin until condition is met

2008-05-30 Thread Martin Blais
FYI. On Sat, 31 May 2008 02:11:13 +0200, "Daniel Fischer" <[EMAIL PROTECTED]> said: > Am Samstag, 31. Mai 2008 02:28 schrieb Martin Blais: > > Allright, this is a definitely a newbie question. > > > > I'm learning Haskell and going through the exercises

[Haskell-cafe] Literal programming in Haskell with rst-literals

2008-06-21 Thread Martin Blais
Hello Haskell community! I just did a marginally cool thing and I wanted to share it with you. "rst-literals" is a small program I wrote a while ago in order to write documents in reStructuredText format that would embed SQL code for data models in them, a form of literal programming for SQL if