Hoogle Search

Within LTS Haskell 22.19 (ghc-9.6.4)

Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.

  1. package 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 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.TODO: table
    • 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.

  2. module Relude

    relude is a safe, performant, user-friendly and lightweight Haskell standard library. Relude is the main module that reexports all functionality provided by the library that will replace the default Prelude in your project.

    Usage

    To start using relude in your project, you can set the library up for you by one of the following ways.

    mixins

    One of the most convenient ways to use relude is via the mixins feature. This feature is available since Cabal >= 2.2. In order to use the mixins feature one needs to specify supported cabal-version in your package description. And then the following lines should be added to the required stanza to replace default Prelude with relude.
    cabal-version: 2.4
    ...
    library
    ...
    mixins: base hiding (Prelude)
    , relude (Relude as Prelude)
    , relude
    

    base-noprelude

    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 base Prelude:
    module Prelude
    ( module Relude
    ) where
    
    import Relude
    

    NoImplicitPrelude

    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
    

    Structure

    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.

  3. module Prelude

    The Prelude: a standard module. The Prelude is imported by default into all Haskell modules unless either there is an explicit import statement for it, or the NoImplicitPrelude extension is enabled.

  4. ImplicitPrelude :: Extension

    template-haskell Language.Haskell.TH

    No documentation available.

  5. ImplicitPrelude :: Extension

    template-haskell Language.Haskell.TH.LanguageExtensions

    No documentation available.

  6. module Amazonka.Prelude

    An intentionally limited set of prelude exports to control backward compatibility and simplify code generation. Please consider long and hard before adding any addtional types exports to this module - they should either be in pervasive use throughout the project or have zero ambiguity. If you ever are forced to disambiguate at any point, it's a bad export. Try and avoid any value, operator, or symbol exports, if possible. Most of the ones here exist to ease legacy code-migration.

  7. module Test.Amazonka.Prelude

    No documentation available.

  8. module Hedgehog.Internal.Prelude

    Mostly for compatibility across different base Prelude changes.

  9. pRELUDE :: Module

    ghc GHC.Builtin.Names

    No documentation available.

  10. pRELUDE_NAME :: ModuleName

    ghc GHC.Builtin.Names

    No documentation available.

Page 1 of many | Next