F# Advent Calendar in English 2019

Update 2019/11/14: As well as year before we will do extra slots again. We will start from slot for [Dec 18 – Dec 24] week, and when they are filled I will add slots for [Dec 11 – Dec 17], then for [Dec 1 – Dec 10] and finally [Dec 25-Dec 31].

F# Advent Calendar is a long tradition in F# community

that became an inspiration for C# Advent Calendar and for Q# Advent Calendar.

Advent 2019 is coming, this year we have 56 free slots. Please join, reserve a slot and spread your thoughts and love to F# with the community.

This year I completely forgot to celebrate 7th birthday of F# Weekly. The very first F# Weekly #43, 2012 was published at 29/10/2012. Since than every 43th edition was an anniversary edition. Help me please celebrate the date – book your slot in #FsAdvent and deliver post in time!


Join F# Advent Calendar today!


  1. Choose F# related topic for your blog post and reserve the slot on Twitter or leave a comment to this post. Please note that you do not have to announce the topic until the date (but you can).
  2. Prepare a blog post in English.
  3. Publish your post on a specified date (according to the calendar).
  4. Post the link to your post on Twitter with hashtags #fsharp and #FsAdvent.


ID Date Author Post Title
#01 Dec 01 (Sun) Nick Blair A functional wrapper around the .net AWS DynamoDB SDK
#02 Dec 01 (Sun) Santa Brings Cloud to Every Developer
#03 Dec 02 (Mon) Steffen Forkmann Announcing Paket 6 alpha
#04 Dec 02 (Mon) Refactoring registration flow to functional architecture
#05 Dec 03 (Tue) Web Crawling Using F#
#06 Dec 03 (Tue) Jonas Juselius AzureAd Authentication with F#
#07 Dec 04 (Wed) Andrew Meier Functional Agent
#08 Dec 04 (Wed) Mathias Brandewinder Santa’s Mailbox
#09 Dec 05 (Thu) Dependency Injection in F# Web APIs
#10 Dec 05 (Thu) Reliability with Intents
#11 Dec 06 (Fri) Peder Klokmose Sørensen Formatting F# Interactive Output
#12 Dec 06 (Fri) Solving reverse polish notation equations in WebAssembly using F#
#13 Dec 07 (Sat)
#14 Dec 07 (Sat) Building custom fibers library in F#
#15 Dec 08 (Sun) FSharp noob’s 4 minute overview of development test workflows
#16 Dec 08 (Sun) Introduction to types – how to program safely from one checkpoint to another
#17 Dec 09 (Mon) John Azariah Lego, Railway Tracks and Origami – Post 1
#18 Dec 09 (Mon) Ian Russell Functional Validation in F# using Applicatives
#19 Dec 10 (Tue) Florian Verdonck Using Create React App with Fable
#20 Dec 10 (Tue) Finding Bacon Numbers using Azure Cosmos DB and F#
#21 Dec 11 (Wed) Tim Forkmann Keep track of your Christmas present production with Chia and Azure Event Hubs
#22 Dec 11 (Wed) Creating a Lego Mindstorms DSL in F#
#23 Dec 12 (Thu) Active Parsers
#24 Dec 12 (Thu) Joe Tremblay A Journey Towards Functional Programming
#25 Dec 13 (Fri) Dave Curylo Azure Alerts to Slack with F#
#26 Dec 13 (Fri) Full F# Blog – Part 3
#27 Dec 14 (Sat) Krzysztof Madej DB deployments with FAKE tool
#28 Dec 14 (Sat) Tom Dodson [cancelled]
extra Dec 14 (Sat) Isaac Abraham Announcing a VS Code and Ionide video series
#29 Dec 15 (Sun) Matt Eland A .NET Manager’s Perspective on F#
#30 Dec 15 (Sun) Kai Ito Type safe SQL Queries using Rezoom.SQL
extra Dec 15 (Sun) Tonino Lucca Transport Tycoon DDD exercises
#31 Dec 16 (Mon) Kevin Avignon Experiments and Adventures in 2019 with F#
#32 Dec 16 (Mon) Mark Pattison Fable Reversi
extra Dec 16 (Mon) Chris Roff Functional BDD Part 2: The Gherkin Type Provider
#33 Dec 17 (Tue) Kunjan Dalal F# on Jupyter
#34 Dec 17 (Tue) Loïc Denuzière Managing page-specific models in Elmish
extra Dec 17 (Tue) Advanced F# Interop
#35 Dec 18 (Wed) Mark Allibone Creating a Fabulous Xamarin app on a budget using F# Data
#36 Dec 18 (Wed)
extra Dec 18 (Wed) dotnetlinux (a bad named repo…)
#37 Dec 19 (Thu) Reed Copsey, Jr. F# Basics – From loops to folds
#38 Dec 19 (Thu) ValidationBlocks
extra Dec 19 (Thu) Use machine learning to categorize web links with F# and ML.NET
#39 Dec 20 (Fri) Scott Wlaschin Against Railway-Oriented Programming
#40 Dec 20 (Fri) Evgeniy Andreev [may be delayed]
extra Dec 20 (Fri) Introduction to F# Type Providers
#41 Dec 21 (Sat) Timothé Larivière How to become a Fabulous developer
#42 Dec 21 (Sat) Riccardo Terrell Distributed Fractal Image processing with Akka.Net Clustering and Docker
extra Dec 21 (Sat) [delayed]
#43 Dec 22 (Sun) Dave Shaw Xmas List Parser
#44 Dec 22 (Sun) Eriawan Kusumawardho Revisiting Windows Forms and WPF in F# on .NET Core 3.1
extra Dec 22 (Sun) Paweł Stadnicki [delayed]
#45 Dec 23 (Mon) @TeaDrivenDev Paying It F#rward
#46 Dec 23 (Mon) Building a Simple Recommendation System in FSharp
extra Dec 23 (Mon) Use the F#orce
#47 Dec 24 (Tue) David Nazarov [delayed]
#48 Dec 24 (Tue) F# metablogging: introducing BlogEngine for your static markdown-based F# blog
extra Dec 24 (Tue) Using FAKE in a Build Server
#49 Dec 25 (Wed) Elliott V. Brown Dawn of the F# Domain Types
extra Dec 25 (Wed) Chester Burbidge Automating .net library versioning – Syntactic Versioning
#50 Dec 26 (Thu) Ronald Schlenker Jingle Bells: Music in F#
#51 Dec 27 (Fri) Steve Smock Getting Scores and Runners-Up in ML.NET Multiclass Applications
#52 Dec 28 (Sat) Fun with Languages and Pattern Matching!
#53 Dec 29 (Sun) Roman Sachse Getting rid of null – Is Maybe an Option Episode 1/3
#54 Dec 30 (Mon) Michael Kohl Learning F# — Writing A Ray Tracer
#55 Dec 31 (Tue) Brett Rowberry My F# Path Continues
#56 Jan 01 (Wed) FSSF Welcome to 2020!


F# Advent Calendar in English 2018

Update 2018/10/29: The vote showed that there is a demand for extra F# Advent slots, so I am going to follow suggestion from Reed Copsey and add new slots in portions. We will start from slot for [Dec 18 – Dec 24] week, and when they are filled I will add slots for [Dec 11 – Dec 17], then for [Dec 2 – Dec 10] and finally [Dec 25-Dec 31].

F# Advent Calendar is a long tradition in F# community

that became an inspiration for C# Advent Calendar and for Q# Advent Calendar.

Advent 2018 is coming, this year we have 54 free slots. Please join, reserve a slot and spread your thoughts and love to F# with the community. A lot of amazing initiatives developed this year: F# 4.5, Fable2, Giraffe & Zebra, Fabulous, Saturn, TP SDK for .NET Core, FAKE 5, Early History of F#, Don Syme finally became F# Hero and much more!

Join F# Advent Calendar today!


  1. Choose F# related topic for your blog post and reserve the slot on Twitter or leave a comment to this post. Please note that you do not have to announce the topic until the date (but you can).
  2. Prepare a blog post in English
  3. Publish your post on a specified date (according to the calendar)
  4. Post the link to your post on Twitter with hashtags #fsharp and #FsAdvent.


ID Date Author Post Title
#01 Dec 02 (Sun) Stachu Korick WTF is WTF#?
#02 Dec 02 (Sun) Steve Shogren F# Domain Design: Interdependent Enums and Booleans
#03 Dec 03 (Mon) A. Prooks Orleans with F# story
#04 Dec 03 (Mon) Andrew Olney Fable Tekno – Use body tracking to drive music synthesis in the browser
#05 Dec 04 (Tue) Abhijay Eshwar
#06 Dec 04 (Tue) John Azariah F# & Q# – A tale of two languages
#07 Dec 05 (Wed) Ryan Riley State Transitions through Sequence Diagrams
#08 Dec 05 (Wed) Olya Three.js + F# + Fable = ❤
#09 Dec 06 (Thu) Dave Thomas Building a CPU Emulator with Fable 2.1
#10 Dec 06 (Thu) Willie Tetlow A Christmas Classifier
#11 Dec 07 (Fri) Jérémie Chassaing Full F# Blog (Part 2)
#12 Dec 07 (Fri) Edgar Sánchez Gordón
extra Dec 07 (Fri) Akos Lukacs Strongly typed HTML templates with FSharp without a framework
#13 Dec 08 (Sat) Devon Burriss Review: F# unit testing frameworks and libraries
#14 Dec 08 (Sat) Grzegorz Dziadkiewicz
#15 Dec 09 (Sun) Chet Husk The crafting of a Figurine, or how to make a library in the new Dotnet SDK world
#16 Dec 09 (Sun) Jeremy Abbott FAKE 5 Migration Cheat Sheet
extra Dec 09 (Sun) Adam Granicz From enterprise to next-generation web: celebrating 11 years with WebSharper
#17 Dec 10 (Mon) Mark Seemann Danish CPR numbers in F#
#18 Dec 10 (Mon) Clément Boudereau Christmas Day 2018 weather forecast (5 next days)
extra Dec 10 (Mon) Gerard SkyLight: Composable UI Hackery with WPF
#19 Dec 11 (Tue) Dustin Moris Gorski Why you should learn F#
#20 Dec 11 (Tue) Jimmy Byrd (Ab)using Disposables for Integration Testing
extra Dec 11 (Tue) TK, Open Sourceror
#21 Dec 12 (Wed) Dave Lowe F# Fantasy Football
#22 Dec 12 (Wed) Tonino Lucca Porting a simple toy app to Elmish
extra Dec 12 (Wed) Paweł Stadnicki Smart City solutions with Fable/F# (Part I)
#23 Dec 13 (Thu) John Stovin
#24 Dec 13 (Thu) Gareth Hubball Streaming F#
extra Dec 13 (Thu) Garth Fritz Getting My Team Hooked on FAKE
#25 Dec 14 (Fri) Tomasz Heimowski SAFE Template – a year retrospective
#26 Dec 14 (Fri) Anthony Lloyd MapSlim – From DictionarySlim to Fsion
extra Dec 14 (Fri) Chris Roff Functional BDD
#27 Dec 15 (Sat) davidglassborow Answering the phone, functionally, again
#28 Dec 15 (Sat) Luis Quintanilla The Case for Doing Machine Learning with F#
extra Dec 15 (Sat) Paweł Bańka Functional imperative, functional declarative
#29 Dec 16 (Sun) Tomasz Jaskuλa Parallel Scan Left in F#
#30 Dec 16 (Sun) Dag Brattli Reactivity in F#
extra Dec 16 (Sun) Maxime Mangel My tips for working with Elmish
#31 Dec 17 (Mon) Kunjan Dalal Tensorflow with Fable-Elmish. A Failed Try
#32 Dec 17 (Mon) Tamizh Vendan Model Binding in Suave and Saturn
extra Dec 17 (Mon) Gien Verschatse My F# aesthetics
#33 Dec 18 (Tue) Reed Copsey, Jr. 2018 Christmas Trees – Cross Platform Edition using Avalonia
#34 Dec 18 (Tue) Justin Hewlett Where’s my Early Return?
extra Dec 18 (Tue) Bob Millar
#35 Dec 19 (Wed) Roman Provazník Event Sourcing – Step by step in F#
#36 Dec 19 (Wed) Florian Verdonck Writing a VS Code extension with Fable 2.1
extra Dec 19 (Wed) Jamie Dixon Animations in Xamarin Forms (XF)
#37 Dec 20 (Thu) Scott Wlaschin Why F# is the best enterprise language
#38 Dec 20 (Thu) Mikhail Shilkov A Fairy Tale of F# and Durable Functions
extra Dec 20 (Thu) Brett Rowberry My Path to F#
#39 Dec 21 (Fri) Evgeniy Andreev Shortest introduction to the compiler design
#40 Dec 21 (Fri) Dave Shaw Santa’s Xmas List in F# and Fable
extra Dec 21 (Fri) Leandro Miranda
#41 Dec 22 (Sat) Caio Proiete
#42 Dec 22 (Sat) Eriawan Kusumawardho F# state in December 2018
extra Dec 22 (Sat) The Whitetigle Even more interop with Fable
#43 Dec 23 (Sun) Roman Sachse Event Sourcing – Do it yourself
#44 Dec 23 (Sun) Riccardo Terrell How to parse a high rate stream of data with low memory allocation
extra Dec 23 (Sun) MokoSan An Introduction to Probabilistic Programming in FSharp
#45 Dec 24 (Mon) Jim Bennett Fabulous Santa Tracker
#46 Dec 24 (Mon) Ashish Vegaraju Function Purity in F#
extra Dec 24 (Mon) Indy Garcia Evolutionary Hyper Parameter optimisation with FSharp, Keras/Tensorflow
#47 Dec 25 (Tue) Isaac Abraham Parsing Excel with F#
#48 Dec 26 (Wed) Jindřich Ivánek My F# space adventure
#49 Dec 27 (Thu) Jason Down CodinGame Contests Meet F#
#50 Dec 28 (Fri) Jack Fox Type All the Things
#51 Dec 29 (Sat) Eelco Mulder Why I like F# over C# – Less Noise
#52 Dec 30 (Sun) Mikhail Smal Navigation with Fable.Elmish
#53 Dec 31 (Mon) Kai Ito Fable React is nice. But what about Fable Preact?
#54 Jan 01 (Tue) FSSF Welcome to 2019!


