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 ()
.
Alternative
,MonadPlus
, andMonadZip
instances forProxy
Alternative
,Applicative
,Bounded
,Data
,Enum
,Foldable
,Functor
,Ix
,Monad
,MonadFix
,MonadPlus
,MonadZip
, andTraversable
instances for data types inGHC.Generics
Alternative
,Eq
,Ord
,Read
,Show
,Foldable
, andTraversable
instances forZipList
Applicative
instance forK1
fromGHC.Generics
Applicative
,Bits
,Bounded
,Data
,Enum
,Eq1
,FiniteBits
,Floating
,Foldable
,Fractional
,Functor
,Ix
,Ord1
,Monad
,MonadFix
,MonadZip
,Monoid
,Num
,Read
,Read1
,Real
,RealFloat
,RealFrac
,Semigroup
,Show
,Show1
,Storable
, andTraversable
instances forDown
Applicative
andAlternative
instances forReadP
andReadPrec
Applicative
instance for strict and lazyST
Applicative
,Foldable
,Functor
,Monad
, andTraversable
instances forComplex
,Dual
,First
,Last
,Product
, andSum
Bits
instance forBool
Bits
,Bounded
, andIntegral
instances forCDev
Bits
,Bounded
,Enum
,FiniteBits
,Floating
,Fractional
,Integral
,IsString
,Ix
,Num
,Real
,RealFloat
,RealFrac
, andStorable
instances forConst
andIdentity
Data
instances forAll
,Any
, andConst
,IntPtr
,WordPtr
,WrappedArrow
andWrappedMonad
Data
,MonadFix
andMonadZip
instances forAlt
,Dual
,First
,Last
,Product
, andSum
Data
andIsList
instances forVersion
andZipList
Eq{1,2}
,Ord{1,2}
,Show{1,2}
, andRead{1,2}
instances for(,,)
and(,,,)
Eq
andOrd
instances forControl.Exception.ErrorCall
Eq
,Ord
,Read
, andShow
instances for data types inGHC.Generics
Eq
,Ord
,Bounded
,Enum
, andIx
instances forSolo
Eq
andOrd
instances forGenerically1
Eq
andOrd
instances forSChar
,SNat
, andSSymbol
Eq1
,Read1
, andShow1
instances forComplex
Eq1
,Ord1
,Read1
, andShow1
instances forNonEmpty
Eq1
,Ord1
,Read1
, andShow1
instances for basicGHC.Generics
representation typesEnum
,Bounded
,Num
,Real
,Integral
,Fractional
,RealFrac
,Floating
, andRealFloat
instances forCompose
Foldable
instance forEither
,(,)
andConst
Foldable
andTraversable
instances forAlt
fromData.Monoid
Functor
,Applicative
, andMonad
instances for(,,) a b
and(,,,) a b c
Functor
instances for(,,,,) a b c d
,(,,,,,) a b c d e
, and(,,,,,) a b c d e f
Functor
instance forHandler
,ArgOrder
,OptDescr
, andArgDescr
Functor
,Applicative
,Alternative
, andMonadPlus
instances forArrowMonad
Functor
,Applicative
,Monad
,Alternative
, andMonadPlus
instances forKleisli
Ix
instances for tuples of size 6 through 15Ix
instances for integral types inForeign.C.Types
,Foreign.Ptr
, andSystem.Posix.Types
Monad
instance for(,)
Monad
instance forWrappedMonad
MonadFail
,Monoid
, andSemigroup
instances for strictST
MonadFix
instance for(,) a
MonadFix
andMonadZip
instances forComplex
MonadZip
instance forMaybe
Monoid
,Eq
,Ord
,Read
, andShow
instances forConst
Monoid
instances forIdentity
andIO
Num
instance forSum
andProduct
Read
instance forFixed
Semigroup
instances forIO
,Event
andLifetime
Semigroup
instances forV1
,U1
,Par1
,Rec1
,K1
,M1
,(:*:)
, and(:.:)
fromGHC.Generics
.Monoid
instances for the same types (exceptV1
).Semigroup
andMonoid
instances forData.Functor.Product
andData.Functor.Compose
Show
instance forFingerprint
Show
instance forUAddr
Storable
instance for()
,Complex
, andRatio
TestEquality
instance forCompose
Traversable
instance forEither
,(,)
andConst
Ord
instance forTyCon
andTypeRep
.Typeable
instance for most data types, typeclasses, and promoted data constructors (when possible)
base-orphans
does not define the following instances:
Generic
orGeneric1
instances. These can be found in theGenerics.Deriving.Instances
module of thegeneric-deriving
library.- The
Alternative IO
andMonadPlus IO
instances. These can be found in theControl.Monad.Trans.Error
module of thetransformers
library.
ghc-9.12.*
/base-4.21.*
ghc-9.10.*
/base-4.20.*
ghc-9.8.*
/base-4.19.*
ghc-9.6.*
/base-4.18.*
ghc-9.4.*
/base-4.17.*
ghc-9.2.*
/base-4.16.*
ghc-9.0.*
/base-4.15.*
ghc-8.10.*
/base-4.14.*
ghc-8.8.*
/base-4.13.*
ghc-8.6.*
/base-4.12.*
ghc-8.4.*
/base-4.11.*
ghc-8.2.*
/base-4.10.*
ghc-8.0.*
/base-4.9.*
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!