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, andMonadZipinstances forProxyAlternative,Applicative,Bounded,Data,Enum,Foldable,Functor,Ix,Monad,MonadFix,MonadPlus,MonadZip, andTraversableinstances for data types inGHC.GenericsAlternative,Eq,Ord,Read,Show,Foldable, andTraversableinstances forZipListApplicativeinstance forK1fromGHC.GenericsApplicative,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, andTraversableinstances forDownApplicativeandAlternativeinstances forReadPandReadPrecApplicativeinstance for strict and lazySTApplicative,Foldable,Functor,Monad, andTraversableinstances forComplex,Dual,First,Last,Product, andSumBitsinstance forBoolBits,Bounded, andIntegralinstances forCDevBits,Bounded,Enum,FiniteBits,Floating,Fractional,Integral,IsString,Ix,Num,Real,RealFloat,RealFrac, andStorableinstances forConstandIdentityDatainstances forAll,Any, andConst,IntPtr,WordPtr,WrappedArrowandWrappedMonadData,MonadFixandMonadZipinstances forAlt,Dual,First,Last,Product, andSumDataandIsListinstances forVersionandZipListEq{1,2},Ord{1,2},Show{1,2}, andRead{1,2}instances for(,,)and(,,,)EqandOrdinstances forControl.Exception.ErrorCallEq,Ord,Read, andShowinstances for data types inGHC.GenericsEq,Ord,Bounded,Enum, andIxinstances forSoloEqandOrdinstances forGenerically1EqandOrdinstances forSChar,SNat, andSSymbolEq1,Read1, andShow1instances forComplexEq1,Ord1,Read1, andShow1instances forNonEmptyEq1,Ord1,Read1, andShow1instances for basicGHC.Genericsrepresentation typesEnum,Bounded,Num,Real,Integral,Fractional,RealFrac,Floating, andRealFloatinstances forComposeFoldableinstance forEither,(,)andConstFoldableandTraversableinstances forAltfromData.MonoidFunctor,Applicative, andMonadinstances for(,,) a band(,,,) a b cFunctorinstances for(,,,,) a b c d,(,,,,,) a b c d e, and(,,,,,) a b c d e fFunctorinstance forHandler,ArgOrder,OptDescr, andArgDescrFunctor,Applicative,Alternative, andMonadPlusinstances forArrowMonadFunctor,Applicative,Monad,Alternative, andMonadPlusinstances forKleisliIxinstances for tuples of size 6 through 15Ixinstances for integral types inForeign.C.Types,Foreign.Ptr, andSystem.Posix.TypesMonadinstance for(,)Monadinstance forWrappedMonadMonadFail,Monoid, andSemigroupinstances for strictSTMonadFixinstance for(,) aMonadFixandMonadZipinstances forComplexMonadZipinstance forMaybeMonoid,Eq,Ord,Read, andShowinstances forConstMonoidinstances forIdentityandIONuminstance forSumandProductReadinstance forFixedSemigroupinstances forIO,EventandLifetimeSemigroupinstances forV1,U1,Par1,Rec1,K1,M1,(:*:), and(:.:)fromGHC.Generics.Monoidinstances for the same types (exceptV1).SemigroupandMonoidinstances forData.Functor.ProductandData.Functor.ComposeShowinstance forFingerprintShowinstance forUAddrStorableinstance for(),Complex, andRatioTestEqualityinstance forComposeTraversableinstance forEither,(,)andConstOrdinstance forTyConandTypeRep.Typeableinstance for most data types, typeclasses, and promoted data constructors (when possible)
base-orphans does not define the following instances:
GenericorGeneric1instances. These can be found in theGenerics.Deriving.Instancesmodule of thegeneric-derivinglibrary.- The
Alternative IOandMonadPlus IOinstances. These can be found in theControl.Monad.Trans.Errormodule of thetransformerslibrary.
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!