You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, to instantiate the Some variant, we must write the following:
varsome=newOption<int>.Some(42);
Since the generic type parameter is bound to the union, we must define the type parameter every time since it cannot be inferred from the type passed to the union member. It would be nicer to be able to do the following:
// Inferred as `Option<int>.Some` since `42` is an integer.varsomeInt= Option.Some(42);// Inferred as `Option<string>.Some`.varsomeStr= Option.Some("foo");
The text was updated successfully, but these errors were encountered:
Consider the following union:
Currently, to instantiate the
Some
variant, we must write the following:Since the generic type parameter is bound to the union, we must define the type parameter every time since it cannot be inferred from the type passed to the union member. It would be nicer to be able to do the following:
The text was updated successfully, but these errors were encountered: