Optional Property Extensions With State

11 views
Skip to first unread message

Peter

unread,
Mar 5, 2015, 9:58:33 AM3/5/15
to fsharp-o...@googlegroups.com
I'm currently using type composition in my design to extend an existing type, but I'm curious if F# optional extensions might also be useful.  I understand how to implement optional extension methods, but I'm having trouble with optional extension properties.  It appears that optional property extensions are possible (https://msdn.microsoft.com/en-us/library/dd233211.aspx), but it doesn't appear that they can include their own state/backing store.  The few examples I've seen only use the existing state available in the type being extended and act more like member functions than properties with a backing store.  Does the F# compiler allow for a manual/automatic backing store with optional property extensions?  If so, please provide a small code sample.

Thank you,

Peter Santoro
Reply all
Reply to author
Forward
0 new messages