<div dir="ltr">Hint 1) fib n = fib (n - 1) + fib (n - 2), with proper base cases<div><br></div><div>Hint 2) use mapM_ to print a list of pairs, where the list is created by zipping [1..] with the list of fibonacci numbers</div></div><div class="gmail_extra"><br><div class="gmail_quote">On 11 November 2015 at 18:29, Roelof Wobben <span dir="ltr"><<a href="mailto:r.wobben@home.nl" target="_blank">r.wobben@home.nl</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<br>
<br>
I have this exercise :<br>
<br>
Define a function<br>
fibTable :: Integer -> String<br>
which produces a table of Fibonacci numbers. For instance, the effect of putStr<br>
(fibTable 6) should be<br>
n fib n<br>
0 0<br>
1 1<br>
2 1<br>
3 2<br>
4 3<br>
5 5<br>
6 8<br>
<br>
<br>
<br>
1) Can somone give me any pointers how to calculate the fibb numbers with list comprehension.<br>
I know that the fib numbers are (n -1) + n<br>
<br>
2) Can someone give me any pointers how to write the outcome of every run<br>
<br>
Roelof<br>
<br>
<br>
_______________________________________________<br>
Beginners mailing list<br>
<a href="mailto:Beginners@haskell.org" target="_blank">Beginners@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div>Regards</div><div dir="ltr"><div><br></div><div>Sumit Sahrawat</div></div></div></div></div></div></div>
</div>