F# – converting a C# dictionary to a Map
Found a useful little snippet that converts a C# dictionary to F#’s map which uses the built-in KeyValue active pattern:
Found a useful little snippet that converts a C# dictionary to F#’s map which uses the built-in KeyValue active pattern:
I spent the last couple of nights and put together a small BERT serializer for .Net called Filbert. What’s BERT? BERT (Binary ERlang Term) is a binary format based on Erlang’s binary serialization format (as used by erlang:term_to_binary/1) but supports a couple of complex types such as boolean, dictionary and time, in additional to …
Update 2012/08/23: Thanks for the suggestion from Jizugu in the comments, I’ve updated the post to show you his approach to calling the explicit operator in a clean and elegant way. In C#, you can define an explicit operator for your type using the explicit keyword: You can define an explicit operator like the …
You can specify a function which can take in a numeric value with a generic unit of measure easily enough: Similarly, you can also specify a discriminated union whose clauses can be of a numeric value with a generic unit of measure, like this:
Peculiarly I couldn’t find any documented way to create a type extension for a generic array, ‘a [ ], turns out you need to use backtick marks ( ` ) around the square brackets in order to do that:
Note: Don’t forget to check out Benchmarks page to see the latest round up of binary and JSON serializers. Following on from my previous test, I have now included JsonFx and as well as the Json.Net BSON serializer in the mix to see how they match up. The results (in milliseconds) as well as the …
Considering a very simple finite state machine (FSM) such as a code lock which requires you to enter a 4-digit numeric code and upon which will open the lock for a brief few seconds. Such a FSM have two states: Locked and Open. Every time a key is entered it checks the sequence of digits …
Another week, another Thursday, another release and another new slot to add to our platoon of F#-backed slots game, Plants vs Zombies Summer Brains is now live on Lucky Gem Casino! Plants vs Zombies Summer Brainz As you can see from the sports stadium in the background, this brand new 25-line slot is clearly themed …
Related Posts Part 1 Part 2 Part 3 Here I will look at how some commonly used functions in F#’s List module might be translated to Erlang using Erlang’s equivalent – the lists module. List.append F#: let newList = List.append [ 1..5 ] [ 6..10 ] Erlang: NewList = lists:append([ 1, 2, 3, …
What does this F# code look like in Erlang – Part 4 of N Read More »
Today we released another new slot that runs on our F# slots engine onto JackpotJoy Slots. This time it’s a Japanese themed game with a rather cool bonus game feature Samurai vs Ninja Samurai vs Ninja is a 25-line slot, when you land a Samurai symbol on the first and a Ninja symbol on the …
By continuing to use the site, you agree to the use of cookies. more information
The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.