Open chkn opened 4 years ago
Sounds like a good one to start, !
might be contentious as it might be depreciated: https://github.com/fsharp/fslang-suggestions/issues/569
Oh interesting! Though that conversation looks like it's been ongoing for years, and the last comment is from over a year ago.
Personally, I think the !
could be more readable. For C#, we can define an implicit conversion from State<T>
to T
, but for F# you'd basically be stuck writing out .Value
everywhere without this.
Yeah I personally dislike not
more than !
as seen in the comments. I'll see about adding it to the F# sample just to see what it looks like. Try and get the C#/F# examples vaguely the same too.
From the F# perspective, that provides the
State<T>
is just like a ref cell. We should add an F# type extension for State!
dereference and:=
assignment operators for it.