Skip to content

Commit

Permalink
Merge pull request #17 from maralorn/bump-version-bounds
Browse files Browse the repository at this point in the history
Bump a number of upper version bounds
  • Loading branch information
3noch authored Jun 22, 2020
2 parents 45d804b + a191ed9 commit 7551cf1
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 12 deletions.
8 changes: 4 additions & 4 deletions patch.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ library
build-depends: base >= 4.9 && < 4.14
, constraints-extras >= 0.3 && < 0.4
, containers >= 0.6 && < 0.7
, dependent-map >= 0.3 && < 0.4
, dependent-sum >= 0.6 && < 0.7
, dependent-map >= 0.3 && < 0.5
, dependent-sum >= 0.6 && < 0.8
, lens >= 4.7 && < 5
, semigroupoids >= 4.0 && < 6
, transformers >= 0.5.6.0 && < 0.6
, witherable >= 0.3 && < 0.3.2
, witherable >= 0.3 && < 0.4

exposed-modules: Data.Functor.Misc
, Data.Monoid.DecidablyEmpty
Expand All @@ -56,7 +56,7 @@ library
ghc-options: -Wall -fwarn-redundant-constraints -fwarn-tabs

if flag(split-these)
build-depends: these >= 1 && <1.1
build-depends: these >= 1 && <1.2
, semialign >=1 && <1.2
, monoidal-containers >= 0.6 && < 0.7
else
Expand Down
4 changes: 2 additions & 2 deletions src/Data/Functor/Misc.hs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ import Data.IntMap (IntMap)
import qualified Data.IntMap as IntMap
import Data.Map (Map)
import qualified Data.Map as Map
import Data.Some (Some(Some))
import Data.Some (Some, mkSome)
import Data.These
import Data.Type.Equality ((:~:)(Refl))
import Data.Typeable hiding (Refl)
Expand Down Expand Up @@ -116,7 +116,7 @@ intMapWithFunctorToDMap = DMap.fromDistinctAscList . map (\(k, v) -> Const2 k :=
-- | Convert a 'DMap' to a regular 'Map' by forgetting the types associated with
-- the keys, using a function to remove the wrapping 'Functor'
weakenDMapWith :: (forall a. v a -> v') -> DMap k v -> Map (Some k) v'
weakenDMapWith f = Map.fromDistinctAscList . map (\(k :=> v) -> (Some k, f v)) . DMap.toAscList
weakenDMapWith f = Map.fromDistinctAscList . map (\(k :=> v) -> (mkSome k, f v)) . DMap.toAscList

--------------------------------------------------------------------------------
-- WrapArg
Expand Down
4 changes: 3 additions & 1 deletion src/Data/Patch/DMap.hs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ import Data.Patch.Class
import Data.Patch.IntMap
import Data.Patch.Map

import Data.Dependent.Map (DMap, DSum (..), GCompare (..))
import Data.Dependent.Map (DMap)
import Data.Dependent.Sum (DSum (..))
import Data.GADT.Compare (GCompare (..))
import qualified Data.Dependent.Map as DMap
import Data.Functor.Constant
import Data.Functor.Misc
Expand Down
11 changes: 6 additions & 5 deletions src/Data/Patch/DMapWithMove.hs
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,21 @@ import Data.Patch.MapWithMove (PatchMapWithMove (..))
import qualified Data.Patch.MapWithMove as MapWithMove

import Data.Constraint.Extras
import Data.Dependent.Map (DMap, DSum (..), GCompare (..))
import Data.Dependent.Map (DMap)
import Data.Dependent.Sum (DSum (..))
import qualified Data.Dependent.Map as DMap
import Data.Functor.Constant
import Data.Functor.Misc
import Data.Functor.Product
import Data.GADT.Compare (GEq (..))
import Data.GADT.Compare (GEq (..), GCompare (..))
import Data.GADT.Show (GShow, gshow)
import qualified Data.Map as Map
import Data.Maybe
import Data.Monoid.DecidablyEmpty
#if !MIN_VERSION_base(4,11,0)
import Data.Semigroup (Semigroup (..))
#endif
import Data.Some (Some(Some))
import Data.Some (Some, mkSome)
import Data.These

-- | Like 'PatchMapWithMove', but for 'DMap'. Each key carries a 'NodeInfo' which describes how it will be changed by the patch and connects move sources and
Expand Down Expand Up @@ -317,8 +318,8 @@ weakenPatchDMapWithMoveWith f (PatchDMapWithMove p) = PatchMapWithMove $ weakenD
{ MapWithMove._nodeInfo_from = case _nodeInfo_from ni of
From_Insert v -> MapWithMove.From_Insert $ f v
From_Delete -> MapWithMove.From_Delete
From_Move k -> MapWithMove.From_Move $ Some k
, MapWithMove._nodeInfo_to = Some <$> getComposeMaybe (_nodeInfo_to ni)
From_Move k -> MapWithMove.From_Move $ mkSome k
, MapWithMove._nodeInfo_to = mkSome <$> getComposeMaybe (_nodeInfo_to ni)
}

-- |"Weaken" a @'PatchDMapWithMove' (Const2 k a) v@ to a @'PatchMapWithMove' k v'@. Weaken is in scare quotes because the 'Const2' has already disabled any
Expand Down

0 comments on commit 7551cf1

Please sign in to comment.