3 ms·
The Haskell Prelude is famously awful, so OCaml stdlib isn't much of a needle-mover.
by judk 12y ago
The Haskell Prelude is famously awful, so OCaml stdlib isn't much of a needle-mover.
- codygman 12y agoI wouldn't say it's awful, however there are definitely improvements that need to be made.
- orbifold 12y agoThe 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.
- frowaway001 12y agoThanks 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.
- arunix 12y agoAre there any alternative implementations that address these issues?
- judk 12y agoThere 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.
- codygman 12y agoarunix asked about "any alternative implementations", wouldn't you think that includes the alternative preludes like I posted?
- codygman 12y agoYes, see the list of alternative preludes: http://hackage.haskell.org/packages/search?terms=prelude http://hackage.haskell.org/packages/search?terms=prelude See the classy prelude github page: https://github.com/snoyberg/classy-prelude https://github.com/snoyberg/classy-prelude And the latest blog post about classy-prelude: http://www.yesodweb.com/blog/2013/01/so-many-preludes 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 http://hackage.haskell.org/package/ihaskell
- orbifold 12y agoThere 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-ugly http://www.yesodweb.com/blog/2012/08/classy-prelude-good-bad.... Things could be worse, take Scala for example.