Skip to content

Instantly share code, notes, and snippets.

View weebs's full-sized avatar
💭
Just a doot dooter

weebs

💭
Just a doot dooter
View GitHub Profile
@michaeloyer
michaeloyer / srtp.fsx
Last active July 1, 2024 03:15
F# SRTP Example
// SRTP: Statically Resolved Type Parameters
// https://docs.microsoft.com/en-us/dotnet/fsharp/language-reference/generics/statically-resolved-type-parameters
// SRTP Allows for pulling members out of types that where the member is named and typed the same
// In this example SRTP will be used to pull out the 'First: string' and 'Last: string' members
// from different types
// One example of SRTP in the F# Base Class Library is the (+) operator.
// You'll see that it has this type signature: