Uujzjophnkzqevrkweff
Meet up

F#unctional Londoners September

FREE: Register Now

Wednesday, 18th September at CodeNode, London

This meetup is organised by F#unctional Londoners Meetup Group Starts at 6:30 PM.

Type-Safe Datatype-Generic Programming in F#

Datatype-generic programming is a powerful technique that allows you to parameterise your functions by the shape of the types that they are invoked with. A simple example of datatype-generic programming is a pretty-printer for arbitrary record types – it inspects the structure of the record type at runtime to find its fields and then prints the value of each field in turn.

In .NET languages, datatype-generic programming is typically achieved through a combination of generic type parameters and reflection, but this method suffers from the proliferation of obj values and therefore unsafe code.

In this talk, we’ll take a look at three libraries:

• TypeEquality - https://github.com/G-Research/TypeEquality

• HCollections - https://github.com/nickcowle/HCollections

• TeqCrate - https://github.com/nickcowle/TeqCrate

We’ll show that when taken together, these libraries offer a type-safe abstraction layer over simple reflection. By using them, we can create our own libraries that are not only type-safe with respect to their public API, but whose internal implementations are completely type-safe as well.

Nicholas Cowle

Professional F# developer by day, amateur type theorist by night, Nick enjoys drawing ideas from the world of functional programming to create robust and safe software for the finance industry.

Thanks to our sponsors

Attending Members

Overview

Type-Safe Datatype-Generic Programming in F#

Datatype-generic programming is a powerful technique that allows you to parameterise your functions by the shape of the types that they are invoked with. A simple example of datatype-generic programming is a pretty-printer for arbitrary record types – it inspects the structure of the record type at runtime to find its fields and then prints the value of each field in turn.

In .NET languages, datatype-generic programming is typically achieved through a combination of generic type parameters and reflection, but this method suffers from the proliferation of obj values and therefore unsafe code.

In this talk, we’ll take a look at three libraries:

• TypeEquality - https://github.com/G-Research/TypeEquality

• HCollections - https://github.com/nickcowle/HCollections

• TeqCrate - https://github.com/nickcowle/TeqCrate

We’ll show that when taken together, these libraries offer a type-safe abstraction layer over simple reflection. By using them, we can create our own libraries that are not only type-safe with respect to their public API, but whose internal implementations are completely type-safe as well.

Nicholas Cowle

Professional F# developer by day, amateur type theorist by night, Nick enjoys drawing ideas from the world of functional programming to create robust and safe software for the finance industry.

Thanks to our sponsors

Who's coming?

Attending Members