Hacker Newsnew | past | comments | ask | show | jobs | submit | js_of_ocaml_3's commentslogin

A lot of the ecosystem is written in TypeScript (heavy on structural typing). Last I've checked OCaml still doesn't have substructural row polymorphism or set theoretic types, so this seems to be a futile endeavor until underlying fundamentals in its type system are addressed.

Elm & PureScript I believe solved this problem.


OCaml's object types solve exactly this problem. And they have been around since Caml became OCaml.


Why would you need substructural typing to emulate Typescript? Is there a substructural type system feature in TS?

You can accomplish width subtyping with OCaml's "polymorphic variants", which could be used to emulate TS union types more flexibly than traditional sum types.

What are the features of Elm and Purescript that help model TS that OCaml doesn't have?


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

Search: