I suggest we ...

Allow generic type constraints for union and record

I suggest that the ability to express the following type constraints be added:

when 'T : union
when 'T : record

This would enable apis which use quotations or reflection over the supplied record or union to be safer.

The constraint could be enforced at runtime if unions or records implemented some sort of marker interface, perhaps there is a better way.

2 votes
Vote
Sign in
(thinking…)
Sign in with: Facebook Google
Signed in as (Sign out)
You have left! (?) (thinking…)
Huw Simpson shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

0 comments

Sign in
(thinking…)
Sign in with: Facebook Google
Signed in as (Sign out)
Submitting...

F# Language

Feedback and Knowledge Base