MyNixOS website logo
Description

Small alternative prelude.

Small Haskell alternative prelude. Based on Protolude and Intro

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

Metadata

Version

0.0.1.9

License

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows