I suggest we ...

Add constraints to match FSharpType.Is* predicates

I have a type, CaseSet<'a>, that is only meant to be used with descriminated unions. The only way I've found to enforce this is at runtime using FSharpType.IsUnion. I considered using type providers, but those aren't supported in PCLs.

I propose adding the following constraints based on the corresponding FSharpType reflection functions.

function : IsFunction
tuple : IsTuple
union : IsUnion
record : IsRecord
module : IsModule
exception : IsExceptionRepresentation

(I'm not really sure about that last one... I included it for completeness but maybe just testing for some subclass is sufficient?)

1 vote
Vote
Sign in
(thinking…)
Sign in with: Facebook Google
Signed in as (Sign out)
You have left! (?) (thinking…)
Matthew Orlando 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