Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Hard to tell. But currently the Crystal type system is a bit restricted.

For example, you can't express this in crystal, like in Typescript:

    type Easing = "ease-in" | "ease-out" | "ease-in-out";


Why would you want that over enums?


Enum is limited for integer value.


You can define string enum type with a macro.

https://github.com/crystal-lang/crystal/issues/10281#issueco...


The internal representation doesn't really matter, does it?




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

Search: