Hacker News new | past | comments | ask | show | jobs | submit login

Main thing I dislike about errors as ADTs is it forces indentation in both cases. I miss go's "iff err..." otherwise continue as normal. Yes monads can allow that, but they come with their own problems.



Au contraire! You can unindent the final clause of an `if` or `match` block. Fantomas even supports it (`fsharp_experimental_keep_indent_in_branch = true`).


Oh, good to hear! My knowledge is about 7 years out of date at this point. I know typescript and mypy are pretty good at inferring which options of an ADT are impossible in various contexts and letting you do stuff like this, so great to hear F# has upped its game here too.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: