| Copyright | (c) 2016 Stephen Diehl (c) 2016-2018 Serokell (c) 2018-2019 Kowainik |
|---|---|
| License | MIT |
| Maintainer | Kowainik <xrom.xkov@gmail.com> |
| Safe Haskell | Trustworthy |
| Language | Haskell2010 |
Relude
Description
The main module that reexports all functionality. It's allowed to use it without
importing any other modules. 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
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
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.
Below is a short description of what you can find under different modules, imported by default from Relude:
- Relude.Applicative: reexports from Control.Applicative and some general-purpose applicative combinators.
- Relude.Base: different general types and type classes from
basepackage (Int,Num,Generic, etc.) not exported by other modules. - Relude.Bool:
Booldata type with different predicates and combinators. - Relude.Container:
Onetypeclass for creating data structures from singleton lement and reexports of types from packagescontainersandunordered-containers. - Relude.Debug:
trace-like debugging functions with compile-time warnings (so you don't forget to remove them). - Relude.DeepSeq: reexports from Control.DeepSeq module and functions to evaluate expressions to weak-head normal form or normal form.
- Relude.Exception: reexports Control.Exception, introduces
bugfunction as bettererrorandExcpattern synonym for convenient pattern-matching on exceptions. - Relude.File: functions to work with file content as
TextorByteString. - Relude.Foldable: reexports functions for
FoldableandTraversable. - Relude.Function: almost everything from Data.Function module.
- Relude.Functor: reexports from Data.Functor, Data.Bifunctor,
other useful
Functorcombinators. - Relude.Lifted: lifted to
MonadIOfunctions to work with console, files,IORefs,MVars, etc. - Relude.List: big chunk of Data.List,
NonEmptytype and functions for this type (head,tail,last,init). - Relude.Monad: reexports from Data.Maybe and Data.Either modules, monad transormers, various combinators.
- Relude.Monoid: reexports from Data.Monoid and Data.Semigroup.
- Relude.Nub: better versions of
nubfunction for list. - Relude.Numeric: functions and types to work with numerical data.
- Relude.Print: printing to terminal functions for
TextandByteString. - Relude.String: reexports from
textandbytestringpackages with conversion functions between different textual types.
And these modules are not exported by default, but you can easily bring them to every module in your package by modifying your Prelude file:
- Relude.Extra.Bifunctor: additional combinators for
Bifunctor. - Relude.Extra.CallStack: useful functions to extract information from
CallStack. - Relude.Extra.Enum: extra utilities for types that implement
BoundedandEnumconstraints. - Relude.Extra.Foldable1:
Foldable1typeclass likeFoldablebut for non-empty structures. - Relude.Extra.Group: grouping functions, polymorphic on return
Maptype. - Relude.Extra.Lens: minimal implementation of
lenspackage required for basic usage. - Relude.Extra.Map: typeclass for
Map-like data structures. - Relude.Extra.Newtype: generic functions that automatically work for any
newtype. - Relude.Extra.Tuple: functions for working with tuples.
- Relude.Extra.Type: functions for inspecting and working with types.
- Relude.Extra.Validation:
Validationdata type. - Relude.Unsafe: unsafe partial functions (produce
error) for lists andMaybe.
Synopsis
- module Relude.Applicative
- module Relude.Base
- module Relude.Bool
- module Relude.Container
- module Relude.Debug
- module Relude.DeepSeq
- module Relude.Exception
- module Relude.File
- module Relude.Foldable
- module Relude.Function
- module Relude.Functor
- module Relude.Lifted
- module Relude.List
- module Relude.Monad
- module Relude.Monoid
- module Relude.Nub
- module Relude.Numeric
- module Relude.Print
- module Relude.String
Reexports from base and from modules in this repo
module Relude.Applicative
module Relude.Base
module Relude.Bool
module Relude.Container
module Relude.Debug
module Relude.DeepSeq
module Relude.Exception
module Relude.File
module Relude.Foldable
module Relude.Function
module Relude.Functor
module Relude.Lifted
module Relude.List
module Relude.Monad
module Relude.Monoid
module Relude.Nub
module Relude.Numeric
module Relude.Print
module Relude.String