Hey. The mage is doing some fsharp right now. Having fun.

So, they learnt quite a bit about few interesting things. So, F# is really whitespace sensitive. If you have experience with Python, that’s kind of what I am talking about. Things differ quite a bit, but the general idea is similar. In C, x+y and x + y are pretty similar. It can mess you bad in F#.

The compiler is pretty amazing. It’s no lie when they said, you really don’t need any debugger. It’ just amazing. Type interference and super strong static typing makes you really confident in what you do. Also, the compiler and the tooling is really helpful in making your life easier.

It’s a relatively simple language to pick up. You declare functions and variables both using word let. You can use functions as arguements, which makes it pretty interesting. You have generic functions allowing you to take any type without specifying the type but gives you good checking, which is really enjoyable in my opinion. The arguments are curried. (Should check a wikipedia link on it, if you don’t get what I mean). Functions can be nested inside other functions.

Pattern matching is definitely interesting. The overall construct is pretty similar to if-then construct in any language, only that these are extremely flexible, unlike switch case, or if-else statement in other languages, making writing code a pleasure. I’ll put up some code so you can see what I mean.

let greeting name =
   match name with
   | "Steve" | "Kristina" | "Matt" -> "Hello!"
   | "Carlos" | "Maria" -> "Hola!"
   | "Worf" -> "nuqneH!"
   | "Pierre" | "Monique" -> "Bonjour!"
   | _ -> "DOES NOT COMPUTE!"

A shorter way of doing the same is allowed in F#.

let something = function
    | test1 -> value1
    | test2 -> value2
    | test3 -> value3