mappings 0.3.1.0 → 0.3.2.0
raw patch · 2 files changed
+15/−21 lines, 2 filesdep ~basedep ~containersdep ~partialordPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependency ranges changed: base, containers, partialord
API changes (from Hackage documentation)
- Data.Mapping: AlgebraWrapper :: m a -> AlgebraWrapper k m a
+ Data.Mapping: AlgebraWrapper :: m a -> AlgebraWrapper (k2 :: k) (m :: k1 -> Type) (a :: k1)
- Data.Mapping: Constant :: v -> Constant k v
+ Data.Mapping: Constant :: v -> Constant (k1 :: k) v
- Data.Mapping: OnEither :: m v -> n v -> OnEither k l m n v
+ Data.Mapping: OnEither :: m v -> n v -> OnEither (k3 :: k) (l :: k1) (m :: k2 -> Type) (n :: k2 -> Type) (v :: k2)
- Data.Mapping: OnMaybe :: v -> m v -> OnMaybe k m v
+ Data.Mapping: OnMaybe :: v -> m v -> OnMaybe (k1 :: k) (m :: Type -> Type) v
- Data.Mapping: OnPair :: m (n v) -> OnPair k l m n v
+ Data.Mapping: OnPair :: m (n v) -> OnPair (k4 :: k) (l :: k1) (m :: k2 -> Type) (n :: k3 -> k2) (v :: k3)
- Data.Mapping: OrdWrapper :: m v -> OrdWrapper k m v
+ Data.Mapping: OrdWrapper :: m v -> OrdWrapper (k2 :: k) (m :: k1 -> Type) (v :: k1)
- Data.Mapping: PartialOrdWrapper :: m v -> PartialOrdWrapper k m v
+ Data.Mapping: PartialOrdWrapper :: m v -> PartialOrdWrapper (k2 :: k) (m :: k1 -> Type) (v :: k1)
- Data.Mapping: [algebraUnwrap] :: AlgebraWrapper k m a -> m a
+ Data.Mapping: [algebraUnwrap] :: AlgebraWrapper (k2 :: k) (m :: k1 -> Type) (a :: k1) -> m a
- Data.Mapping: [asComposite] :: OnPair k l m n v -> m (n v)
+ Data.Mapping: [asComposite] :: OnPair (k4 :: k) (l :: k1) (m :: k2 -> Type) (n :: k3 -> k2) (v :: k3) -> m (n v)
- Data.Mapping: [constantValue] :: Constant k v -> v
+ Data.Mapping: [constantValue] :: Constant (k1 :: k) v -> v
- Data.Mapping: [getOrdMapping] :: OrdWrapper k m v -> m v
+ Data.Mapping: [getOrdMapping] :: OrdWrapper (k2 :: k) (m :: k1 -> Type) (v :: k1) -> m v
- Data.Mapping: [getPartialOrdMapping] :: PartialOrdWrapper k m v -> m v
+ Data.Mapping: [getPartialOrdMapping] :: PartialOrdWrapper (k2 :: k) (m :: k1 -> Type) (v :: k1) -> m v
- Data.Mapping: [onJust] :: OnMaybe k m v -> m v
+ Data.Mapping: [onJust] :: OnMaybe (k1 :: k) (m :: Type -> Type) v -> m v
- Data.Mapping: [onLeft] :: OnEither k l m n v -> m v
+ Data.Mapping: [onLeft] :: OnEither (k3 :: k) (l :: k1) (m :: k2 -> Type) (n :: k2 -> Type) (v :: k2) -> m v
- Data.Mapping: [onNothing] :: OnMaybe k m v -> v
+ Data.Mapping: [onNothing] :: OnMaybe (k1 :: k) (m :: Type -> Type) v -> v
- Data.Mapping: [onRight] :: OnEither k l m n v -> n v
+ Data.Mapping: [onRight] :: OnEither (k3 :: k) (l :: k1) (m :: k2 -> Type) (n :: k2 -> Type) (v :: k2) -> n v
- Data.Mapping: class Foldable m => Mapping k m | m -> k
+ Data.Mapping: class Foldable m => Mapping k (m :: Type -> Type) | m -> k
- Data.Mapping: class Neighbourly m
+ Data.Mapping: class Neighbourly (m :: Type -> Type)
- Data.Mapping: data OnEither k l m n v
+ Data.Mapping: data OnEither (k3 :: k) (l :: k1) (m :: k2 -> Type) (n :: k2 -> Type) (v :: k2)
- Data.Mapping: data OnMaybe k m v
+ Data.Mapping: data OnMaybe (k1 :: k) (m :: Type -> Type) v
- Data.Mapping: newtype AlgebraWrapper k m a
+ Data.Mapping: newtype AlgebraWrapper (k2 :: k) (m :: k1 -> Type) (a :: k1)
- Data.Mapping: newtype Constant k v
+ Data.Mapping: newtype Constant (k1 :: k) v
- Data.Mapping: newtype OnPair k l m n v
+ Data.Mapping: newtype OnPair (k4 :: k) (l :: k1) (m :: k2 -> Type) (n :: k3 -> k2) (v :: k3)
- Data.Mapping: newtype OrdWrapper k m v
+ Data.Mapping: newtype OrdWrapper (k2 :: k) (m :: k1 -> Type) (v :: k1)
- Data.Mapping: newtype PartialOrdWrapper k m v
+ Data.Mapping: newtype PartialOrdWrapper (k2 :: k) (m :: k1 -> Type) (v :: k1)
- Data.Mapping.Decision: Base :: Seq v -> Seq (Node k m a) -> Base k m a v
+ Data.Mapping.Decision: Base :: Seq v -> Seq (Node k1 m a) -> Base (k1 :: k) (m :: Type -> Type) a v
- Data.Mapping.Decision: Builder :: Map v Int -> Map (Node k m a) Int -> Map o Int -> Builder o k m a v
+ Data.Mapping.Decision: Builder :: Map v Int -> Map (Node k1 m a) Int -> Map o Int -> Builder o (k1 :: k) (m :: Type -> Type) a v
- Data.Mapping.Decision: Decision :: !Base k m a v -> !Int -> Decision k m a v
+ Data.Mapping.Decision: Decision :: !Base k1 m a v -> !Int -> Decision (k1 :: k) (m :: Type -> Type) a v
- Data.Mapping.Decision: Node :: !a -> !m Int -> Node k m a
+ Data.Mapping.Decision: Node :: !a -> !m Int -> Node (k1 :: k) (m :: Type -> Type) a
- Data.Mapping.Decision: [base] :: Decision k m a v -> !Base k m a v
+ Data.Mapping.Decision: [base] :: Decision (k1 :: k) (m :: Type -> Type) a v -> !Base k1 m a v
- Data.Mapping.Decision: [fromOld] :: Builder o k m a v -> Map o Int
+ Data.Mapping.Decision: [fromOld] :: Builder o (k1 :: k) (m :: Type -> Type) a v -> Map o Int
- Data.Mapping.Decision: [leavesMap] :: Builder o k m a v -> Map v Int
+ Data.Mapping.Decision: [leavesMap] :: Builder o (k1 :: k) (m :: Type -> Type) a v -> Map v Int
- Data.Mapping.Decision: [leaves] :: Base k m a v -> Seq v
+ Data.Mapping.Decision: [leaves] :: Base (k1 :: k) (m :: Type -> Type) a v -> Seq v
- Data.Mapping.Decision: [nodeBranch] :: Node k m a -> !m Int
+ Data.Mapping.Decision: [nodeBranch] :: Node (k1 :: k) (m :: Type -> Type) a -> !m Int
- Data.Mapping.Decision: [nodeDecision] :: Node k m a -> !a
+ Data.Mapping.Decision: [nodeDecision] :: Node (k1 :: k) (m :: Type -> Type) a -> !a
- Data.Mapping.Decision: [nodesMap] :: Builder o k m a v -> Map (Node k m a) Int
+ Data.Mapping.Decision: [nodesMap] :: Builder o (k1 :: k) (m :: Type -> Type) a v -> Map (Node k1 m a) Int
- Data.Mapping.Decision: [nodes] :: Base k m a v -> Seq (Node k m a)
+ Data.Mapping.Decision: [nodes] :: Base (k1 :: k) (m :: Type -> Type) a v -> Seq (Node k1 m a)
- Data.Mapping.Decision: [start] :: Decision k m a v -> !Int
+ Data.Mapping.Decision: [start] :: Decision (k1 :: k) (m :: Type -> Type) a v -> !Int
- Data.Mapping.Decision: addLeaf :: (Ord o, Ord v) => v -> o -> Builder o k m a v -> Builder o k m a v
+ Data.Mapping.Decision: addLeaf :: forall {k1} o v (k2 :: k1) (m :: Type -> Type) a. (Ord o, Ord v) => v -> o -> Builder o k2 m a v -> Builder o k2 m a v
- Data.Mapping.Decision: baseGenMerge :: (Ord a, Ord w, Ord (o Int), Mapping l o) => (u -> v -> w) -> (forall x. Ord x => a -> m x -> o x) -> (forall y. Ord y => a -> n y -> o y) -> (forall x y. (Ord x, Ord y) => a -> m x -> n y -> o (x, y)) -> Base h m a u -> Base k n a v -> Set (Int, Int) -> Builder (Int, Int) l o a w
+ Data.Mapping.Decision: baseGenMerge :: forall {k1} {k2} a w o l u v m n (h :: k1) (k3 :: k2). (Ord a, Ord w, Ord (o Int), Mapping l o) => (u -> v -> w) -> (forall x. Ord x => a -> m x -> o x) -> (forall y. Ord y => a -> n y -> o y) -> (forall x y. (Ord x, Ord y) => a -> m x -> n y -> o (x, y)) -> Base h m a u -> Base k3 n a v -> Set (Int, Int) -> Builder (Int, Int) l o a w
- Data.Mapping.Decision: baseLength :: Base k m a v -> Int
+ Data.Mapping.Decision: baseLength :: forall {k1} (k2 :: k1) (m :: Type -> Type) a v. Base k2 m a v -> Int
- Data.Mapping.Decision: baseMap :: (Ord a, Ord (m Int), Ord w, Mapping k m) => (v -> w) -> Base k m a v -> Builder Int k m a w
+ Data.Mapping.Decision: baseMap :: forall a (m :: Type -> Type) w k v. (Ord a, Ord (m Int), Ord w, Mapping k m) => (v -> w) -> Base k m a v -> Builder Int k m a w
- Data.Mapping.Decision: baseMerge :: (Ord a, Ord w, Ord (m Int), Mapping k m) => (u -> v -> w) -> Base k m a u -> Base k m a v -> Set (Int, Int) -> Builder (Int, Int) k m a w
+ Data.Mapping.Decision: baseMerge :: forall a w (m :: Type -> Type) k u v. (Ord a, Ord w, Ord (m Int), Mapping k m) => (u -> v -> w) -> Base k m a u -> Base k m a v -> Set (Int, Int) -> Builder (Int, Int) k m a w
- Data.Mapping.Decision: baseMergeA :: (Applicative f, Ord a, Ord w, Ord (m Int), Mapping k m) => (u -> v -> f w) -> Base k m a u -> Base k m a v -> Set (Int, Int) -> f (Builder (Int, Int) k m a w)
+ Data.Mapping.Decision: baseMergeA :: forall f a w (m :: Type -> Type) k u v. (Applicative f, Ord a, Ord w, Ord (m Int), Mapping k m) => (u -> v -> f w) -> Base k m a u -> Base k m a v -> Set (Int, Int) -> f (Builder (Int, Int) k m a w)
- Data.Mapping.Decision: baseTransform :: (Ord a, Ord (n Int), Mapping l n, Ord w) => (v -> w) -> (forall x. a -> m x -> n x) -> Base k m a v -> IntSet -> Builder Int l n a w
+ Data.Mapping.Decision: baseTransform :: forall {k1} a n l w v m (k2 :: k1). (Ord a, Ord (n Int), Mapping l n, Ord w) => (v -> w) -> (forall x. () => a -> m x -> n x) -> Base k2 m a v -> IntSet -> Builder Int l n a w
- Data.Mapping.Decision: baseTraverse :: (Applicative f, Ord a, Ord (m Int), Ord w, Mapping k m) => (v -> f w) -> Base k m a v -> f (Builder Int k m a w)
+ Data.Mapping.Decision: baseTraverse :: forall f a (m :: Type -> Type) w k v. (Applicative f, Ord a, Ord (m Int), Ord w, Mapping k m) => (v -> f w) -> Base k m a v -> f (Builder Int k m a w)
- Data.Mapping.Decision: bestSuchThat :: (Mapping k m, Ord k, Ord a, Ord v) => (v -> Bool) -> (forall w. a -> m w -> Maybe (k, w)) -> Decision k m a v -> Maybe ([(a, k)], v)
+ Data.Mapping.Decision: bestSuchThat :: (Mapping k m, Ord k, Ord a, Ord v) => (v -> Bool) -> (forall w. () => a -> m w -> Maybe (k, w)) -> Decision k m a v -> Maybe ([(a, k)], v)
- Data.Mapping.Decision: buildBase :: Builder o k m a v -> Base k m a v
+ Data.Mapping.Decision: buildBase :: forall {k1} o (k2 :: k1) (m :: Type -> Type) a v. Builder o k2 m a v -> Base k2 m a v
- Data.Mapping.Decision: buildDecision :: Ord o => o -> Builder o k m a v -> Decision k m a v
+ Data.Mapping.Decision: buildDecision :: forall {k1} o (k2 :: k1) (m :: Type -> Type) a v. Ord o => o -> Builder o k2 m a v -> Decision k2 m a v
- Data.Mapping.Decision: checkBijection :: (Eq a, Eq v, Mapping k m) => Base k m a v -> Base k m a v -> Bij -> Maybe Bij
+ Data.Mapping.Decision: checkBijection :: forall a v k (m :: Type -> Type). (Eq a, Eq v, Mapping k m) => Base k m a v -> Base k m a v -> Bij -> Maybe Bij
- Data.Mapping.Decision: chunksTrue :: (Mapping k m, FoldableWithIndex k m, Ord k, Ord a) => Decision k m a Bool -> [Map a k]
+ Data.Mapping.Decision: chunksTrue :: forall k (m :: Type -> Type) a. (Mapping k m, FoldableWithIndex k m, Ord k, Ord a) => Decision k m a Bool -> [Map a k]
- Data.Mapping.Decision: data Base k m a v
+ Data.Mapping.Decision: data Base (k1 :: k) (m :: Type -> Type) a v
- Data.Mapping.Decision: data Builder o k m a v
+ Data.Mapping.Decision: data Builder o (k1 :: k) (m :: Type -> Type) a v
- Data.Mapping.Decision: data Decision k m a v
+ Data.Mapping.Decision: data Decision (k1 :: k) (m :: Type -> Type) a v
- Data.Mapping.Decision: data Node k m a
+ Data.Mapping.Decision: data Node (k1 :: k) (m :: Type -> Type) a
- Data.Mapping.Decision: debugShow :: (Show a, Show v, Show (m Int)) => Decision k m a v -> String
+ Data.Mapping.Decision: debugShow :: forall {k1} a v (m :: Type -> Type) (k2 :: k1). (Show a, Show v, Show (m Int)) => Decision k2 m a v -> String
- Data.Mapping.Decision: decisionLength :: Decision k m a v -> Int
+ Data.Mapping.Decision: decisionLength :: forall {k1} (k2 :: k1) (m :: Type -> Type) a v. Decision k2 m a v -> Int
- Data.Mapping.Decision: decisionTransform :: (Mapping l n, Ord (n Int), Ord a, Ord w) => (v -> w) -> (forall x. a -> m x -> n x) -> Decision k m a v -> Decision l n a w
+ Data.Mapping.Decision: decisionTransform :: forall {k1} l n a w v m (k2 :: k1). (Mapping l n, Ord (n Int), Ord a, Ord w) => (v -> w) -> (forall x. () => a -> m x -> n x) -> Decision k2 m a v -> Decision l n a w
- Data.Mapping.Decision: emptyBuilder :: Builder o k m a v
+ Data.Mapping.Decision: emptyBuilder :: forall {k1} o (k2 :: k1) (m :: Type -> Type) a v. Builder o k2 m a v
- Data.Mapping.Decision: findBijection :: (Eq a, Eq v, Mapping k m) => Decision k m a v -> Decision k m a v -> Maybe Bij
+ Data.Mapping.Decision: findBijection :: forall a v k (m :: Type -> Type). (Eq a, Eq v, Mapping k m) => Decision k m a v -> Decision k m a v -> Maybe Bij
- Data.Mapping.Decision: listTrue :: forall k m a. (Mapping k m, FoldableWithIndex k m, Ord k, Ord a) => Set a -> Decision k m a Bool -> [Map a k]
+ Data.Mapping.Decision: listTrue :: forall k (m :: Type -> Type) a. (Mapping k m, FoldableWithIndex k m, Ord k, Ord a) => Set a -> Decision k m a Bool -> [Map a k]
- Data.Mapping.Decision: restrict :: (Ord (m Int), Ord v, Ord a, Mapping k m) => (a -> Maybe k) -> Decision k m a v -> Decision k m a v
+ Data.Mapping.Decision: restrict :: forall (m :: Type -> Type) v a k. (Ord (m Int), Ord v, Ord a, Mapping k m) => (a -> Maybe k) -> Decision k m a v -> Decision k m a v
Files
- mappings.cabal +12/−12
- src/Data/Mapping/MapWithDefault.hs +3/−9
mappings.cabal view
@@ -1,11 +1,11 @@ cabal-version: 2.2 --- This file has been generated from package.yaml by hpack version 0.36.0.+-- This file has been generated from package.yaml by hpack version 0.37.0. -- -- see: https://github.com/sol/hpack name: mappings-version: 0.3.1.0+version: 0.3.2.0 synopsis: Types which represent functions k -> v description: A typeclass and a number of implementations; please read README.md on github category: Data structures@@ -13,7 +13,7 @@ bug-reports: https://github.com/jcranch/mapping/issues author: James Cranch maintainer: j.d.cranch@sheffield.ac.uk-copyright: 2023-24 James Cranch+copyright: 2023-25 James Cranch license: BSD-3-Clause build-type: Simple extra-doc-files:@@ -40,12 +40,12 @@ src ghc-options: -Wall -Wcompat -Wincomplete-record-updates -Wincomplete-uni-patterns -Wredundant-constraints build-depends:- base >=4.16 && <4.21+ base >=4.16 && <4.22 , cond >=0.5.1 && <0.6- , containers >=0.6.5 && <0.8+ , containers >=0.6.5 && <0.9 , formatting >=7.0.0 && <7.3 , indexed-traversable >=0.1.1 && <0.2- , partialord >=0.0.2 && <0.1+ , partialord ==0.1.* default-language: GHC2021 executable view@@ -58,13 +58,13 @@ examples ghc-options: -Wall -Wcompat -Wincomplete-record-updates -Wincomplete-uni-patterns -Wredundant-constraints -threaded -rtsopts -with-rtsopts=-N build-depends:- base >=4.16 && <4.21+ base >=4.16 && <4.22 , cond >=0.5.1 && <0.6- , containers >=0.6.5 && <0.8+ , containers >=0.6.5 && <0.9 , formatting >=7.0.0 && <7.3 , indexed-traversable >=0.1.1 && <0.2 , mappings- , partialord >=0.0.2 && <0.1+ , partialord ==0.1.* default-language: GHC2021 test-suite mapping@@ -83,12 +83,12 @@ build-tool-depends: hspec-discover:hspec-discover ==2.11.* build-depends:- base >=4.16 && <4.21+ base >=4.16 && <4.22 , cond >=0.5.1 && <0.6- , containers >=0.6.5 && <0.8+ , containers >=0.6.5 && <0.9 , formatting >=7.0.0 && <7.3 , hspec ==2.11.* , indexed-traversable >=0.1.1 && <0.2 , mappings- , partialord >=0.0.2 && <0.1+ , partialord ==0.1.* default-language: GHC2021
src/Data/Mapping/MapWithDefault.hs view
@@ -1,20 +1,14 @@ {-# LANGUAGE- CPP, DerivingVia #-} module Data.Mapping.MapWithDefault where -#if MIN_VERSION_GLASGOW_HASKELL(9,6,0,0)-#else-import Control.Applicative (liftA2)-#endif+import Prelude hiding (Applicative(..), Foldable(..))+import Control.Applicative (Applicative(..)) import Data.Algebra.Boolean-#if MIN_VERSION_GLASGOW_HASKELL(9,10,0,0)+import Data.Foldable (Foldable(..)) import Data.List (groupBy)-#else-import Data.List (foldl', groupBy)-#endif import Data.Map.Strict (Map) import qualified Data.Map.Strict as M import qualified Data.Map.Merge.Strict as M