cabal-lenses 0.7.1 → 0.8.0
raw patch · 3 files changed
+24/−22 lines, 3 filesdep −eitherdep ~transformersPVP ok
version bump matches the API change (PVP)
Dependencies removed: either
Dependency ranges changed: transformers
API changes (from Hackage documentation)
- CabalLenses.PackageDescription: condTreeComponentsL :: forall v_agmt c_agmu a_agmv v_aowF. Lens (CondTree v_agmt c_agmu a_agmv) (CondTree v_aowF c_agmu a_agmv) [CondBranch v_agmt c_agmu a_agmv] [CondBranch v_aowF c_agmu a_agmv]
+ CabalLenses.PackageDescription: condTreeComponentsL :: forall v_agm5 c_agm6 a_agm7 v_aowD. Lens (CondTree v_agm5 c_agm6 a_agm7) (CondTree v_aowD c_agm6 a_agm7) [CondBranch v_agm5 c_agm6 a_agm7] [CondBranch v_aowD c_agm6 a_agm7]
- CabalLenses.PackageDescription: condTreeConstraintsL :: forall v_agmt c_agmu a_agmv. Lens' (CondTree v_agmt c_agmu a_agmv) c_agmu
+ CabalLenses.PackageDescription: condTreeConstraintsL :: forall v_agm5 c_agm6 a_agm7. Lens' (CondTree v_agm5 c_agm6 a_agm7) c_agm6
- CabalLenses.PackageDescription: condTreeDataL :: forall v_agmt c_agmu a_agmv. Lens' (CondTree v_agmt c_agmu a_agmv) a_agmv
+ CabalLenses.PackageDescription: condTreeDataL :: forall v_agm5 c_agm6 a_agm7. Lens' (CondTree v_agm5 c_agm6 a_agm7) a_agm7
- CabalLenses.Utils: findCabalFile :: FilePath -> EitherT Error IO FilePath
+ CabalLenses.Utils: findCabalFile :: FilePath -> ExceptT Error IO FilePath
- CabalLenses.Utils: findPackageDB :: FilePath -> EitherT Error IO (Maybe FilePath)
+ CabalLenses.Utils: findPackageDB :: FilePath -> ExceptT Error IO (Maybe FilePath)
Files
- CHANGELOG +4/−0
- cabal-lenses.cabal +12/−14
- lib/CabalLenses/Utils.hs +8/−8
CHANGELOG view
@@ -1,3 +1,7 @@+0.8.0+-----+* Migrate from EitherT to ExceptT+ 0.7.1 ----- * Raise upper bounds of lens, Cabal and either
cabal-lenses.cabal view
@@ -1,18 +1,18 @@-name: cabal-lenses-version: 0.7.1 cabal-version: >=1.9.2-build-type: Simple+name: cabal-lenses+version: 0.8.0 license: BSD3 license-file: LICENSE maintainer: daniel.trstenjak@gmail.com+author: Daniel Trstenjak+tested-with: ghc ==7.6.2 ghc ==7.6.3 ghc ==7.8.3 ghc ==7.10.1+ ghc ==8.0.1 ghc ==8.2.1 ghc ==8.4.2 synopsis: Lenses and traversals for the Cabal library. description: Lenses and traversals (compatible with the <https://hackage.haskell.org/package/lens lens> library) for the <https://hackage.haskell.org/package/Cabal Cabal> library. category: Utils, Development-author: Daniel Trstenjak-tested-with: GHC ==7.6.2 GHC ==7.6.3 GHC ==7.8.3 GHC ==7.10.1- GHC ==8.0.1 GHC ==8.2.1 GHC ==8.4.2+build-type: Simple extra-source-files: README.md CHANGELOG@@ -32,21 +32,19 @@ CabalLenses.Traversals.BuildInfo CabalLenses.Traversals.Dependency CabalLenses.Utils+ cpp-options: -DCABAL+ hs-source-dirs: lib+ other-modules:+ CabalLenses.Traversals.Internal+ Paths_cabal_lenses+ ghc-options: -W build-depends: base >=3 && <5, lens >=4.0.1 && <4.17, unordered-containers >=0.2.3.3 && <0.3, Cabal >=2.1.0.0 && <2.3,- either >=4.1.1 && <4.6, system-filepath >=0.4.9 && <0.5, system-fileio >=0.3.12 && <0.4, strict >=0.3.2 && <0.4, text >=1.1.0.1 && <1.3, transformers >=0.3.0.0 && <0.6- cpp-options: -DCABAL- hs-source-dirs: lib- other-modules:- CabalLenses.Traversals.Internal- Paths_cabal_lenses- ghc-options: -W-
lib/CabalLenses/Utils.hs view
@@ -7,7 +7,7 @@ , findNewDistDir ) where -import Control.Monad.Trans.Either (EitherT, left, right)+import Control.Monad.Trans.Except (ExceptT, throwE) import Control.Monad.IO.Class import Control.Monad (filterM) import qualified System.IO.Strict as Strict@@ -28,15 +28,15 @@ -- | Find a cabal file starting at the given directory, going upwards the directory -- tree until a cabal file could be found. The returned file path is absolute.-findCabalFile :: FilePath -> EitherT Error IO FilePath+findCabalFile :: FilePath -> ExceptT Error IO FilePath findCabalFile file = do cabalFile <- io $ do dir <- absoluteDirectory file findCabalFile' dir if cabalFile == FP.empty- then left "Couldn't find Cabal file!"- else right . FP.encodeString $ cabalFile+ then throwE "Couldn't find Cabal file!"+ else return $ FP.encodeString cabalFile where findCabalFile' dir = do@@ -61,7 +61,7 @@ -- | Find the package database of the cabal sandbox from the given cabal file. -- The returned file path is absolute.-findPackageDB :: FilePath -> EitherT Error IO (Maybe FilePath)+findPackageDB :: FilePath -> ExceptT Error IO (Maybe FilePath) findPackageDB cabalFile = do cabalDir <- io $ absoluteDirectory cabalFile let sandboxConfig = cabalDir </> sandbox_config@@ -70,10 +70,10 @@ then do packageDB <- io $ readPackageDB sandboxConfig case packageDB of- Just db -> right . Just $ db- _ -> left $ "Couldn't find field 'package-db: ' in " ++ (show sandboxConfig)+ Just db -> return $ Just db+ _ -> throwE $ "Couldn't find field 'package-db: ' in " ++ (show sandboxConfig) else- right Nothing+ return Nothing where -- | reads the 'package-db: ' field from the sandbox config file and returns the value of the field