I suggest we ...

support flexible types in type alias

Ability to define

type CreateCommand = unit -> #IDbCommand

instead of

type CreateCommand<'T when 'T :> IDbCommand> = unit -> 'T

because the later forces me to specify the generic type (even with _) at places I'm using it.

I'm not clear if there are cases where it would create issues, but it would be nice to have some explicit ways to tell we are ok with implict polymorphism.

1 vote
Vote
Sign in
(thinking…)
Sign in with: facebook google
Signed in as (Sign out)
You have left! (?) (thinking…)
Gauthier Segay shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

1 comment

Sign in
(thinking…)
Sign in with: facebook google
Signed in as (Sign out)
Submitting...
  • Don Syme commented  ·   ·  Flag as inappropriate

    This seems to create too many issues to make it feasible. It's effectively like adding a form of existential type to the language, since you're really defining

    type CreateCommand = EXISTS ('T :> IDbCommand). unit -> 'T

    That's not a trivial thing to add to F#

F# Language

Feedback and Knowledge Base