News for hackers. Stuff that matters.
Re:Names are not type safety (2020) by eru on Sunday August 03, 2025 @09:38PM (#44781366)
The alternative to newtypes is probably to go the same route as OCaml and have people explicitly bring their own instances for typeclasses, instead of allowing each type only one instance?

I think OCaml calls these things modules or so. But the concepts are similar. For most cases, when there's one obvious instance that you want, having Haskell pick the instance is less of a hassle.

Re:Names are not type safety (2020) by 5pl1n73r on Monday August 04, 2025 @08:05AM (#44784703)
Yes, I may have accidentally spilled, but I prefer ML modules to typeclasses.
Re:Names are not type safety (2020) by eru on Monday August 04, 2025 @08:12PM (#44792844)
I like ML-style modules in principle, but in practice I like the ergonomics of typeclasses.

But while I did nearly half of my career in either OCaml or Haskell, I did all of my OCaml programming and most of my Haskell programming before the recent surge of really good autocompletion systems / AI; and I notice how much they help with Rust.

So the ergonomics of ML-style modules might be perfectly acceptable now, when you have an eager assistant filling in the busy work for obvious cases. Not sure.