F# Advent Calendar in English 2017

F# Advent Calendar is an adorable idea, which has become a tradition:

Each year we’ve had an incredible Advent full of F# and Christmas spirit.

Advent 2017 is coming, this year we have 52 free slots. Do not to lose your chance to reserve a slot and spread your thoughts and love to F# with the community. A lot of amazing initiatives developed this year: Fable, Rider, Ionide, SAFE, Visual F#& VS15, dotNET Core, VS for Mac, Expecto, Azure Functions, new F# books and much more! Join F# Advent Calendar today!


Rules are very simple:

  1. Choose F# related topic for your blog post and reserve the slot on Twitter or leave a comment to this post. Please note that you do not have to announce the topic until the date.
  2. Prepare a blog post in English
  3. Publish your post on a specified date (according to the calendar)
  4. Post the link to your post on Twitter with hashtags #fsharp and #FsAdvent.


Slot Date Author Post Title
#01 Dec 03 (Sun)  Michael Newton Reading From the Firehose With Fable
#02 Dec 03 (Sun)  Mikhail Shilkov  Precompiled Azure Functions in F#
#03 Dec 04 (Mon)  Stachu Korick‏  WTF# is going on in the F# world?
#04 Dec 04 (Mon)  Jon Nyman  Over 5 Years of F#
#05 Dec 05 (Tue)  Alex Casquete‏  🙁
#06 Dec 05 (Tue)  Phillip Trelford  F#Unctional Londoners Meetup Activity
#07 Dec 06 (Wed)  Alfonso Garcia-Caro  FableConf: Where the magic happened
#08 Dec 06 (Wed)  Ramón Soto Mathiesen  Bloom Filter Sort (bfsort)
#09 Dec 07 (Thu)  François Nicaise  Merry Christmas Fable Community!
#10 Dec 07 (Thu)  Martin Gondermann A fable of Web MIDI
#11 Dec 08 (Fri)  Devon Burriss  An argument for functional programming
#12 Dec 08 (Fri)  Paweł Bańka  Polymorphwhat?
#13 Dec 09 (Sat)  Evgeniy Andreev‏  Say hello to Avalonia
#14 Dec 09 (Sat)  Karl-Johan Nilsson  Happy Fezmas (or Getting started with Fez)
#15 Dec 10 (Sun)  Eriawan Kusumawardho  Current state of F# 4.x tooling and IDE ecosystem on December 2017
#16 Dec 10 (Sun)  Jeremy Abbott  Implementing the A in SAFE with the Azure CLI
#17 Dec 11 (Mon)  Pierre Irrmann Some advice to F# beginners
#18 Dec 11 (Mon)  Martin Andersen  The soccer player best suited to be Santa Claus
#19 Dec 12 (Tue)  Jamie Dixon  The Social Transf#ormation of Software Development
#20 Dec 12 (Tue)  Ian Russell‏  Building Better Learning Resources
#21 Dec 13 (Wed)  Edgar Sánchez Gordón‏  🙁
#22 Dec 13 (Wed)  Reed Copsey, Jr.  Christmas Trees in WPF, 2017 Update
#23 Dec 14 (Thu)  Cole Dutcher  Hyperoperation via F#
#24 Dec 14 (Thu)  Tom Prior‏  Let’s Get Jammin’
#25 Dec 15 (Fri)  Tamizh Vendan  Generic Programming Made Easy
#26 Dec 15 (Fri)  Scott Nimrod Building an Application’s Server with F#
#27 Dec 16 (Sat)  Mark Pattison Using FAKE to automate building MonoGame content (and draw some fractals)
#28 Dec 16 (Sat)  Julien Roncaglia  Adding our first feature to Ionide
#29 Dec 17 (Sun)  Tomasz Heimowski‏  Splitting Date Ranges
#30 Dec 17 (Sun)  Kunjan Dalal  Indian Chaat with F#
#31 Dec 18 (Mon)  Robert Kuzelj Dependency Management & Injection (3 + 1 Solutions revisited)
#32 Dec 18 (Mon)  Bartosz Sypytkowski‏ An introduction to state-based CRDTs
#33 Dec 19 (Tue)  Tomasz Jaskuλa‏  Statistical analysis using F# and Jupyter notebooks
#34 Dec 19 (Tue)  Dustin Moris Gorski‏ Extending the Giraffe template with different view engine options
#35 Dec 20 (Wed)  Scott Wlaschin‏  Serializing your domain model
#36 Dec 20 (Wed)  Elliott V. Brown F# Advent Day of Code: Modeling types to prevent bugs
#37 Dec 21 (Thu)  Riccardo Terrell  Santa’s Super Sorter: Naughty or Nice?
#38 Dec 21 (Thu)  Bart Sokol  How much code is enough?
Dec 21 (Thu)  Dmitry Morozov  Assert On Steroids
#39 Dec 22 (Fri)  Mike Janger‏  Getting Started with Fable PixiJS
#40 Dec 22 (Fri)  David Glassborow  Answering the phone, functionally
#41 Dec 23 (Sat)  MokoSan  The Lord of the Rings: An F# Approach:

