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

The Haskell Prelude is famously awful, so OCaml stdlib isn't much of a needle-mover.

I wouldn't say it's awful, however there are definitely improvements that need to be made.

The default string type is terrible, the default file input output introduces space leaks and has terrible performance. The default numerical hierachy, (Num a) in particular, is nothing mathematicians tend to study (it would be much more sensible to define Ring a, for example). It overemphasizes lists and instead of attempting to define polymorphic functions that give access to a wide range of containers, pollutes the global name space with list specific functions, even though lists are rarely the right choice.

Are there any alternative implementations that address these issues?

Yes, see the list of alternative preludes:


See the classy prelude github page: https://github.com/snoyberg/classy-prelude

And the latest blog post about classy-prelude: http://www.yesodweb.com/blog/2013/01/so-many-preludes

It looks like iHaskell actually depends on classy-prelude: http://hackage.haskell.org/package/ihaskell

There are several alternative Prelude implementations, but as far as I am aware none of them address all of these issues. Since most of the other libraries depend on the default Prelude, especially the type class hierarchy it establishes, the none breaking changes they could make are very limited. For a discussion of one of those proposals see http://www.yesodweb.com/blog/2012/08/classy-prelude-good-bad.... Things could be worse, take Scala for example.

There are lots of high quality libraries, but no major effort to replace the Prelude's privileged position in the language. So it it kind of a minefield to find the correct module/function for your needs.

Haskell Platform is a great standard set of imports, but it is only for the commonest libs, beyond that you have again the problem of sorting out excellent libs from some student's throwaway homework project with the same name.

arunix asked about "any alternative implementations", wouldn't you think that includes the alternative preludes like I posted?

Thanks for this comment. I always wondered if I was the only one who felt that way, or if I was just missing the point when I found these things weird.

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