relude-1.2.2.0: Safe, performant, user-friendly and lightweight Haskell Standard Library

# relude-1.2.2.0: Safe, performant, user-friendly and lightweight Haskell Standard Library

`relude` is an alternative prelude library. If you find the default `Prelude` unsatisfying, despite its advantages, consider using `relude` instead.

## Relude goals and design principles

- Productivity. You can be more productive with a "non-standard" standard library, and `relude` helps you with writing safer and more efficient code faster.

- Total programming. Usage of partial functions can lead to unexpected bugs and runtime exceptions in pure code. The types of partial functions lie about their behaviour. And even if it is not always possible to rely only on total functions, `relude` strives to encourage best-practices and reduce the chances of introducing a bug.

  Partial | Total
  --- | ---
  `head :: [a] -> a` | `head :: NonEmpty a -> a`
  `tail :: [a] -> [a]` | `tail :: NonEmpty a -> [a]`
  `read :: Read a => String -> a` | `readMaybe :: Read a => String -> Maybe a`
  `fromJust :: Maybe a -> a` | `fromMaybe :: a -> Maybe a -> a`

- Type-safety. We use the "make invalid states unrepresentable" motto as one of our guiding principles. If it is possible, we express this concept through the types.

  Example: `whenNotNull :: Applicative f => [a] -> (NonEmpty a -> f ()) -> f ()`

- Performance. We prefer `Text` over `String`, use space-leaks-free functions (e.g. our custom performant `sum` and `product`), introduce `{-# INLINE #-}` and `{-# SPECIALIZE #-}` pragmas where appropriate, and make efficient container types (e.g. `Map`, `HashMap`, `Set`) more accessible.
- Minimalism (low number of dependencies). We do not force users of `relude` to stick to any specific lens or text formatting or logging library. Where possible, `relude` depends only on boot libraries. The Dependency graph of `relude` can give you a clearer picture.

- Convenience. Despite minimalism, we want to bring commonly used types and functions into scope, and make available functions easier to use. Some examples of conveniences:

  1. No need to add `containers`, `unordered-containers`, `text` and `bytestring` to dependencies in your `.cabal` file to use the main API of these libraries
  2. No need to import types like `NonEmpty`, `Text`, `Set`, `Reader[T]`, `MVar`, `STM`
  3. Functions like `liftIO`, `fromMaybe`, `sortWith` are available by default as well
  4. `IO` actions are lifted to `MonadIO`

- Excellent documentation.

  1. Tutorial
  2. Migration guide from `Prelude`
  3. Haddock for every function with examples tested by doctest.
  4. Documentation regarding internal module structure
  5. `relude`-specific HLint rules: `.hlint.yaml`
- User-friendliness. Anyone should be able to quickly migrate to `relude`. Only some basic familiarity with the common libraries like `text` and `containers` should be enough (but not necessary).
- Exploration. We have space to experiment with new ideas and proposals without introducing breaking changes. `relude` uses the approach with `Extra.*` modules which are not exported by default. The chosen approach makes it quite easy for us to provide new functionality without breaking anything and let the users decide to use it or not.

Modules

relude-1.2.2.0

- Data
  Submodules
  - Data.ByteString
    Submodules
    - Data.ByteString.Builder
    - Data.ByteString.Lazy
    - Data.ByteString.Short
  - HashMap
    Submodules
    - Data.HashMap.Lazy
    - Data.HashMap.Strict
  - Data.HashSet
  - IntMap
    Submodules
    - Data.IntMap.Lazy
    - Data.IntMap.Strict
  - Data.IntSet
  - Map
    Submodules
    - Data.Map.Lazy
    - Data.Map.Strict
  - Data.Sequence
  - Data.Set
  - Data.Text
    Submodules
    - Data.Text.IO
    - Data.Text.Lazy
      Submodules
      - Data.Text.Lazy.IO
    - Data.Text.Read
  - Data.Tree
- Relude
  Submodules
  - Relude.Applicative
  - Relude.Base
  - Relude.Bool
    Submodules
    - Relude.Bool.Guard
    - Relude.Bool.Reexport
  - Relude.Container
    Submodules
    - Relude.Container.One
    - Relude.Container.Reexport
  - Relude.Debug
  - Relude.DeepSeq
  - Relude.Enum
  - Relude.Exception
  - Relude.Extra
    Submodules
    - Relude.Extra.Bifunctor
    - Relude.Extra.CallStack
    - Relude.Extra.Enum
    - Relude.Extra.Foldable
    - Relude.Extra.Foldable1
    - Relude.Extra.Group
    - Relude.Extra.Lens
    - Relude.Extra.Map
    - Relude.Extra.Newtype
    - Relude.Extra.Tuple
    - Relude.Extra.Type
  - Relude.File
  - Relude.Foldable
    Submodules
    - Relude.Foldable.Fold
    - Relude.Foldable.Reexport
  - Relude.Function
  - Relude.Functor
    Submodules
    - Relude.Functor.Fmap
    - Relude.Functor.Reexport
  - Relude.Lifted
    Submodules
    - Relude.Lifted.Concurrent
    - Relude.Lifted.Env
    - Relude.Lifted.Exit
    - Relude.Lifted.File
    - Relude.Lifted.Handle
    - Relude.Lifted.IORef
    - Relude.Lifted.Terminal
  - Relude.List
    Submodules
    - Relude.List.NonEmpty
    - Relude.List.Reexport
  - Relude.Monad
    Submodules
    - Relude.Monad.Either
    - Relude.Monad.Maybe
    - Relude.Monad.Reexport
    - Relude.Monad.Trans
  - Relude.Monoid
  - Relude.Nub
  - Relude.Numeric
  - Relude.Print
  - Relude.String
    Submodules
    - Relude.String.Conversion
    - Relude.String.Reexport
  - Relude.Unsafe