💡 Explore using method extension to provide a direct method
for a delegate
creating from FunctionType
#144
Labels
method
for a delegate
creating from FunctionType
#144
This is an idea to avoid having to use
Invoke
from the user POV, I am not sure if this path we want to take or not.Context
When converting
FunctionType
we generates adelegate
in order to keep the named arguments, but this means the user needs toInvoke
the delegate as they can't be called like a normalmember
in F#.Proposition
An idea was proposed to create a
member
as an alias to the delegate to offer the standard F# member call API:Impact
But this solution has 2 impacts:
It means we need to change the casing of the added member (
random
->Ramdom
) in order to access it. We can't really suffix the low level member because we need it for the setter too.Here the example above works as is, but sometimes type are defined in nested modules. In this case, the extension method would not be visible until the user
open
the correct modulesThis can be workaround by adding a new
Extensions
module decorated with[<AutoOpen>]
.Note: Make sure to check #143 for all the ideas
The text was updated successfully, but these errors were encountered: