relude-0.5.0: Custom prelude from Kowainik
Goals
- Avoid all partial functions
(like
head :: [a] -> a). The types of partial functions lie about their behavior and usage of such functions can lead to the unexpected bugs. Though you can still use some unsafe functions fromRelude.Unsafemodule, but they are not exported by default. - Type-safety. We like to make invalid states unrepresantable. And if it's
possible to express this concept through the types then we will do it.
Example:
whenNotNull :: Applicative f => [a] -> (NonEmpty a -> f ()) -> f () - Performance. Prefer
TextoverString, use spaceleak-free functions (like our customsumandproduct). - Minimalism (low number of dependencies). We don't force users of
reludeto stick to some specific lens or text formatting or logging library. - Convenience (like lifted to
MonadIOfunctions, more reexports). But we want to bring common types and functions (likecontainersandbytestrng) into scope because they are used in almost every application anyways. - Provide excellent documentation.
- Tutorial
- Migration guide from
Prelude - Haddock with examples for (almost) every function (all examples are tested with `doctest`)
- Documentation regarding internal module structure)
relude-specific HLint rules:.hlint.yaml
- User-friendliness. Ability to quickly migrate to
reludeif you're familiar with the common libraries liketextandcontainers. - Exploration. Experiment with new ideas and proposals without introducing breaking changes.
Signatures
Modules