[ fmfp11 ]
by leo
@ 24.02.2011 23:10 CEST
For the first week I got you some simple extra exercises. Most of them were already covered in the lecture or in the tutorial. But probably it might be helpful to repeat it by your own.
Start GHCi and define y and x by typing "let x= 31" and "let y=11". So now do some math with this directly in the GHCi-Console.
- Add x and y
- Subtract y from x
- Multiply x and y
- Divide 3 by 5
- Divide x by y in such a way that you get the next lower Integer
- Find the modulo of x divided by y
- Get x to the power of y
- Get the square root of x
- Get the cube root of 27 (Hint: If you need help, look how the square root is defined in prelude)
Define the function for the n-th Factorial. You might try the different methods in haskell to get such a function.
Prove kn(<k1,k2>), kn({s}k1) |- kn(s) with the knowledge derivation rules in http://people.inf.ethz.ch/meiersi/teaching/fmfp10/tut-sheet1.pdf (that should be now really easy for you). Solve the knowledge proofs in this file without looking at the solution.
I will put up some solution for this some when next week.
[ fmfp11 ]
by leo
@ 22.02.2011 19:27 CEST
Hi dear Student, you found the website to Leo's Functional Programming Tutorial. I will publish here extra exercises and stuff from the tutorial.
"So now! How to start!" I think this is a good start:
"I want more!" Here you go:
"Ok, that's all boring! Give me more!" Ok, if you really wish:
- Try to solve the exercise in more than one way! Usually you can solve every problem in haskell in three to four different ways.
- The project euler gives you quite a lot of problems. Haskell is a good programming language to solve them. But they are hard and it might be highly addictive.
So I wish you all the best with the course! And feedback is always appreciated.
[ Blog ]
by leo
@ 22.02.2011 19:00 CEST
Dear reader you might have noticed this blog is not so much in use anymore. I'm still very busy getting smart(er)! For the next few weeks I will be a TA in the ETH course Formal Methods and Functional Programing. Because I'm way too lazy to do a own website for it, I will misuse this blog. So if you don't care about haskell and/or functional programing (but I think you should) it's now time to "unfollow" this blog.
I will add especially add extra exercise as supplement to the exercises from the course. So you might not expect a full course here and some stuff might be slightly out of context. But if you are a beginner in haskell you might to want learn haskell in 10 minutes (very short tutorial), try haskell online or go a bit deeper with the (online free available) book "Real World Haskell".