| 1 |
# `base-orphans` |
| 2 |
[][Hackage: base-orphans] |
| 3 |
[](http://packdeps.haskellers.com/reverse/base-orphans) |
| 4 |
[][Haskell.org] |
| 5 |
[][tl;dr Legal: MIT] |
| 6 |
[](https://github.com/haskell-compat/base-orphans/actions?query=workflow%3AHaskell-CI) |
| 7 |
|
| 8 |
[Hackage: base-orphans]: |
| 9 |
http://hackage.haskell.org/package/base-orphans |
| 10 |
"base-orphans package on Hackage" |
| 11 |
[Haskell.org]: |
| 12 |
http://www.haskell.org |
| 13 |
"The Haskell Programming Language" |
| 14 |
[tl;dr Legal: MIT]: |
| 15 |
https://tldrlegal.com/license/mit-license |
| 16 |
"MIT License" |
| 17 |
|
| 18 |
## Scope |
| 19 |
|
| 20 |
`base-orphans` defines orphan instances that mimic instances available in later |
| 21 |
versions of `base` to a wider (older) range of compilers. `base-orphans` does |
| 22 |
not export anything except the orphan instances themselves and complements |
| 23 |
[base-compat](http://hackage.haskell.org/package/base-compat). |
| 24 |
|
| 25 |
Note that `base-orphans` doesn't cover every possible instance. See the |
| 26 |
[What is not covered](#what-is-not-covered) section for exceptions. |
| 27 |
|
| 28 |
## Usage |
| 29 |
|
| 30 |
To use `base-orphans`, simply `import Data.Orphans ()`. |
| 31 |
|
| 32 |
## What is covered |
| 33 |
|
| 34 |
* `Alternative`, `MonadPlus`, and `MonadZip` instances for `Proxy` |
| 35 |
* `Alternative`, `Applicative`, `Bounded`, `Data`, `Enum`, `Foldable`, `Functor`, `Ix`, `Monad`, `MonadFix`, `MonadPlus`, `MonadZip`, and `Traversable` instances for data types in `GHC.Generics` |
| 36 |
* `Alternative`, `Eq`, `Ord`, `Read`, `Show`, `Foldable`, and `Traversable` instances for `ZipList` |
| 37 |
* `Applicative` instance for `K1` from `GHC.Generics` |
| 38 |
* `Applicative`, `Bits`, `Bounded`, `Data`, `Enum`, `Eq1`, `FiniteBits`, |
| 39 |
`Floating`, `Foldable`, `Fractional`, `Functor`, `Ix`, `Ord1`, |
| 40 |
`Monad`, `MonadFix`, `MonadZip`, `Monoid`, `Num`, `Read`, `Read1`, `Real`, |
| 41 |
`RealFloat`, `RealFrac`, `Semigroup`, `Show`, `Show1`, `Storable`, and |
| 42 |
`Traversable` instances for `Down` |
| 43 |
* `Applicative` and `Alternative` instances for `ReadP` and `ReadPrec` |
| 44 |
* `Applicative` instance for strict and lazy `ST` |
| 45 |
* `Applicative`, `Foldable`, `Functor`, `Monad`, and `Traversable` instances for `Complex`, |
| 46 |
`Dual`, `First`, `Last`, `Product`, and `Sum` |
| 47 |
* `Bits` instance for `Bool` |
| 48 |
* `Bits`, `Bounded`, and `Integral` instances for `CDev` |
| 49 |
* `Bits`, `Bounded`, `Enum`, `FiniteBits`, `Floating`, `Fractional`, `Integral`, `IsString`, `Ix`, `Num`, `Real`, `RealFloat`, `RealFrac`, and `Storable` instances for `Const` and `Identity` |
| 50 |
* `Data` instances for `All`, `Any`, and `Const`, `IntPtr`, `WordPtr`, |
| 51 |
`WrappedArrow` and `WrappedMonad` |
| 52 |
* `Data`, `MonadFix` and `MonadZip` instances for `Alt`, `Dual`, `First`, `Last`, |
| 53 |
`Product`, and `Sum` |
| 54 |
* `Data` and `IsList` instances for `Version` and `ZipList` |
| 55 |
* `Eq{1,2}`, `Ord{1,2}`, `Show{1,2}`, and `Read{1,2}` instances for `(,,)` and `(,,,)` |
| 56 |
* `Eq` and `Ord` instances for `Control.Exception.ErrorCall` |
| 57 |
* `Eq`, `Ord`, `Read`, and `Show` instances for data types in `GHC.Generics` |
| 58 |
* `Eq`, `Ord`, `Bounded`, `Enum`, and `Ix` instances for `Solo` |
| 59 |
* `Eq` and `Ord` instances for `Generically1` |
| 60 |
* `Eq` and `Ord` instances for `SChar`, `SNat`, and `SSymbol` |
| 61 |
* `Eq1`, `Read1`, and `Show1` instances for `Complex` |
| 62 |
* `Eq1`, `Ord1`, `Read1`, and `Show1` instances for `NonEmpty` |
| 63 |
* `Eq1`, `Ord1`, `Read1`, and `Show1` instances for basic `GHC.Generics` representation types |
| 64 |
* `Enum`, `Bounded`, `Num`, `Real`, `Integral`, `Fractional`, `RealFrac`, `Floating`, and `RealFloat` instances for `Compose` |
| 65 |
* `Foldable` instance for `Either`, `(,)` and `Const` |
| 66 |
* `Foldable` and `Traversable` instances for `Alt` from `Data.Monoid` |
| 67 |
* `Functor`, `Applicative`, and `Monad` instances for |
| 68 |
`(,,) a b` and `(,,,) a b c` |
| 69 |
* `Functor` instances for `(,,,,) a b c d`, `(,,,,,) a b c d e`, and |
| 70 |
`(,,,,,) a b c d e f` |
| 71 |
* `Functor` instance for `Handler`, `ArgOrder`, `OptDescr`, and `ArgDescr` |
| 72 |
* `Functor`, `Applicative`, `Alternative`, and `MonadPlus` instances for `ArrowMonad` |
| 73 |
* `Functor`, `Applicative`, `Monad`, `Alternative`, and `MonadPlus` instances |
| 74 |
for `Kleisli` |
| 75 |
* `Ix` instances for tuples of size 6 through 15 |
| 76 |
* `Ix` instances for integral types in `Foreign.C.Types`, `Foreign.Ptr`, and `System.Posix.Types` |
| 77 |
* `Monad` instance for `(,)` |
| 78 |
* `Monad` instance for `WrappedMonad` |
| 79 |
* `MonadFail`, `Monoid`, and `Semigroup` instances for strict `ST` |
| 80 |
* `MonadFix` instance for `(,) a` |
| 81 |
* `MonadFix` and `MonadZip` instances for `Complex` |
| 82 |
* `MonadZip` instance for `Maybe` |
| 83 |
* `Monoid`, `Eq`, `Ord`, `Read`, and `Show` instances for `Const` |
| 84 |
* `Monoid` instances for `Identity` and `IO` |
| 85 |
* `Num` instance for `Sum` and `Product` |
| 86 |
* `Read` instance for `Fixed` |
| 87 |
* `Semigroup` instances for `IO`, `Event` and `Lifetime` |
| 88 |
* `Semigroup` instances for `V1`, `U1`, `Par1`, `Rec1`, `K1`, `M1`, `(:*:)`, and `(:.:)` from `GHC.Generics`. |
| 89 |
`Monoid` instances for the same types (except `V1`). |
| 90 |
* `Semigroup` and `Monoid` instances for `Data.Functor.Product` and `Data.Functor.Compose` |
| 91 |
* `Show` instance for `Fingerprint` |
| 92 |
* `Show` instance for `UAddr` |
| 93 |
* `Storable` instance for `()`, `Complex`, and `Ratio` |
| 94 |
* `TestEquality` instance for `Compose` |
| 95 |
* `Traversable` instance for `Either`, `(,)` and `Const` |
| 96 |
* `Ord` instance for `TyCon` and `TypeRep`. |
| 97 |
* `Typeable` instance for most data types, typeclasses, and promoted data constructors (when possible) |
| 98 |
|
| 99 |
## What is not covered |
| 100 |
`base-orphans` does not define the following instances: |
| 101 |
|
| 102 |
* `Generic` or `Generic1` instances. These can be found in the |
| 103 |
[`Generics.Deriving.Instances`](https://hackage.haskell.org/package/generic-deriving-1.8.0/docs/Generics-Deriving-Instances.html) |
| 104 |
module of the [`generic-deriving`](https://hackage.haskell.org/package/generic-deriving) |
| 105 |
library. |
| 106 |
* The `Alternative IO` and `MonadPlus IO` instances. These can be found in the |
| 107 |
[`Control.Monad.Trans.Error`](http://hackage.haskell.org/package/transformers-0.4.3.0/docs/src/Control-Monad-Trans-Error.html#line-69) |
| 108 |
module of the [`transformers`](http://hackage.haskell.org/package/transformers) library. |
| 109 |
|
| 110 |
## Supported versions of GHC/`base` |
| 111 |
|
| 112 |
* `ghc-9.12.*` / `base-4.21.*` |
| 113 |
* `ghc-9.10.*` / `base-4.20.*` |
| 114 |
* `ghc-9.8.*` / `base-4.19.*` |
| 115 |
* `ghc-9.6.*` / `base-4.18.*` |
| 116 |
* `ghc-9.4.*` / `base-4.17.*` |
| 117 |
* `ghc-9.2.*` / `base-4.16.*` |
| 118 |
* `ghc-9.0.*` / `base-4.15.*` |
| 119 |
* `ghc-8.10.*` / `base-4.14.*` |
| 120 |
* `ghc-8.8.*` / `base-4.13.*` |
| 121 |
* `ghc-8.6.*` / `base-4.12.*` |
| 122 |
* `ghc-8.4.*` / `base-4.11.*` |
| 123 |
* `ghc-8.2.*` / `base-4.10.*` |
| 124 |
* `ghc-8.0.*` / `base-4.9.*` |
| 125 |
|
| 126 |
We also make an attempt to keep `base-orphans` building with GHC HEAD, but due |
| 127 |
to its volatility, it may not work at any given point in time. If it doesn't, |
| 128 |
please report it! |
| 129 |
|
| 130 |
Patches are welcome; add tests for new code! |