Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
Cabal
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Glasgow Haskell Compiler
Packages
Cabal
Commits
2abee8a2
Commit
2abee8a2
authored
9 years ago
by
Mikhail Glushenkov
Browse files
Options
Downloads
Plain Diff
Merge pull request #2920 from phadej/binary-version
binary-0.8.0.0 will provide Binary Version
parents
e99ed843
006c9f77
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Cabal/Distribution/Version.hs
+20
-0
20 additions, 0 deletions
Cabal/Distribution/Version.hs
with
20 additions
and
0 deletions
Cabal/Distribution/Version.hs
+
20
−
0
View file @
2abee8a2
...
...
@@ -3,7 +3,25 @@
#
if
__GLASGOW_HASKELL__
<
707
{-# LANGUAGE StandaloneDeriving #-}
#
endif
-- Hack approach to support bootstrapping
-- Assume binary <0.8 when MIN_VERSION_binary marco is not available.
-- Starting with GHC>=8.0, compiler will hopfully provide this macros too.
-- https://ghc.haskell.org/trac/ghc/ticket/10970
--
-- Otherwise, one can specify -DMIN_VERSION_binary_0_8_0=1, when bootstrapping
-- with binary >=0.8.0.0
#
ifdef
MIN_VERSION_binary
#
define
MIN_VERSION_binary_0_8_0
MIN_VERSION_binary
(
0
,
8
,
0
)
#
else
#
ifndef
MIN_VERSION_binary_0_8_0
#
define
MIN_VERSION_binary_0_8_0
0
#
endif
#
endif
#
if
!
MIN_VERSION_binary_0_8_0
{-# OPTIONS_GHC -fno-warn-orphans #-}
#
endif
-----------------------------------------------------------------------------
-- |
...
...
@@ -113,6 +131,7 @@ instance Binary VersionRange
deriving
instance
Data
Version
#
endif
#
if
!
(
MIN_VERSION_binary_0_8_0
)
-- Deriving this instance from Generic gives trouble on GHC 7.2 because the
-- Generic instance has to be standalone-derived. So, we hand-roll our own.
-- We can't use a generic Binary instance on later versions because we must
...
...
@@ -123,6 +142,7 @@ instance Binary Version where
tags
<-
get
return
$
Version
br
tags
put
(
Version
br
tags
)
=
put
br
>>
put
tags
#
endif
{-# DEPRECATED AnyVersion "Use 'anyVersion', 'foldVersionRange' or 'asVersionIntervals'" #-}
{-# DEPRECATED ThisVersion "use 'thisVersion', 'foldVersionRange' or 'asVersionIntervals'" #-}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment