top | item 45870101

(no title)

yujzgzc | 3 months ago

Thanks, these are good examples of holes in typescript that I wasn't aware of. I guess I haven't pushed it enough yet to run into them. I agree Ocaml wouldn't fail.

> I can't see what are you speficially missing here that pattern matching and maybe an additional variant type doesn't get you in OCaml. You get exhaustiveness checking and can narrow the value down to the payload of the variant.

A couple things, being constrained to pattern matching in places where imperative programming would be more natural, having to declare lots of special purpose types explicitly vs being able to rely on ad hoc duck typing.

discuss

order

No comments yet.