verset: Small alternative prelude

[ library, mit, prelude ] [ Propose Tags ]

Small Haskell alternative prelude. Based on Protolude and Intro


[Skip to Readme]

Downloads

Note: This package has metadata revisions in the cabal description newer than included in the tarball. To unpack the package including the revisions, use 'cabal get'.

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.0.1.5, 0.0.1.6, 0.0.1.7, 0.0.1.8, 0.0.1.9
Dependencies base (>=4.9 && <5), bytestring (>=0.11.3 && <0.12), containers (>=0.6.6 && <0.7), extra (>=1.7.12 && <1.8), mtl (>=2.2.2 && <2.4), safe (>=0.3.19 && <0.4), text (>=2.0.1 && <2.1), time (>=1.12.2 && <1.13), uuid (>=1.3.15 && <1.4) [details]
License MIT
Copyright 2021 Andre Van Der Merwe
Author Andre Van Der Merwe
Maintainer andre@andrevdm.com
Revised Revision 1 made by andrevdm at 2023-05-17T10:51:11Z
Category Prelude
Home page https://github.com/andrevdm/verset#readme
Source repo head: git clone https://github.com/andrevdm/verset
Uploaded by andrevdm at 2023-01-08T15:03:20Z
Distributions LTSHaskell:0.0.1.9, NixOS:0.0.1.9, Stackage:0.0.1.9
Reverse Dependencies 1 direct, 1 indirect [details]
Downloads 304 total (24 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2023-01-08 [all 1 reports]

Readme for verset-0.0.1.8

[back to package description]

Verset

Haskell-CI

Small Haskell alternative prelude based on Protolude and Intro

Why

(At least it is not a monad tutorial)

There are some great alternative preludes around but I find most of them either too large or too opinionated. What I'd rather have is a minimal prelude and then layer additional changes over it. Obviously if the other preludes suit you better, then Verset is not for you :)

Goals

  • Very small
  • Minimal dependencies
  • Removes partial functions where possible
  • It be easy to switch from Verset to other preludes

Notes

  • catch, finally etc are not exported. This makes it easier to use e.g. Control.Exception.Safe, UnliftIO.Exception etc for safer exception without having to hide all the defaults
  • No transformers are exposed but lift is
  • Simple IsString helpers (from Protolude)
  • identity rather than id (from Protolude)
  • String is not exported use [Char]. This is to discourage its use.

If you want to reduce imports

If you want to use Verset but would rather avoid imports in all your modules. There are at least two optios

  1. Create a module with the imports you always use and import that along with Verset
{-# LANGUAGE NoImplicitPrelude #-}

module Verse
    ( (Control.Lens.^.)
    , (Control.Lens.^..)
    ) where

import           Verset
import qualified Control.Lens
module Demo where
  import           Verset
  import           Verse
  import qualified Whatever as W
  1. Similar to the method above but reexport verset
{-# LANGUAGE NoImplicitPrelude #-}

module Verse
    ( module Verset
    , (Control.Lens.^.)
    , (Control.Lens.^..)
    ) where

import           Verset
import qualified Control.Lens
module Demo where
  import           Verse
  import qualified Whatever as W

But...

Personally I happy with imports as I think it makes the code more explicit. However if you want to avoid them using something like the above methods I think there are still benefits to Verset.

  • Verset is not getting in your way.
  • You can define company wide defaults, project wide defaults or both

Compatibility

Tested with GHC 8.7.10, 9.0.1 and 9.2.1