A better Prelude. Haskell's Prelude needs to maintain backwards compatibility and has many aspects that no longer represents best practice. The goals of classy-prelude are:
- remove all partial functions
- modernize data structures
- generally use Text instead of String
- encourage the use of appropriate data structures such as Vectors or HashMaps instead of always using lists and associated lists
- reduce import lists and the need for qualified imports
It is worth noting that classy-prelude largely front-ran changes that the community made to the base Prelude in GHC 7.10.
Most of this functionality is provided by mono-traversable. Please read the README over there. classy-prelude gets rid of the
o prefix from mono-traversable functions.
Lots of things use
Text instead of
show returns a
To get back
- exceptions package
- system-filepath convenience functions
- whenM, unlessM
- hashNub and ordNub (efficient nub implementations).
- use the NoImplicitPrelude extension (you can place this in your cabal file) and
- use base-noprelude in your project and define a Prelude module that re-exports
These blog posts contain some out-dated information but might be helpful