Archiv der Kategorie: F#

Units of measurement in F#

One of the major advantages of static typed programming languages is the detection of type specific errors during implementation time. This early detection of errors may save time and money. Such type checks during implementation time are also possible for … Weiterlesen

Veröffentlicht unter .NET, F# | Verschlagwortet mit , , | Kommentar hinterlassen

Use a C# class in F#

In my actual projects I like to use a combination of C# and F# to implement the needed applications. I think C# is a very efficient programming language to implement the user interface and the business layer and F# may … Weiterlesen

Veröffentlicht unter .NET, F# | Kommentar hinterlassen

Currying in F#

Currying is a transformation process which converts a function with multiple arguments into a chain of embedded functions, each with single parameter. In F# function declarations are curried by default. Therefore you don’t usually need to curry functions. But even … Weiterlesen

Veröffentlicht unter .NET, F# | Verschlagwortet mit , , | 1 Kommentar

Memoization

Memoization is a concept based on lazy evaluation and caching of function results. If you have a function without side effects and you call the function multiple times with the same arguments, then it is sufficient to call the function … Weiterlesen

Veröffentlicht unter .NET, F# | Verschlagwortet mit , , , , | Kommentar hinterlassen

F# Array vs. List

There existing two basic collection types in F#: Array and List. Within this article I want to compare both collection types and I want to help you choose the right one for your programming issues.   Array An array is … Weiterlesen

Veröffentlicht unter .NET, F# | Verschlagwortet mit , , , , | Kommentar hinterlassen

Loop vs. Recursion

Whenever people start to implement recursive functions in C# they begin to discuss whether recursive function calls or loops are faster and which technique they should prefer. I have heard such discussion several times and therefore I want to do … Weiterlesen

Veröffentlicht unter .NET, C#, F# | Verschlagwortet mit | Kommentar hinterlassen

Function composition

To implement a function by using other functions is one of the basic concepts in most programming languages. Therefore this feature is very well supported in a lot of programming languages, especially in functional programming languages. Within this article I … Weiterlesen

Veröffentlicht unter .NET, F# | Verschlagwortet mit , | Kommentar hinterlassen

Tail recursive functions

Recursive function calls may be treated by the programming language like any other function calls. This will require the allocation of an additional stack frame for each call. Therefore recursive calls may cause a stack overflow. Furthermore this overhead of … Weiterlesen

Veröffentlicht unter .NET, F# | Verschlagwortet mit , | Kommentar hinterlassen

Increase the readability of you source code by using the Pipe Forward operator

I really like the Pipe Forward operator in F#. This simple operator allows to write source code which matches a read direction from left to right.   Pipe Forward operator example The following example shows the Pipe Forward operator in … Weiterlesen

Veröffentlicht unter .NET, F# | Verschlagwortet mit , , | Kommentar hinterlassen

Shadowing function parameters with local variables

Within this article I want to ask a very basic question which is important in nearly all programming languages: What if you have a function with a parameter x and inside the function you declare a local variable x. Will … Weiterlesen

Veröffentlicht unter C#, F#, Racket | Verschlagwortet mit , , , | 1 Kommentar