Skip to content

Instantly share code, notes, and snippets.

Created June 21, 2012 09:18
  • Star 27 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
F# record implementing an interface
namespace MyNamespace
type IMyInterface =
abstract GetValue: unit -> string
type MyRecord =
{ MyField1: int
MyField2: string }
interface IMyInterface with
member x.GetValue() = x.MyField2
Copy link

Hey man, thank you so much for this gist! When you search for "record interface implementation F#" this is the first result, and I can't tell you how often I'm coming back here to refresh my mind on the syntax. Just can't get over the fact that "interface _ with _" comes after the brackets and is soley controlled via indentation for some reason.

Copy link


Copy link

Thumbs up !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment