Aventures in F# - words is all you need
F# let's you specify the same thing in different styles - depending on your likings (clarity, purity, style, compactness, problem-domain-specific) you my choose the appropriate expression. For example: Assume we have a list of numbers and want to transform them in a certain way, e.g. we want to square them. 1. generate a list of numbers let numbers = [ for i in 1..10 -> i];; Now we have different options to reach our goal, i.e. transforming the elements of the list to be equal to their respective square, i.e. i -> i * i The first way to do this is to generate the set with squared numbers. let sqnumbers = [ for i in 1..10 -> i * i];; While it solves the problem, it was not exactly what I was looking for. So we define a function that takes an integer list as input and generates the appropriate output list by taking each element squaring it and appending it to the output list. Let sqfunc be this function. One way of calling sqfunc is: sqfunc numbers;; But we could also us...