So, it happened, today i passed the final test of the functional programming class here at University of Bremen. We learned about the fundamentals of functional programming and why it matters, the language of “choice” was Haskell. This post is some kind of information for students who are about to select this module and are wondering how deep they have to dive to pass it.
First things first: Just like PI1+2 it’s rather easy, you don’t have to know everything you learned in the lectures, after passing the exercises throughout the semester you just have to solve a simple, intermediate or hard programming task. Usually you’ve got a list of former exercises (in simpler form, so YOUR exam will be one of the examples plus either some minor modification or some stuff on top of it.). If you’re up for a module-wide exam you’ll have to learn some theoretical stuff about functional programming in general as well as Haskell-specific things, too (That means you didn’t pass the weekly tests over the semester) – So in case you’re wondering whether to learn those things: You should (for your own sake!), but you don’t need to. I took the intermediate task and i had to write a function similar to “indexesOf” – so the signature was
indexesOf :: Int -> [Int] -> Int, not even Polymorphismic. That’s the thing you can expect when taking the intermediate task. The two guys i had the exam with chose the simple ones and had to split a list of Integers in half and invert the latter one. After finishing i was able to take a look at the hard tasks and they were really for people who are keen to have 95+% in the course. You had to deal with algebraic types and both types of Polymorphism at a higher level. They are actually doable, but it wouldn’t be enough to just write some simple code when learning for the exam. I’ll put some of the exercises I used to learn for the exam in here tomorrow, after adding a good syntax-highlighting plugin to this WordPress thingy.
At last one thing i can assure you: Functional programming is far more interesting than you might think in the beginning (If you’re coming from the OOP world or never coded before PI1 or PI2, this is some mind blowing stuff, suddenly you get things you always thought were obligatory.) and i will definitely either keep Haskell in my bag or try Elixir whenever i’m free for personal projects.