fable-compiler / repl

Fable online REPL
http://fable.io/repl
MIT License
64 stars 37 forks source link

Change string to DU #118

Closed awf closed 3 years ago

awf commented 3 years ago

When viewing this sample, I thought it might be nice to remove the "_" match on (old) line 176. To do so, I thought it might be nicer to use a discriminated union instead of strings to indicate state. Hence this PR -- I hope you like it :) All comments very much welcome -- I am a distinct newbie.

gitpod-io[bot] commented 3 years ago

awf commented 3 years ago

@cgravill called this "moving from string typing to strong typing", which I found very amusing.

cgravill commented 3 years ago

I've found a lot of incidental programmers much happier with F#/Fable (than JavaScript) once we started using more typing features. Combined with the excellent Elm(ish) approach it lets them concentrate on mapping domain types to a visualisation without worrying they're breaking the infrastructure programming.

alfonsogarciacaro commented 3 years ago

Sorry, missed the notification! This is a good change, I think the string remained from the original React example we converted. Thank you!

awf commented 3 years ago

Thanks!