[Haskell-cafe] loop problem
bob at redivi.com
Sat May 10 18:29:10 UTC 2014
On Saturday, May 10, 2014, Roelof Wobben <r.wobben at home.nl> wrote:
> Stuart A. Kurtz schreef op 10-5-2014 18:17:
>> Dear Roelof,
>> I took a quick look at the course -- it wasn't immediately evident to me
>> where you are in it. It looks pretty good, although more examples/exercise
>> are always welcome.
>> It occurred to me, though, if you're going to write it so it looks like
>> C, you'd might as well take advantage of Text.Printf:
>> import Control.Monad
>> import Text.Printf
>> loop :: Int -> IO ()
>> loop n = when (n <= 100) $ do
>> printf "%d %d\n" n (n^2)
>> loop $ n+1
>> main :: IO ()
>> main = loop 1
> Sorry that I did not make that clear.
> So in your oponion this could be a good way to learn haskell very good.
> I get the feeling on your remarks that im not really to do things the
> haskell way and that is what im looking for.
> I have looked at the book http://learnyouahaskell.com/chapters but I
> miss there exercises
> What do you think about this one : http://www.umiacs.umd.edu/~
http://exercism.io/ has a lot of Haskell exercises and community code
review is part of the site so you won't have to ask for help elsewhere.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe