base-orphans
Backwards-compatible orphan instances for base
https://github.com/haskell-compat/base-orphans#readme
LTS Haskell 22.42: | 0.9.2 |
Stackage Nightly 2024-11-21: | 0.9.2 |
Latest on Hackage: | 0.9.2 |
base-orphans-0.9.2@sha256:455d863c96cf4b1804772c630a235f535fdb52ca9137a4150967b521ee4734ab,3236
Module documentation for 0.9.2
- Data
base-orphans
Scope
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.
Usage
To use base-orphans
, simply import Data.Orphans ()
.
What is covered
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
Enum
,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
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
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)
What is not covered
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.
Supported versions of GHC/base
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.*
ghc-7.10.*
/base-4.8.*
ghc-7.8.*
/base-4.7.*
ghc-7.6.*
/base-4.6.*
ghc-7.4.*
/base-4.5.*
ghc-7.2.*
/base-4.4.*
ghc-7.0.*
/base-4.3.*
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!
Changes
Changes in 0.9.2 [2024.04.30]
- Backport new instances from GHC 9.10/
base-4.20
:Fractional
,RealFrac
,Floating
, andRealFloat
instances forCompose
Changes in 0.9.1 [2023.10.11]
- Backport new instances from GHC 9.8/
base-4.19
:Eq
andOrd
instances forSChar
,SNat
, andSSymbol
Enum
,Bounded
,Num
,Real
, andIntegral
instances forCompose
Changes in 0.9.0 [2023.03.05]
- Adapt to recent changes to
Down
instances:- The
Bounded
instance forDown
was changed inbase-4.15.0.0
to swap the values ofminBound
andmaxBound
for the underlying type. This change has now been propagated tobase-orphans
. - The
Enum
instance forDown
was removed inbase-4.15.0.0
, but a different version of the instance was added back inbase-4.18.0.0
, wheresucc
andpred
are swapped. We have changed the backported version of this instance inbase-orphans
to match the behavior of the instance added inbase-4.18.0.0
. - The
Integral
instance forDown
was removed frombase
entirely inbase-4.15.0.0
. We have finally removed it frombase-orphans
in this release, as it actively makes it more difficult to define the aforementionedEnum
instance.
- The
Changes in 0.8.8.1 [2023.03.05]
- Fix GHC 9.4 build error that was accidentally introduced in
base-orphans-0.8.8
.
Changes in 0.8.8 [2023.03.05]
- Backport new instances from GHC 9.6.1/
base-4.18.0.0
:Functor
instances for the(,,,,) a b c d
,(,,,,,) a b c d e
, and(,,,,,) a b c d e f
tuple types.Eq
andOrd
instances forGenerically1
Changes in 0.8.7 [2022.08.11]
- Backport new instances from GHC 9.2.2/
base-4.16.1.0
:Ix
instances for various integral types inForeign.C.Types
,Foreign.Ptr
, andSystem.Posix.Types
. For a complete list of such types, see https://gitlab.haskell.org/ghc/ghc/-/merge_requests/7385.
- Backport a bugfix for the
Ord1 Down
instance from GHC 9.4/base-4.17
such that it now uses reverse sort order.
Changes in 0.8.6 [2021.10.29]
- Backport
Eq
,Ord
,Bounded
,Enum
, andIx
instances forSolo
, introduced in GHC 9.2/base-4.16
- Remove the backported
Eq1
andOrd1
instances forFixed
that were introduced inbase-orphans-0.8.5
. While these briefly appeared in a release candidate version of GHC 9.2.1, they were ultimately removed from the final 9.2.1 release. This release ofbase-orphans
synchronizes with that change.
Changes in 0.8.5 [2021.08.29]
- Backport new instances from GHC 9.2/
base-4.16
Eq1
,Read1
, andShow1
instances forComplex
Eq1
andOrd1
instances forFixed
Eq{1,2}
,Ord{1,2}
,Show{1,2}
, andRead{1,2}
instances for(,,)
and(,,,)
Semigroup
andMonoid
instances forData.Functor.Product
andData.Functor.Compose
Changes in 0.8.4 [2020.12.09]
- Backport the
Ord
instances forTyCon
andTypeRep
to be available on GHC 7.0.
Changes in 0.8.3 [2020.09.30]
- Backport new instances from GHC 9.0/
base-4.15
MonadFix
andMonadZip
instances forComplex
Ix
instances for tuples of size 6 through 15
Changes in 0.8.2 [2020.01.27]
- Backport new instances from GHC 8.10/
base-4.14
Bits
,Bounded
,Enum
,FiniteBits
,Floating
,Fractional
,Integral
,Ix
,Real
,RealFrac
,RealFloat
andStorable
instances forData.Ord.Down
Functor
,Applicative
,Monad
,Alternative
, andMonadPlus
instances forKleisli
Functor
,Applicative
, andMonad
instances for(,,) a b
and(,,,) a b c
Data
instances forWrappedArrow
andWrappedMonad
Data
andIsList
instances forZipList
TestEquality
instance forCompose
- Backport the
Typeable (() :: Constraint)
instance to be available on GHC 7.8.
Changes in 0.8.1 [2019.03.25]
- Ensure that the test suite passes non-negative numbers to
Bits
methods that require them, such asbit
,setBit
,clearBit
,complementBit
, andtestBit
.
Changes in 0.8 [2018.07.02]
- Backported new instance from GHC 8.6/
base-4.12
- Data types in
GHC.Generics
:Applicative
instance forK1
Semigroup
instances forU1
,Par1
,Rec1
,K1
,M1
,(:*:)
,(:.:)
, andV1
Monoid
instances forU1
,Par1
,Rec1
,K1
,M1
,(:*:)
, and(:.:)
Foldable
andTraversable
instances forData.Monoid.Alt
MonadFix
,MonadZip
,Data
,Foldable
,Traversable
,Eq1
,Ord1
,Read1
, andShow1
instances forData.Ord.Down
- Data types in
Changes in 0.7 [2018.03.08]
- Backported new instances from GHC 8.4/
base-4.11
Alternative
instance forZipList
Data
instance forIntPtr
andWordPtr
Num
,Functor
,Applicative
,Monad
,Semigroup
, andMonoid
instances forData.Ord.Down
MonadFail
,Semigroup
, andMonoid
instances for strictST
Changes in 0.6 [2017.04.10]
- Backported new instances from GHC 8.2/
base-4.10
(see https://github.com/haskell-compat/base-orphans/issues/39):Data
instance forConst
Eq1
,Ord1
,Read1
, andShow1
instances forNonEmpty
Semigroup
instances forIO
,Event
, andLifetime
- Backported
Typeable
instances for(:+:)
,(:*:)
,(:.:)
,M1
,Rec1
,ArrowMonad
,Kleisli
,WrappedArrow
,WrappedMonad
, andAny
on GHC 7.6 and earlier - Backported
Data
instances for(:+:)
,(:*:)
,(:.:)
,M1
, andRec1
on GHC 7.6 and earlier
Changes in 0.5.4
- Backported
Bits
,FiniteBits
,Floating
,Fractional
,Integral
,IsString
,Num
,Real
,RealFloat
, andRealFrac
instances forIdentity
andConst
(introduced inbase-4.9
)
Changes in 0.5.3
- Backported
Alternative
,MonadPlus
andMonadZip
instances forU1
andProxy
, and made theFunctor
,Foldable
,Traversable
,Alternative
, andMonad
instances forU1
lazier to correspond withbase-4.9
Changes in 0.5.2
- Backported
Enum
,Bounded
,Ix
,Functor
,Applicative
,Monad
,MonadFix
,MonadPlus
,MonadZip
,Foldable
,Traversable
, andData
instances for datatypes in theGHC.Generics
module (introduced inbase-4.9
)
Changes in 0.5.1
- The
Storable
instances forComplex
andRatio
are now exactly as lazy as their counterparts inbase
(see issue #36)
Changes in 0.5.0
- GHC 8.0 compatibility
- Backported instances introduced in GHC 8.0/
base-4.9
(see https://github.com/haskell-compat/base-orphans/issues/32)
Changes in 0.4.5
- Import
Control.Monad.Instances
(which exportsFunctor
andMonad
instances for(->) r
, andFunctor
instances for(,) a
andEither a
) on GHCs before 7.6. This ensures that these instances will always be in scope, and you won’t have to import a module which is deprecated on recent GHC releases. - Fix build on GHC HEAD (again)
Changes in 0.4.4
- Fix build on GHC HEAD
Changes in 0.4.3
- Fix build on OSes where
HTYPE_DEV_T = Int32
(e.g., OS X)
Changes in 0.4.2
Functor
instances forHandler
Functor
.Applicative
,Alternative
, andMonadPlus
instances forArrowMonad
- Expose
Read
andShow
instances forDown
on GHCs before 7.8 Bits
,Bounded
, andIntegral
instances forCDev
Changes in 0.4.1
- Fixed imports on GHC < 7.8 on Windows
Changes in 0.4.0
- Removed all
Generic
andGeneric1
instances. These have been moved to thegeneric-deriving
library.
Changes in 0.3.3
Typeable
instances for(~)
,Any
,Constraint
,CSigset
,Handler
,Opaque
,SPEC
, and every promotable data constructor inbase
Changes in 0.3.2
Storable (Complex a)
instance no longer requires aRealFloat a
constraint if usingbase-4.4
or later
Changes in 0.3.1
Functor
,Applicative
, andMonad
instances forFirst
andLast
Changes in 0.3.0
Show
instance forFingerprint
Data.Orphans
is nowTrustworthy
- Backported the
Generic
andGeneric1
instances available inbase-4.7.0.0
to GHC 7.2, 7.4, and 7.6, namelyConst
,WrappedMonad
, andZipList
fromControl.Applicative
WrappedArrow
fromControl.Category
All
,Any
,Dual
,Endo
,First
,Last
,Product
, andSum
fromData.Monoid
U1
,Par1
,Rec1
,K1
,M1
,(:+:)
,(:*:)
,(:.:)
,Arity
,Associativity
, andFixity
fromGHC.Generics
Changes in 0.2.0
- Drop GHC 6.12 (and
base-4.2.0.0
) compatibility - Fix Windows, GHCJS build
Read
instance forFixed
Applicative
instances for strict and lazyST
Typeable
instance forSampleVar
Applicative
andAlternative
instances forReadP
andReadPrec
Typeable
instance forKProxy
Typeable
instances for more data types inGHC.
-prefixed modulesGeneric
instances forArity
,Associativity
, andFixity
from theGHC.Generics
module- Corrected the
Generic
instance for(:*:)
to work around GHC bug #9830