relude
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/](https://www.reddit.com/r/haskell/comments/5n51u3/why_are_partial_functions_as_in_head_tail_bad/)
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](https://www.reddit.com/r/haskell/comments/29jw0s/whats_wrong_with_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](https://raw.githubusercontent.com/kowainik/relude/main/relude-dependency-graph.png)
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](http://hackage.haskell.org/package/doctest).
4. Documentation regarding [internal module structure](http://hackage.haskell.org/package/relude/docs/Relude.html)
5. @relude@-specific [HLint](http://hackage.haskell.org/package/hlint) rules: @[.hlint.yaml](https://github.com/kowainik/relude/blob/main/.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.
| version | uploaded | uploader | changes | |
|---|---|---|---|---|
| 1.2.2.2 files | 2025-08-05 12:09 UTC | tomjaguarpaw | 3 revisions | +6/−2 lines, 3 filesdep ~basedep ~doctestdep ~hedgehogPVP: minor bump suggested |
| 1.2.2.1 files | 2025-07-29 10:01 UTC | tomjaguarpaw | +78/−75 lines, 16 filesnew-uploaderPVP: major bump suggested | |
| 1.2.2.0 files | 2024-10-13 17:29 UTC | vrom911 | 4 revisions | +19/−8 lines, 3 filesdep ~basedep ~containersdep ~doctestPVP: major bump suggested |
| 1.2.1.0 files | 2023-10-04 10:32 UTC | vrom911 | 3 revisions | +474/−392 lines, 10 filesdep ~basedep ~containersdep ~deepseqPVP: major bump suggested |
| 1.2.0.0 files | 2023-03-01 16:34 UTC | vrom911 | 1 revisions | +149/−108 lines, 60 filesdep ~basedep ~bytestringdep ~deepseqPVP ok |
| 1.1.0.0 files | 2022-06-09 15:48 UTC | vrom911 | +558/−415 lines, 62 filesdep +tasty-benchdep −criteriondep ~basedep ~containersdep ~doctestPVP ok | |
| 1.0.0.1 files | 2021-03-15 10:24 UTC | vrom911 | +66/−3 lines, 5 filesPVP ok | |
| 1.0.0.0 files | 2021-03-12 17:40 UTC | shersh | +1054/−965 lines, 64 filesdep +criteriondep −gaugedep ~basedep ~bytestringdep ~ghc-primPVP ok | |
| 0.7.0.0 files | 2020-05-14 17:13 UTC | vrom911 | +3073/−1409 lines, 66 filesdep −QuickCheckdep ~basedep ~ghc-primnew-uploaderPVP ok | |
| 0.6.0.0 files | 2019-10-30 20:03 UTC | shersh | +2931/−669 lines, 63 filesdep −tastydep −tasty-hedgehogdep ~basedep ~hashabledep ~hedgehogPVP ok | |
| 0.5.0 files | 2019-03-18 02:03 UTC | shersh | 1 revisions | +940/−255 lines, 60 filesdep +QuickCheckPVP ok |
| 0.4.0 files | 2018-11-06 15:57 UTC | shersh | +456/−77 lines, 15 filesdep −utf8-stringPVP ok | |
| 0.3.0 files | 2018-09-09 12:18 UTC | shersh | 1 revisions | +735/−224 lines, 24 filesdep ~basedep ~bytestringdep ~containersPVP ok |
| 0.2.0 files | 2018-08-19 06:25 UTC | shersh | 2 revisions | +791/−464 lines, 51 filesdep −semigroupsdep ~basedep ~hedgehogPVP ok |
| 0.1.1 files | 2018-08-07 10:47 UTC | shersh | 2 revisions | +31/−3 lines, 4 filessetup-changedPVP ok |
| 0.1.0 files | 2018-07-21 10:14 UTC | shersh | 2 revisions | +3664/−0 lines, 53 filesdep +Globdep +basedep +bytestringsetup-changed |
Dependencies of relude-1.2.2.2
Glob >=0 0.10.1 → 0.10.2
| 2021-11-10 11:14 UTC | 0.10.2 | +2835/−2818 lines, 23 filesdep ~HUnitdep ~QuickCheckdep ~Win32setup-changednew-uploaderPVP ok |
| 2020-07-19 11:55 UTC | 0.10.1 | +49/−16 lines, 6 filesdep ~dlistdep ~transformers-compatPVP ok |
| 2018-12-19 18:53 UTC | 0.10.0 | +25/−9 lines, 5 filesdep ~semigroupsPVP ok |
| 2018-09-22 10:08 UTC | 0.9.3 | +10/−4 lines, 3 filesdep ~containersPVP ok |
| 2018-02-26 17:05 UTC | 0.9.2 | +7/−4 lines, 3 filesdep ~transformers-compatPVP ok |
showing 5 of 33 versions
base >=4.11 && <4.23 4.22.0.0 → 4.22.1.0
| 2026-12-01 12:38 UTC | 4.22.1.0 HSEC-2023-0007 | +388/−6 lines, 9 filesdep ~ghc-internalPVP: major bump suggested |
| 2025-12-19 11:52 UTC | 4.22.0.0 HSEC-2023-0007 | +886/−215 lines, 28 filesdep ~ghc-internalPVP ok |
| 2026-03-27 12:26 UTC | 4.21.2.0 HSEC-2023-0007 | +10/−3 lines, 4 filesdep ~ghc-internalPVP ok |
| 2025-12-27 10:31 UTC | 4.21.1.0 HSEC-2023-0007 | +17/−5 lines, 4 filesdep ~ghc-internalPVP ok |
| 2024-12-16 09:24 UTC | 4.21.0.0 HSEC-2023-0007 | +1170/−396 lines, 39 filesdep ~ghc-internalPVP ok |
showing 5 of 61 versions
bytestring >=0.10 && <0.13 0.12.1.0 → 0.12.2.0
| 2024-12-06 21:41 UTC | 0.12.2.0 | +538/−437 lines, 44 filesdep ~QuickCheckdep ~basePVP ok |
| 2024-02-16 03:27 UTC | 0.12.1.0 | +3398/−1642 lines, 37 filesdep +sybdep ~basePVP: major bump suggested |
| 2023-08-16 01:53 UTC | 0.12.0.2 | +16/−2 lines, 3 files |
| 2023-08-05 00:03 UTC | 0.12.0.1 | +47/−9 lines, 3 files |
| 2023-07-07 01:45 UTC | 0.12.0.0 | +1459/−520 lines, 21 filesdep +data-array-bytePVP ok |
showing 5 of 49 versions
containers >=0.5.10 && <0.9 0.8 → 0.8.1
| 2026-10-04 06:08 UTC | 0.8.1 | +8085/−5169 lines, 39 filesdep +template-haskell-liftdep ~arraydep ~deepseqPVP: major bump suggested |
| 2025-03-01 13:03 UTC | 0.8 | +8447/−7031 lines, 37 filesnew-uploaderPVP ok |
| 2023-09-27 12:15 UTC | 0.7 | +76/−33 lines, 3 filesPVP ok |
| 2023-09-28 04:21 UTC | 0.6.8 | +644/−184 lines, 17 filesdep ~basedep ~deepseqPVP: major bump suggested |
| 2023-02-01 03:11 UTC | 0.6.7 | +783/−229 lines, 20 filesPVP: major bump suggested |
showing 5 of 43 versions
deepseq >=1.4 && <1.6 1.5.2.0 → 1.6.0.0 newer than bounds
| 2024-09-08 16:18 UTC | 1.6.0.0 deprecated newer than bounds | +5/−14 lines, 3 filesdep ~basePVP ok |
| 2025-06-14 22:25 UTC | 1.5.2.0 | +13/−4 lines, 3 filesPVP: major bump suggested |
| 2024-09-09 12:48 UTC | 1.5.1.0 | +69/−14 lines, 3 filesdep −arraydep ~basePVP: major bump suggested |
| 2023-07-27 19:32 UTC | 1.5.0.0 | +619/−532 lines, 5 filesdep ~basePVP ok |
| 2022-12-18 00:14 UTC | 1.4.8.1 | +34/−9 lines, 3 filesdep ~basePVP: major bump suggested |
showing 5 of 26 versions
doctest >=0.20 && <0.26 0.25.0.1 → 0.25.0.2
| 2026-09-24 10:26 UTC | 0.25.0.2 | +7/−2 lines, 3 filesPVP ok |
| 2026-09-24 08:42 UTC | 0.25.0.1 deprecated | +36/−4 lines, 6 filesPVP ok |
| 2026-05-03 17:07 UTC | 0.25.0 | +55/−31 lines, 7 filesPVP ok |
| 2026-01-02 08:10 UTC | 0.24.3 | +25/−11 lines, 5 filesdep ~ghcPVP ok |
| 2025-06-24 14:52 UTC | 0.24.2 | +17/−77 lines, 10 filesdep ~basedep ~ghcPVP ok |
showing 5 of 79 versions
ghc-prim >=0.5.0.0 && <0.14 0.12.0 → 0.13.0
| 2024-12-16 09:29 UTC | 0.13.0 | +95/−12 lines, 6 filesPVP ok |
| 2025-05-03 11:48 UTC | 0.12.0 | +5108/−1582 lines, 15 filesnew-uploaderPVP ok |
| 2023-10-10 00:24 UTC | 0.11.0 | +770/−234 lines, 9 filesPVP ok |
| 2023-03-28 14:22 UTC | 0.10.0 | +487/−297 lines, 16 filesPVP ok |
| 2022-08-07 20:08 UTC | 0.9.0 | +2921/−2018 lines, 14 filesPVP ok |
showing 5 of 15 versions
hashable >=1.2 && <1.6 1.5.0.0 → 1.5.1.0
| 2026-01-02 17:45 UTC | 1.5.1.0 | +7260/−6790 lines, 5 filesdep −HUnitdep −ghc-bignumdep −randomdep ~basedep ~containersPVP: major bump suggested |
| 2024-07-04 19:38 UTC | 1.5.0.0 | +50/−156 lines, 4 filesdep −base-orphansdep −ghc-bignum-orphansdep −integer-gmpdep ~QuickCheckdep ~basedep ~bytestringPVP ok |
| 2024-06-24 10:44 UTC | 1.4.7.0 | +8/−3 lines, 2 filesPVP ok |
| 2024-06-09 19:43 UTC | 1.4.6.0 | +60/−83 lines, 7 filesdep −test-frameworkdep −test-framework-hunitdep −test-framework-quickcheck2PVP ok |
| 2024-06-08 14:07 UTC | 1.4.5.0 | +7338/−256 lines, 15 filesdep +primitivedep +tastydep +tasty-hunitdep ~basedep ~bytestringdep ~containersPVP ok |
showing 5 of 52 versions
hedgehog >=1.0 && <1.6 || >=1.7 && <1.8 1.6 → 1.7
| 2025-09-22 20:47 UTC | 1.7 | +50/−26 lines, 5 filesdep ~lifted-asyncdep ~template-haskelldep ~timePVP ok |
| 2025-09-08 12:45 UTC | 1.6 outside bounds | +87/−63 lines, 4 filesPVP ok |
| 2024-07-24 13:51 UTC | 1.5 | +255/−78 lines, 5 filesdep ~containersdep ~randomdep ~template-haskellPVP ok |
| 2023-08-06 21:48 UTC | 1.4 | +138/−64 lines, 7 filesdep ~ansi-terminaldep ~barbiesdep ~bytestringPVP ok |
| 2023-06-22 11:22 UTC | 1.3 | +152/−29 lines, 11 filesdep +safe-exceptionsdep ~ansi-terminalPVP ok |
showing 5 of 28 versions
mtl >=2.2 && <2.4 2.3.1 → 2.3.2
| 2025-12-08 04:58 UTC | 2.3.2 | +112/−21 lines, 12 filesdep ~basenew-uploaderPVP: major bump suggested |
| 2022-10-31 21:28 UTC | 2.3.1 | +188/−33 lines, 8 filesdep ~basePVP: major bump suggested |
| 2022-05-07 20:34 UTC | 2.3 deprecated | +1284/−520 lines, 29 filesdep ~basedep ~transformersnew-uploaderPVP ok |
| 2018-02-24 22:15 UTC | 2.2.2 | +152/−36 lines, 14 filesdep ~basePVP: major bump suggested |
| 2014-06-02 02:22 UTC | 2.2.1 | +179/−4 lines, 8 filesdep ~basedep ~transformersPVP: major bump suggested |
showing 5 of 20 versions
stm >=2.4 && <2.6 2.5.3.0 → 2.5.3.1
| 2024-04-12 15:34 UTC | 2.5.3.1 | +7/−3 lines, 3 filesdep ~basePVP: major bump suggested |
| 2023-11-17 23:47 UTC | 2.5.3.0 | +222/−123 lines, 6 filesPVP: major bump suggested |
| 2023-10-06 15:16 UTC | 2.5.2.1 deprecated | +11/−5 lines, 3 filesPVP ok |
| 2023-10-05 21:19 UTC | 2.5.2.0 deprecated | +258/−270 lines, 9 filesdep ~basePVP: major bump suggested |
| 2022-08-04 22:51 UTC | 2.5.1.0 | +42/−5 lines, 5 filesdep +semigroupsdep ~basePVP ok |
showing 5 of 24 versions
tasty-bench >=0 0.5 → 0.5.1
| 2026-06-09 23:23 UTC | 0.5.1 | +111/−42 lines, 3 filesdep +transformersdep ~tastyPVP ok |
| 2025-12-26 19:44 UTC | 0.5 | +265/−144 lines, 4 filesdep ~basedep ~timePVP ok |
| 2024-12-29 22:30 UTC | 0.4.1 | +48/−75 lines, 4 filesdep −taggeddep ~containersPVP ok |
| 2024-07-06 11:31 UTC | 0.4 | +225/−103 lines, 5 filesdep +timedep ~containersdep ~tastyPVP ok |
| 2023-09-10 00:31 UTC | 0.3.5 | +265/−164 lines, 4 filesdep ~containersdep ~deepseqdep ~ghc-primPVP ok |
showing 5 of 17 versions
text >=1.2 && <2.2 2.1.4 → 2.1.5
| 2026-11-27 23:30 UTC | 2.1.5 | +33786/−32979 lines, 58 filesPVP: major bump suggested |
| 2026-01-28 08:30 UTC | 2.1.4 | +30991/−20199 lines, 35 filesdep +template-haskell-liftdep ~QuickCheckdep ~template-haskellPVP ok |
| 2025-08-01 20:08 UTC | 2.1.3 | +2107/−1827 lines, 30 filesdep +splitmixdep +temporarydep ~QuickCheckdep ~ghc-primdep ~template-haskellPVP ok |
| 2024-10-26 13:22 UTC | 2.1.2 | +43588/−15378 lines, 41 filesdep ~basedep ~binaryPVP: major bump suggested |
| 2024-02-16 22:16 UTC | 2.1.1 | +986/−412 lines, 26 filesdep ~QuickCheckdep ~ghc-primdep ~template-haskellPVP: major bump suggested |
showing 5 of 83 versions
transformers >=0.5 && <0.7 0.6.2.0 → 0.6.3.0
| 2026-01-12 12:42 UTC | 0.6.3.0 | +28/−1 lines, 4 filesPVP: major bump suggested |
| 2025-04-06 22:39 UTC | 0.6.2.0 | +41/−42 lines, 8 filesdep ~ghc-primPVP: major bump suggested |
| 2024-09-25 11:37 UTC | 0.6.1.2 | +70/−21 lines, 19 filesPVP: minor bump suggested |
| 2023-08-01 19:13 UTC | 0.6.1.1 | +281/−42 lines, 11 filesPVP ok |
| 2023-02-04 08:15 UTC | 0.6.1.0 | +64/−4 lines, 8 filesPVP ok |
showing 5 of 42 versions
unordered-containers >=0.2.7 && <0.3 0.2.21 → 0.2.21.1
| 2026-11-30 10:13 UTC | 0.2.21.1 | +533/−177 lines, 9 filesPVP: major bump suggested |
| 2025-12-13 23:09 UTC | 0.2.21 deprecated HSEC-2026-0018 | +3999/−2731 lines, 20 filesdep −mtldep ~basedep ~bytestringdep ~deepseqPVP: major bump suggested |
| 2025-10-02 07:28 UTC | 0.2.20.1 deprecated HSEC-2026-0018 | +106/−52 lines, 12 filesPVP: major bump suggested |
| 2024-01-09 06:48 UTC | 0.2.20 deprecated HSEC-2026-0018 | +1023/−941 lines, 12 filesdep ~hashabledep ~template-haskellPVP: major bump suggested |
| 2022-04-24 15:48 UTC | 0.2.19.1 deprecated HSEC-2026-0018 | +88/−14 lines, 4 filesdep ~basedep ~template-haskellPVP: major bump suggested |
showing 5 of 44 versions
Reverse dependencies
111 packages depend on relude; 17 have bounds that exclude 1.2.2.2
showing 100 of 111, bound-excluded first