5 ms·
Cool, this can be done in any language with typing. For languages with dynamic typing, you would just check the type at runtime.
by jasonjackson 13y ago
Cool, this can be done in any language with typing. For languages with dynamic typing, you would just check the type at runtime.
- beala 13y agoThere is a big difference between static and dynamic checking. In a statically checked language like Haskell the error is guaranteed to be caught at compile time rather than maybe being caught runtime.
- gizmo686 13y agoOne of the main things that drew me to Haskell is how little effort it takes to define a new type.
- awj 13y agoIt can be, yes, but it's easier to do so in Haskell. Some of the compiler extensions allow you to push truly crazy invariants through type checking. Also, for most dynamic languages, checking the type at runtime goes against the grain of the language. Python or Ruby code that is littered with type checks is often unnecessarily brittle.