base-orphans
Backwards-compatible orphan instances for base
https://github.com/haskell-compat/base-orphans#readme
Version on this page: | 0.5.4 |
LTS Haskell 22.43: | 0.9.2 |
Stackage Nightly 2024-12-05: | 0.9.2 |
Latest on Hackage: | 0.9.2 |
base-orphans-0.5.4@sha256:868edf45e121bf18358403d532d27e6de4ca8c1202deb105e83dad9592bc967c,2568
Module documentation for 0.5.4
- 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
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
andAny
Data
,MonadFix
andMonadZip
instances forAlt
,Dual
,First
,Last
,Product
, andSum
Data
andIsList
instances forVersion
Eq
andOrd
instances forControl.Exception.ErrorCall
Eq
,Ord
,Read
, andShow
instances for data types inGHC.Generics
Eq
,Ord
,Read
,Show
,Foldable
, andTraversable
instances forZipList
Foldable
instance forEither
,(,)
andConst
Functor
instance forHandler
,ArgOrder
,OptDescr
, andArgDescr
Functor
,Applicative
,Alternative
, andMonadPlus
instances forArrowMonad
Monad
instance for(,)
Monad
instance forWrappedMonad
MonadZip
instance forMaybe
Monoid
,Eq
,Ord
,Read
, andShow
instances forConst
Monoid
instances forIdentity
andIO
Num
instance forSum
andProduct
Read
instance forFixed
Read
andShow
instances forDown
Show
instance forFingerprint
Storable
instance for()
,Complex
, andRatio
Traversable
instance forEither
,(,)
andConst
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-8.0.1
/base-4.9.0.0
ghc-7.10.3
/base-4.8.2.0
ghc-7.10.2
/base-4.8.1.0
ghc-7.10.1
/base-4.8.0.0
ghc-7.8.4
/base-4.7.0.2
ghc-7.8.3
/base-4.7.0.1
ghc-7.8.2
/base-4.7.0.0
ghc-7.8.1
/base-4.7.0.0
ghc-7.6.3
/base-4.6.0.1
ghc-7.6.2
/base-4.6.0.1
ghc-7.6.1
/base-4.6.0.0
ghc-7.4.2
/base-4.5.1.0
ghc-7.4.1
/base-4.5.0.0
ghc-7.2.2
/base-4.4.1.0
ghc-7.2.1
/base-4.4.0.0
ghc-7.0.4
/base-4.3.1.0
ghc-7.0.3
/base-4.3.1.0
ghc-7.0.2
/base-4.3.1.0
ghc-7.0.1
/base-4.3.0.0
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.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