checkCabalVersion :: M env m => m ()
checkCabalVersion = do
    allowNewer <- asks (configAllowNewer . getConfig)
    cabalVer <- asks (envConfigCabalVersion . getEnvConfig)
    -- https://github.com/haskell/cabal/issues/2023
    when (allowNewer && cabalVer < $(mkVersion "1.22")) $ throwM $
        CabalVersionException $
            "Error: --allow-newer requires at least Cabal version 1.22, but version " ++
            versionString cabalVer ++
            " was found."
checkCabalVersion :: M env m => m ()
checkCabalVersion = do
    allowNewer <- asks (configAllowNewer . getConfig)
    cabalVer <- asks (envConfigCabalVersion . getEnvConfig)
    -- https://github.com/haskell/cabal/issues/2023
    when (allowNewer && cabalVer < $(mkVersion "1.22")) $ throwM $
        CabalVersionException $
            "Error: --allow-newer requires at least Cabal version 1.22, but version " ++
            versionString cabalVer ++
            " was found."
checkCabalVersion = do
    allowNewer <- asks (configAllowNewer . getConfig)
    cabalVer <- asks (envConfigCabalVersion . getEnvConfig)
    -- https://github.com/haskell/cabal/issues/2023
    when (allowNewer && cabalVer < $(mkVersion "1.22")) $ throwM $
        CabalVersionException $
            "Error: --allow-newer requires at least Cabal version 1.22, but version " ++
            versionString cabalVer ++
            " was found."