concept rest in category f#

appears as: rest, The rest
Get Programming with F#: A guide for .NET developers

This is an excerpt from Manning's book Get Programming with F#: A guide for .NET developers.

In this context, the variable added is only in scope within the context of the curly braces. Outside of that, it’s out of scope and not accessible by the rest of the program. On the other hand, F# is a whitespace-significant language: rather than using curly braces, you have to indent code to tell the compiler that you’re in a nested scope.

Hopefully that wasn’t too bad! You’ve now spent some time trying to hook up a C# WPF application to an F# code base, as well as adding some NuGet packages into the mix. You’ve seen that F# can interoperate with the rest of the .NET ecosystem easily and effectively.

Real-World Functional Programming with Examples in F# and C#

This is an excerpt from Manning's book Real-World Functional Programming with Examples in F# and C#.

We’ve included this background material because it demonstrates some of the ideas in their purest form. Hopefully you’ll find it as interesting as we do—but it’s not essential in order to understand the rest of the book.

Figure 3.1. A functional list containing 6, 2, 7, and 3. Rectangles represent cons cells, which contain a value and a reference to the rest of the list. The last cons cell references a special value representing an empty list.

This function is in many ways similar to those for processing lists that we implemented in the previous chapter. As you can see, the function is declared using the let rec keyword, so it’s recursive. It takes a list of strings as an argument (lines) and uses pattern matching to test whether the list is an empty list or a cons cell. For an empty list, it directly returns an empty list of tuples ❶. If the pattern matching executes the branch for a cons cell ❷, it assigns a value of the first element from the list to the value currentLine and list containing the remaining elements to the value remaining. The code for this branch first processes a single row using the convertDataRow function from listing 4.2 and then recursively processes the rest of the list. Finally the code constructs a new cons cell: it contains the processed row as a head and the recursively processed remainder of the list as a tail. This means that the function executes convertDataRow for each string in the list and collects the results into a new list.