#42 Dec 23 (Sat)  John Azariah  Monkeying Around : Fun with Trees
#43 Dec 24 (Sun)  Roman Nevolin 🙁
#44 Dec 24 (Sun)  Paweł Stadnicki  Triplets: family of functional programming languages – in the same web project
#45 Dec 25 (Mon)  Phillip Carter  Reflecting on F# in 2017
#46 Dec 26 (Tue)  Anthony Brown Working with IoT Edge in F# 
#47 Dec 27 (Wed)  Vagif Abilov‏  Akkling – the unofficial official Akka.NET F# API
#48 Dec 28 (Thu)  Larry O’Brien  fun-ny Faces : Face-based Augmented Reality with F# and the iPhone X
#49 Dec 29 (Fri)  Adam Granicz‏  Serving SPAs
#50 Dec 30 (Sat)  Anthony Lloyd .Net Core 2.0 Performance Notes Revisited
#51 Dec 31 (Sun)  Jeremy Bellows‏  Marquee, Concurrent Web UI Automation Part 1
#52 Jan 01 (Mon)  FSSF  Another New Year for the F# Software Foundation

Why OO Matters (in F#)

I kind of agree and also prefer to use objects in some cases.

Eirik Tsarpalis' blog

F# is a functional-first programming language that comes with a substantial object-oriented feature set. It is so feature-complete in fact, that almost any C# class can be ported over to F# code with little substantial alteration.

However significant, this subset of the language is seeing limited appreciation from the community, which I suspect is partly fuelled by the known criticisms of OOP and partly by a desire to be different than C#. After all, this is a functional-first language so we can just replace all our classes with functions. There is also the opinion that OOP in F# merely serves as a compatibility layer for .NET, so it’s really only there to cover those unfortunate scenarios of having to use a library that accepts interfaces.

Enabling Abstraction

One of the most important aspects of maintaining a nontrivial codebase is controlling complexity. Complexity can be contained by partitioning code into logically…

View original post 1,596 more words

You’re better off using Exceptions

Worth reading, for sure.

Eirik Tsarpalis' blog

Exception handling is an error management paradigm that has often been met with criticism. Such criticisms typically revolve around scoping considerations, exceptions-as-control-flow abuse or even the assertion that exceptions are really just a type safe version of goto. To an extent, these seem like valid concerns but it is not within the scope of this article to address those per se.

Such concerns resonate particularly well within FP communities, often taken to the extreme: we should reject exceptions altogether, since code that throws is necessarily impure. In the F# community, this opinion is in part realized by advocating alternatives like result types and railway-oriented programming. In essence, these approaches follow the Either monad found in Haskell, but often intentionally avoiding the use of do notation/computation expressions (since that’s just interpreted exception semantics).

The TL;DR version of the approach is that we define a union type for results that looks…

View original post 920 more words

F# Advent Calendar in English 2016

Update (11/28/2016): Dear writers, this year we are going to make an e-book from #FsAdvent posts and to raise money for a good cause (read more here). If you do not allow to use your post, please let me know.

F# Advent Calendar is an adorable idea, which has become a tradition:

Each year we’ve had an incredible Advent full of F# and Christmas spirit.

Advent 2016 is coming, do not to lose your chance to reserve a spot and spread your thoughts and love to F# with the community. Have you done something special this year? Do you have any unique experience you are willing to share? Have your project incredibly evolved this year? Are there any good ideas for the post, but you didn’t have time to write it? The time has come – it is right now! You have a chance to share your story with the globe! Join F# Advent Calendar and hurry up!


Rules are very simple:

  1. Choose F# related topic for your blog post and reserve the date on Twitter or leave a comment to this post. Please note that you do not have to announce the topic until the date.
  2. Prepare a blog post in English
  3. Publish your post on a specified date (according to the calendar)
  4. Post the link to your post on Twitter with hashtags #fsharp and #FsAdvent.


Date Author Post Title
Nov 27 (Sun) Anthony Lloyd Functional Event Sourcing meets The Elm Architecture
Nov 27 (Sun) Rick Pack  F# Data Visualization for a Neophyte – CDC Open Data
Nov 28 (Mon) Mark Seemann Easy domain modelling with types
Nov 28 (Mon) Bill Berry Introduction to Azure IoT with Fsharp
Nov 29 (Tue) Mikhail Shilkov Introducing Stream Processing in F#
Nov 29 (Tue) josesoyo Using OpenCL on F# via FSCL
Nov 30 (Wed) Alfonso Garcia-Caro Tree Shaking with Fable
Nov 30 (Wed) Jeremy Bellows NeuralFish – Evolving Neural Topologies in F#
Dec 01 (Thu) Steffen Forkmann Context matters
Dec 01 (Thu) Ramón Soto Mathiesen Semantic Versioning .NET libraries and NuGet packages
Dec 02 (Fri) Chet Husk A Host of Issues: Migrating from UserVoice To GitHub Issues with Canopy and OctoKit.net
Dec 02 (Fri) Kristian Schmidt F# in Production
Dec 03 (Sat) Henrik Feldt A gentle introduction to programming networked services on linux
Dec 04 (Sun) Jérémie Chassaing fck: Fake Construction Kit
Dec 04 (Sun) Phillip Trelford X-Platform Development With Xamarin.Forms And F#
Dec 05 (Mon) Scott Wlaschin Functional approaches to dependency injection
Dec 05 (Mon) Rachel Reese Using type providers to post slack messages
Dec 06 (Tue) Daniel Bachler Using F# on both the frontend and the backend
Dec 06 (Tue) Mark Heath  Asterisk Game in F# and WPF
Dec 07 (Wed) Edgar Sánchez Describing images in your favorite human language
Dec 07 (Wed) András Jankó Distributed web applications in F# with WebSharper
Dec 08 (Thu) Hussam Abu-Libdeh How F# delighted this newbie while experimenting with distributed systems
Dec 08 (Thu) Jonathan Leaver RdKafka for F# Microservices
Dec 09 (Fri) Doug Bruce Build Yourself a Robo-Advisor in F#. Part I : Domain Modelling
Dec 09 (Fri) Gergely Kalapos myTrades.Analytics – a netstandard compatible .NET technical analysis library written in F#
Dec 10 (Sat) Mårten Rånge F# Advent – December 10, 2016 – Implementing a persistent hash map
Dec 10 (Sat) Erik Schierboom Parsing text in F#
Dec 11 (Sun) Matt Olson An Introduction To Testing Suave WebParts
Dec 11 (Sun) Jeremy Abbott Merry Monad Xmas
Dec 12 (Mon) Pierre Irrmann Some advice to F# beginners
Dec 12 (Mon) Pierre-Luc Maheu Scripting in F# using Fake and Paket
Dec 13 (Tue) Roman Provazník Building F# community in Czech Republic
Dec 13 (Tue) Isak Sky Working with SQL syntax trees in F#
Dec 14 (Wed) Troy Kershaw The AsyncArrow
Dec 15 (Thu) Reed Copsey, Jr. Christmas Trees in WPF, 2016 Edition 
Dec 15 (Thu) Dustin Moris Gorski Running Suave in ASP.NET Core (and on top of Kestrel)
Dec 16 (Fri) Michael Newton Advent 2016 (It has a pretty d3 force graph at the end, FParsec examples and other good stuff)
Dec 17 (Sat) Kunjan Dalal Epic Adventure using F#
Dec 17 (Sat) Jan Schiefer Accessing native C libraries on Linux with F# and .Net Core
Dec 19 (Mon) Tomasz Heimowski Creating a tutorial from Git repo
Dec 19 (Mon) Tomasz Jaskuλa Data structures and algorithms – helping Santa Claus find his road to San Francisco
Dec 20 (Tue) Тэ дрэвэт утвикλэрэн Feeding On F#
Dec 20 (Tue) Vagif Abilov reF#actoring: rewriting an actor in F#
Dec 21 (Wed) Riccardo Terrell The Traveling Santa Problem… a Neural Network solution
Dec 21 (Wed) Elastic Inc Solidifying Releases with FAKE (F# MAKE)
Dec 22 (Thu) David Podhola Hello fable-import-sharepoint
Dec 23 (Fri) Carsten König Advent with a Star
Dec 23 (Fri) kekyo2 About Expandable F# Compiler project
Dec 24 (Sat) Roman Nevolin The magic of type providers
Dec 24 (Sat) Ross McKinlay + Andrea McAts When Playstation meets F#, PSX |> Pi
Dec 25 (Sun) Jamie Dixon Age and Sex Analysis Of Microsoft USA MVPs
Dec 25 (Sun) Leif Battermann Purity in an impure language with the free monad – by example of a Tic-Tac-Toe backend with CQRS and event sourcing
Dec 26 (Mon) Tamizh Vendan Implementing Two-Factor Authentication in Suave
Dec 26 (Mon) Marcel Schwark Implementing Pong in a functional manner with Fable
Dec 27 (Tue) Jon Wood Getting Up and Running with FsLab for Data Science 
Dec 29 (Thu) Eriawan Kusumawardho F# Advent: F# 4.0 function first constructor
Dec 30 (Fri) Paulmichael Blasucci Tips & Tricks to Improve Your F# Library’s Public API
Dec 31 (Sat) Adam Granicz Simple reactive scenarios with WebSharper
Jan 01 (Sun) F# Software Foundation Welcome to 2017! A retrospective of the past year

TypeShape: Practical Generic Programming in F#


Eirik Tsarpalis' blog

Last week I announced a new library, TypeShape, with claims that it provides a practical way of doing generic programming in F#. I’m following up with this blog post to elaborate why I believe this to be genuinely useful, and how it could benefit the day-to-day life of the working .NET developer.

The pain of Reflection

Almost everybody who has worked with .NET will at some point need to dabble in the murky ways of reflection. Reflection is needed in scenaria where we need to access data in an indirect fashion, or where circumvention of the type system is necessary.

For example, assume that we have defined the following static method

Assume now that we would like invoke that method, with a value whose type cannot be known at compile time. In other words, we want to define a function

which takes an input of type obj and invokes the generic method…

View original post 558 more words

Wire – Writing one of the fastest .NET serializers

Worth to try

Roger Johansson Blog

First of all, there is no such thing as “the fastest” serializer, it is all contextual.
But under some conditions, I would however argue that Wire is, by far, the fastest of all the .NET serializers out there.

Given the following POCO type.

Round tripping one million objects of this type, that is, serializing and then deserializing a million objects using Wire with all optimizations on, completes in about 550 milliseconds on my personal laptop.

Doing the same using MS Bond, which is the second fastest serializer in the benchmark, takes about 830 milliseconds, and this is while being very generous to Bond as it has some very specific prerequisites.
Protobuf.NET which is the third serializer on this benchmark completes in about 1360 milliseconds.

Other serializers that was included in the same benchmark was Jil, NetSerializer, FS Pickler, Json.NET and .NET BinaryFormatter.


View original post 1,847 more words

F# Type Providers Development Tips (not Tricks)

There are several tips that you probably would like to know if you plan to create a new F# Type Provider(TP) or to contribute to the existing one.

Tip #1: Use FSharp.TypeProviders.StarterPack

Latest version of ProvidedTypes SDK is stored in fsprojects/FSharp.TypeProviders.StarterPack repository and you have to use this version in most cases.

Community agreed to use this repository as master version for the SDK. You may find SDK files committed to other repositories, some of them (like files in FSharp.Data repository) may even be modified, contain new features or latest fixes. Once changes are tested and generalized enough, they will for sure be contributed back to FSharp.TypeProviders.StarterPack. So it is better to use a version from the official repository to be on the safe side.

Tip #2: Use Paket dependency manager

Paket allows you to reference files directly from GitHub and easily keep them up-to-date together with other NuGet dependencies.

All you need is to add two lines to your paket.dependecies files (that tell Paket to download files from GitHub to paket-files folder)

github fsprojects/FSharp.TypeProviders.StarterPack src/ProvidedTypes.fsi
github fsprojects/FSharp.TypeProviders.StarterPack src/ProvidedTypes.fs

and two lines to paket.references file (to tell Paket to insert files into corresponding fsproj files)


You can see how it works in ExcelProvider: paket.dependencies + paket.references

Tip #3: Create two solution files (*.sln)

You should not store TP project and projects that use TP in one solution, because when you reference TP dll, IDE/Intellisense loads this assembly and locks file on a disk. After that, you will not be able to rebuild your TP anymore until you close IDE.

So, it does not work in a long run and you have to separate your code to two solutions. The first one (let’s say SwaggerProvider.sln) will contain TP source code, tests for parser and for all components that don’t call TP directly. The second one (let’s say SwaggerProvider.TestsAndDocs.sln) will contain tests, which use TP directly and docs that may also use TP dll.


Tip #4: Automate build (using FAKE)

This tip is quite generic and you have to do it for all projects, but it becomes extremely useful for type providers. It’s tedious to open a new solution (IDE instance), when you want to test latest changes – it is much easier to have a build script that rebuilds and tests everything in one click.

The good start point here is fsprojects/ProjectScaffold that contains most useful generic build automation steps.

Tip #5: Yes, you can debug Type Providers

Debugging of TP does not look an easy task at first sight (and it is really slow in practice), but it is real.

You can start two instances of your IDE. The first one, for a solution with TP code and the second one for code that uses compiled type provider (here is important to check that the second one really references dll compiled by the first one). For the second IDE you can use TestAndDocs solution from Tip #4 or a simple *.fsx script that calls your TP. The last step is to set break point in the first IDE instance and to attach to the second IDE instance process.

This allows you to debug, but you will not be able to modify the code of TP. After each modification, you will need to close 2nd IDE, rebuild dll and repeat all these steps once again.

However, you can automate all manual steps:

  • Open project properties of TP project.
  • Open Debug tab.
  • Select start external program checkpoint
  • Enter path to your VS devenv.exe (For example: “C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\devenv.exe”)
  • Put path to your tests project (file) in command line arguments (For example “d:\GitHub\SwaggerProvider\SwaggerProvider.TestsAndDocs.sln”)

After that, when you press F5 from your TP project, VS will automatically build your TP, start your instance of VS, attach to a new VS process and open your tests solution in it.


Tip #6: Write tests using FSharp.Compiler.Service

Usefulness of this tip really depends on the TP you are working on, but if you are lucky enough (like I am) and you have an access to a large collection of schemes for your type provider, you can automate testing of compilation of provided types.

There is an awesome resource called APIs.guru (Wikipedia for WEB APIs) that provides an access to several hundred Swagger schemes of real-world Web APIs. For sure, SwaggerProvider uses these schemes to test schema parser and it is relatively easy to do.

But we can go further and check that provided types are “compilable” by F# compiler (there is no collisions in type names, property names, field names and method names).

The one way to do this is to use “Hosted Compiler” feature of F# Compiler Services. This allows us to create a simple script that just instantiates TP for each schema and asks F# Compiler to compile this generated script.

Here is source code from tests:

[<Test; TestCaseSource("JsonSchemasSource")>]
let ``Compile TP`` url =
  let tempFile = Path.GetTempFileName()
  let fs = Path.ChangeExtension(tempFile, ".fs")
  let dll = Path.ChangeExtension(tempFile, ".dll")

  File.WriteAllText(fs, sprintf """
  module TestModule
  open SwaggerProvider
  type ProvidedSwagger = SwaggerProvider<"%s">
  let instance = ProvidedSwagger()
  """ url)

  let errors, exitCode =
      (["fsc.exe"; "-o"; dll; "-a"; fs] @ asms))

  [tempFile; fs; dll]
  |> List.filter File.Exists
  |> List.iter File.Delete

  if exitCode <> 0 then
    let strs = errors |> Array.map(fun x->x.ToString())
    failwithf "Error:\n%s" (String.Join("\n", strs )) 


Tip #7: Handling 3rd party NuGet dependencies

You face a dilemma when your TP needs 3rd party dlls: “How to deliver these dlls to a user?” This is a dilemma, because your IDE will not be able to resolve 3rd party dependencies without your participation if you just add them as dependencies to your NuGet package.

This is the case, for example, when your schema is in JSON format and you decided to use JSON.NET to parse it, or in Yaml format and you want to use YamlDotNet.

Option 1. Pack all dependencies inside your NuGet package.

The simplest solution is to put all required dlls in the folder with your TP dll in NuGet package. In this case, there is nothing to do with assembly resolution and it is definitely a good option to start from.

For example, FSharp.Configuration uses this option and packs SharpYaml.dll inside.

BUT, you have to remember that in this case you limit your users to the exact version of dll packed with your TP. If they reference a newer version from NuGet, it may lead to a run-time error.

Option 2. Uses AssemblyResolve event handler.

If I am not wrong, this solution was firstly developed in RProvider.

Actually, you split your TP into three assemblies:

  • TP.dll that setups AssemblyResolve event handler that helps IDE find assemblies on a hard drive and tells the compiler that TP will be in TP.DesignTime.dll (but doesn’t reference this assembly directly).
  • TP.DesignTime.dll that contains implementation of TP.
  • TP.Runtime.dll that contains the code that should exist in run-time and may be used by provided methods.

TP.dll references TP.Runtime.dll but uses nothing from it. Such dependencies do not break intellisense (because it does not need this assembly), but in the same time your provided code will be able to call code from TP.Runtime.dll.

Read more about this in RProvider Developer Notes (SwaggerProvider uses the same approach).


Tip #8: Use experience of other TP developers