@hackage base-orphans0.5.2

Backwards-compatible orphan instances for base


Hackage Hackage Dependencies Haskell Programming Language BSD3 License Build


base-orphans defines orphan instances that mimic instances available in later versions of base to a wider (older) range of compilers. base-orphans does not export anything except the orphan instances themselves and complements base-compat.

Note that base-orphans doesn't cover every possible instance. See the What is not covered section for exceptions.


To use base-orphans, simply import Data.Orphans ().

What is covered

  • Applicative and Alternative instances for ReadP and ReadPrec
  • Applicative instance for strict and lazy ST
  • Applicative, Foldable, Functor, Monad, and Traversable instances for Complex, Dual, First, Last, Product, and Sum
  • Bits instance for Bool
  • Bits, Bounded, and Integral instances for CDev
  • Bounded, Enum, Ix, and Storable instances for Const and Identity
  • Data instances for All and Any
  • Data, MonadFix and MonadZip instances for Alt, Dual, First, Last, Product, and Sum
  • Data and IsList instances for Version
  • Eq and Ord instances for Control.Exception.ErrorCall
  • Eq, Ord, Read, and Show instances for data types in GHC.Generics
  • Eq, Ord, Read, Show, Foldable, and Traversable instances for ZipList
  • Foldable instance for Either, (,) and Const
  • Functor instance for Handler, ArgOrder, OptDescr, and ArgDescr
  • Functor, Applicative, Alternative, and MonadPlus instances for ArrowMonad
  • Monad instance for (,)
  • Monad instance for WrappedMonad
  • MonadZip instance for Maybe
  • Monoid, Eq, Ord, Read, and Show instances for Const
  • Monoid instances for Identity and IO
  • Num instance for Sum and Product
  • Read instance for Fixed
  • Read and Show instances for Down
  • Show instance for Fingerprint
  • Storable instance for (), Complex, and Ratio
  • Traversable instance for Either, (,) and Const
  • Typeable instance for most data types, typeclasses, and promoted data constructors (when possible)

What is not covered

base-orphans does not define the following instances:

Supported versions of GHC/base

  • ghc-8.0.1 / base-
  • ghc-7.10.3 / base-
  • ghc-7.10.2 / base-
  • ghc-7.10.1 / base-
  • ghc-7.8.4 / base-
  • ghc-7.8.3 / base-
  • ghc-7.8.2 / base-
  • ghc-7.8.1 / base-
  • ghc-7.6.3 / base-
  • ghc-7.6.2 / base-
  • ghc-7.6.1 / base-
  • ghc-7.4.2 / base-
  • ghc-7.4.1 / base-
  • ghc-7.2.2 / base-
  • ghc-7.2.1 / base-
  • ghc-7.0.4 / base-
  • ghc-7.0.3 / base-
  • ghc-7.0.2 / base-
  • ghc-7.0.1 / base-

We also make an attempt to keep base-orphans building with GHC HEAD, but due to its volatility, it may not work at any given point in time. If it doesn't, please report it!

Patches are welcome; add tests for new code!