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

But other languages give you a syntactic cue that what you're doing might be potentially expensive - it's a function call. That's why most language styleguides have a naming convention for accessors, so you can distinguish between method calls that are basically free vs. method calls that might be expensive.

In Haskell, every single token might trigger a long computation, so it's very easy to introduce something that wildly changes the performance characteristics of the program.




Hmm I have come across many a codebase in countless languages where there was no way to discern that type of information from the naming convention. Even accessors in say C# or Java are perfectly legit to do any side effect they want. In fact I think it is worse in those situations - because side effects are not modeled. Indeed, no language has found a way to model non-termination in the type system, hence the halting problem.

Honestly I just haven't experienced this very often in Haskell... When I do it is usually a 'doh moment and a simple fix.




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

Search: