relude-0.6.0.0: Custom prelude from Kowainik
Copyright(c) 2016 Stephen Diehl
(c) 2016-2018 Serokell
(c) 2018-2019 Kowainik
LicenseMIT
MaintainerKowainik <xrom.xkov@gmail.com>
Safe HaskellTrustworthy
LanguageHaskell2010

Relude

Description

The main module that reexports all functionality. It's considered to be a Prelude replacement.

One of the most convenient ways to use relude is via mixins feature. To use this feature need to specify cabal-version: 2.4 in your package description. And then you can add the following lines to the required stanza to replace default Prelude with relude.

mixins: base hiding (Prelude)
      , relude (Relude as Prelude)

Alternatively, you can replace base package in your dependencies with base-noprelude and add the following Prelude module to your package to use relude by default in every module instead of Prelude:

module Prelude (module Relude) where
import Relude

If you want to use relude per-module basis then just add next lines to your module to replace default Prelude:

{-# LANGUAGE NoImplicitPrelude #-}

import Relude

This documentation section contains the description of internal module structure to help navigate between modules, search for interesting functionalities and understand where you need to put your new changes (if you're a contributor).

Functions and types are distributed across multiple modules and grouped by meaning or category. Name of the module should give you hints regarding what this module contains. Some categories contain a significant amount of both reexported functions and functions of our own. To make it easier to understand these enormous chunks of functions, all reexported stuff is moved into the separate module with name Relude.SomeCategory.Reexport and our own functions and types are in Relude.SomeCategory.SomeName. For example, see modules Relude.Foldable.Fold and Relude.Foldable.Reexport.

The following modules are not exported by default, but you can easily bring them to every module in your package by modifying your Prelude file:

Synopsis

Modules available by default

Relude.Applicative contains reexports from Control.Applicative and some general-purpose applicative combinators.

Relude.Base contains different general types and type classes from base package (Char, Eq, Generic, etc.) not exported by other modules.

Relude.Bool contains Bool data type with different predicates and combinators.

Relude.Container provides One typeclass for creating data structures from singleton lement and reexports of types from packages containers and unordered-containers.

Relude.Debug contains trace-like debugging functions with compile-time warnings (so you don't forget to remove them).

Relude.DeepSeq has reexports from Control.DeepSeq module and functions to evaluate expressions to weak-head normal form or normal form.

Relude.Exception contains reexports from Control.Exception, introduces bug function as better error and Exc pattern synonym for convenient pattern-matching on exceptions.

Relude.File implements functions to work with file content as Text or ByteString.

Relude.Foldable reexports functions for Foldable and Traversable and provide own better alternatives to some existing functions.

Relude.Function contains almost everything from the Data.Function module.

Relude.Functor contains reexports from Data.Functor, Data.Bifunctor, other useful Functor combinators.

Relude.Lifted implements lifted to MonadIO functions to work with console, files, IORefs, MVars, etc.

Relude.List provides big chunk of Data.List, NonEmpty type and functions for this type (head, tail, last, init).

Relude.Monad contains functions and data types from Data.Maybe and Data.Either modules, monad transormers and other various combinators.

Relude.Monoid reexports various types and functions from Data.Monoid and Data.Semigroup.

module Relude.Nub

Relude.Nub implements better versions of nub function for list.

Relude.Numeric contains functions and types to work with numerical data.

Relude.Print contains printing to terminal functions for Text and ByteString.

Relude.String contains reexports from text and bytestring packages with conversion functions between different textual types.