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

But sprintf is not defined in Haskell, nor is it really needed. printf returns a typeclass that includes both 'String' and 'IO a'.


My point is that there should be no typeclass; there's no reason to combine IO and formatting in the same function, and doing so makes it more difficult to read and modify code.


Agreed. This is something I dislike about Haskell. After seeing the regex class and it tons of contexts I was just thinking "didn't they learn anything from perl?".




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

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

Search: