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
I've learning F# for some days and one of the first things i found coming from Typescript and Scala context is that i could not find a way to declare a literal type
// the following constant can store one of three literals 1,2 or 3 onlyvalthree:1|2|3=3
Could that be possible on F#, i understand that F# is limited by .NET bytecode and/or metadata, in the case of typescript all type metadata is erased, Scala also erase some types.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I've learning F# for some days and one of the first things i found coming from Typescript and Scala context is that i could not find a way to declare a literal type
Literal types in typescript, source:
Scala also supports literal types, source
Could that be possible on F#, i understand that F# is limited by .NET bytecode and/or metadata, in the case of typescript all type metadata is erased, Scala also erase some types.
Beta Was this translation helpful? Give feedback.
All reactions