NYC F# User Group Monthly Lab Hours

Filed under: community

There was a coder dojo format this Saturday.

Today with the F# group, we worked on katas during coder dojo. Exercises from

Learned some F# quirks…

In Xamarin the way to run code (highlighted) is CTRL+Ret

  1. F# lists uses ; to separate elements instead of ,
  2. In order to logically compare two values, you use one = instead of two ==
  3. When grabbing the substring from, "string".[..1] don’t forget the dot . right before the left square bracket. Use 2 dots instead of ‘:’. When starting from first index, you can skip typing the 0.
  4. The easiest way to convert an integer to string is to use string(i)
  5. Seq, short for sequence, is the most generic type of array. You can grab the .head or .last element

“In F#, exceptions should be truly exceptional. In .NET you only want to throw exceptions at highest level or if something happened in internals (i.e. database connection shot)” ~ Paul B.