MyNixOS website logo
Description

Provide Prelude and Data.List with fixed content across GHC versions.

This package allows you to write warning-free code that compiles with versions of base before and after AMP and FTP, that is, base before and beginning with 4.8, respectively, and GHC before and beginning with 7.10, respectively. It serves three purposes:

  • Prevent you from name clashes of FTP-Prelude with locally defined functions having names like <*>, join, foldMap.

  • Prevent you from redundant import warnings if you manually import Data.Monoid or Control.Applicative.

  • Fix list functions to the list type, contrarily to the aim of the FTP. This way you are saved from length (2,1) == 1 and maximum (2,1) == 1, until you import Data.Foldable.

You should add

import Prelude2010
import Prelude ()

to your modules. This way, you must change all affected modules. If you want to avoid this you may try the prelude2010 package or if you already import Prelude explicitly, you may try to add

Default-Extensions: CPP, NoImplicitPrelude
CPP-Options: -DPrelude=Prelude2010

to your Cabal file.

In my opinion, this is the wrong way round. The presented Prelude2010 module should have been the one for GHC-7.10 and the Prelude with added and generalized list functions should have been an additional PreludeFTP, preferably exported by a separate package like all other alternate Prelude projects. But the purpose of the FTP was to save some import statements at the expense of blowing up the Foldable class and prevent simple ways to write code that works with GHC version before and starting with GHC-7.10 and that does not provoke warnings.

Related packages:

  • 'base-compat': The opposite approach - Make future function definitions available in older GHC versions.

  • haskell2010: Defines the Prelude for Haskell 2010. Unfortunately, haskell2010 is not available anymore since GHC-7.10, because of the AMP.

  • 'numeric-prelude': It is intended to provide a refined numeric class hierarchy but it also provides a non-numeric subset of the Prelude that is more stable than the one of base.

Metadata

Version

0.0.0.2

Maintainers (1)

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