Skip to content

Commit

Permalink
Require versions >= 6.0.2
Browse files Browse the repository at this point in the history
`versions-6.0.2` introduces a `Lift Version` instance, which finally allows us
to delete the ugly, CPP'd mess of orphan instances that we define in
`What4.Utils.Versions`.

Related to #240.
  • Loading branch information
RyanGlScott committed Oct 12, 2023
1 parent 0489772 commit c3f9e1b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 15 deletions.
14 changes: 0 additions & 14 deletions what4/src/What4/Utils/Versions.hs
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
{-# LANGUAGE CPP #-}
{-# LANGUAGE DeriveLift #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE TemplateHaskell #-}

{-# OPTIONS_GHC -Wno-orphans #-}

module What4.Utils.Versions where

import qualified Config as Config
Expand All @@ -22,17 +19,6 @@ import Instances.TH.Lift ()
import Language.Haskell.TH
import Language.Haskell.TH.Lift

-- NB, orphan instances :-(
-- See also https://github.com/fosskers/versions/issues/68
#if MIN_VERSION_versions(6,0,0)
deriving instance Lift Versions.Chunk
deriving instance Lift Versions.Chunks
deriving instance Lift Versions.Release
#else
deriving instance Lift Versions.VUnit
#endif
deriving instance Lift Versions.Version

ver :: Text -> Q Exp
ver nm =
case Versions.version nm of
Expand Down
2 changes: 1 addition & 1 deletion what4/what4.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ library
unordered-containers >= 0.2.10,
utf8-string >= 1.0.1,
vector >= 0.12.1,
versions >= 4.0 && < 6.1,
versions >= 6.0.2 && < 6.1,
zenc >= 0.1.0 && < 0.2.0,
ghc-prim >= 0.5.2

Expand Down

0 comments on commit c3f9e1b

Please sign in to comment.