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

> Lets say you have a huge overly-convoluted Haskell program. Somewhere deep down a call hierachy of pure functions you need to print something to the console. That is not easy to refactor.

> Or vice-versa you have a huge convoluted program where everything happens inside an IO monad because at some point something is written to the console. Now you realize you dont need to write to the console.

These problems are essentially completely resolved these days by a modern effect system like effectful. Basically, they allow you to do arbitrary effects deep down a call stack with minimal plumbing (you still have adjust the types, as you should: that's the point of effect tracking!) and also to remove effects, so you can easily convert between pure code and "effectful code that just so happens to do no effects".

https://github.com/haskell-effectful/effectful




So until this library solved all problems, it was possible to create messy and hard-to-refactor code in Haskell.


It's still possible to do that! It's just that particular rough edge (which was indeed a problem, just not a particularly important one) has been smoothed off.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

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

Search: