-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support provided union and record types #154
Comments
** by fslang-admin on 2/4/2016 12:00:00 AM ** Marking as “approved in principle” (it will show as “planned”). However, in reality it is both relatively low priority and relatively hard to implement, so I don’t expect this to happen any time soon. For example, we would have to reverse-map the metadata associated with F#-specific types. This is already done in F# reflection FSharpType.IsRecord and so on. |
I propose we split this in two, add provided records, add provided unions. @dsyme I know you said provided active patterns could be more generally usable than unions, maybe this could be fleshed out? |
For RFCs yes, we can do two separate ones
Here's the quick summary: APs are defined as module-let functions. Provided module-let functions and values are not supported. Hence the first step would probably be to allow those, then APs should drop out as part of that. |
@dsyme I actually have ProvidedUnions and ProvidedRecords in Falanx :-) |
Added a relevant comment to one of the above discussions:
The main thing is that it's just a lot of work. The way TPs are architected (providing .NET System.Type/MethodInfo etc. and the compiler converts them to F# TAST nodes) effectively means we have to fully invert the compilation process from .NET IL types --> F# TAST types. This is implemented in tast.fs and infos.fs in the F# compiler for methods, types, properties, events but there is no corresponding inversion for F#-defined union/record types. The inversion would be similar to that implemented in FSharp.Reflection.FSharpType/FSharpValue based on the attributes etc. But it's painful to implement and fully test accurately.
Yes, people are interested in this |
Yeah I bake in all the attributes to get reflection to work for ProvidedUnions and ProvidedRecords in Falanx. |
I just noticed, we don't have an RFC for this. I'll dig into some stuff and see whether I can get anything together. I have the feeling this is worth having for FS-1023 |
Submitted by Gustavo Guerra on 3/21/2014 12:00:00 AM
111 votes on UserVoice prior to migration
Title says it all
Original UserVoice Submission
Archived Uservoice Comments
The text was updated successfully, but these errors were encountered: