-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Types which represent functions k -> v -- -- A typeclass and a number of implementations; please read README.md on -- github @package mappings @version 0.2.2.0 module Data.Bijection compatibleInsert :: Eq a => Int -> a -> IntMap a -> Maybe (IntMap a) compatibleUnion :: Eq a => IntMap a -> IntMap a -> Maybe (IntMap a) data Bij Bij :: IntMap Int -> IntMap Int -> Bij [rightwards] :: Bij -> IntMap Int [leftwards] :: Bij -> IntMap Int empty :: Bij singleton :: Int -> Int -> Bij match :: Int -> Int -> Bij -> Maybe Bij combine :: Bij -> Bij -> Maybe Bij pop :: Bij -> Maybe ((Int, Int), Bij) -- | Don't check consistency, just take a union unsafeUnion :: Bij -> Bij -> Bij -- | Don't check consistency, just take a diff unsafeDifference :: Bij -> Bij -> Bij -- | A newtype, just to get a partial monoidal structure representing -- consistent unions. newtype MaybeBij MaybeBij :: Maybe Bij -> MaybeBij [getMaybeBij] :: MaybeBij -> Maybe Bij msingleton :: Int -> Int -> MaybeBij closeBijection :: (Int -> Int -> Maybe Bij) -> Bij -> Maybe Bij instance GHC.Classes.Ord Data.Bijection.Bij instance GHC.Classes.Eq Data.Bijection.Bij instance GHC.Classes.Ord Data.Bijection.MaybeBij instance GHC.Classes.Eq Data.Bijection.MaybeBij instance GHC.Base.Semigroup Data.Bijection.MaybeBij instance GHC.Base.Monoid Data.Bijection.MaybeBij module Data.Mapping -- | If Mapping k m, then m v represents a function k -- -> v. -- -- Mapping requires an instance of Foldable, folding over -- the values that appear. Given that a value can be associated with a -- very large collection of keys, the only folds that normally make sense -- are those over idempotent monoids. class Foldable m => Mapping k m | m -> k cst :: Mapping k m => v -> m v act :: Mapping k m => m v -> k -> v isConst :: (Mapping k m, Ord v) => m v -> Maybe v mtraverse :: (Mapping k m, Applicative f, Ord v) => (u -> f v) -> m u -> f (m v) mmap :: (Mapping k m, Ord v) => (u -> v) -> m u -> m v mergeA :: (Mapping k m, Applicative f, Ord w) => (u -> v -> f w) -> m u -> m v -> f (m w) merge :: (Mapping k m, Ord w) => (u -> v -> w) -> m u -> m v -> m w -- | A simultaneous foldMap over two maps pairMappings :: forall k m u v a. (Mapping k m, Monoid a) => (u -> v -> a) -> m u -> m v -> a -- | What values can these two take simultaneously? mutualValues :: (Ord u, Ord v, Mapping k m) => m u -> m v -> Set (u, v) -- | A class representing data structures which have a concept of -- neighbouring values class Neighbourly m neighbours :: (Neighbourly m, Ord v) => m v -> Set (v, v) -- | A wrapper for representing pointwise algebraic structures on a Mapping -- -- Eventually would like to use this only for "deriving via" newtype AlgebraWrapper k m a AlgebraWrapper :: m a -> AlgebraWrapper k m a [algebraUnwrap] :: AlgebraWrapper k m a -> m a -- | Constant functions (on any domain) newtype Constant k v Constant :: v -> Constant k v [constantValue] :: Constant k v -> v -- | Binary decisions, as functions defined on Bool data OnBool a OnBool :: a -> a -> OnBool a [onFalse] :: OnBool a -> a [onTrue] :: OnBool a -> a -- | Maps on Maybe data OnMaybe k m v OnMaybe :: v -> m v -> OnMaybe k m v [onNothing] :: OnMaybe k m v -> v [onJust] :: OnMaybe k m v -> m v -- | Maps on Either data OnEither k l m n v OnEither :: m v -> n v -> OnEither k l m n v [onLeft] :: OnEither k l m n v -> m v [onRight] :: OnEither k l m n v -> n v -- | Maps on pairs newtype OnPair k l m n v OnPair :: m (n v) -> OnPair k l m n v [asComposite] :: OnPair k l m n v -> m (n v) isSubset :: Mapping k m => m Bool -> m Bool -> Bool isDisjoint :: Mapping k m => m Bool -> m Bool -> Bool -- | A wrapper to allow defining PartialOrd instances on mappings -- whose keys have an Ord instance. newtype OrdWrapper k m v OrdWrapper :: m v -> OrdWrapper k m v [getOrdMapping] :: OrdWrapper k m v -> m v newtype PartialOrdWrapper k m v PartialOrdWrapper :: m v -> PartialOrdWrapper k m v [getPartialOrdMapping] :: PartialOrdWrapper k m v -> m v instance GHC.Base.Functor Data.Mapping.OnBool instance GHC.Show.Show a => GHC.Show.Show (Data.Mapping.OnBool a) instance GHC.Classes.Ord a => GHC.Classes.Ord (Data.Mapping.OnBool a) instance GHC.Classes.Eq a => GHC.Classes.Eq (Data.Mapping.OnBool a) instance forall k1 (k2 :: k1) k3 (l :: k3) k4 (m :: k4 -> *) (n :: k4 -> *) (v :: k4). (GHC.Classes.Ord (m v), GHC.Classes.Ord (n v)) => GHC.Classes.Ord (Data.Mapping.OnEither k2 l m n v) instance forall k1 (k2 :: k1) k3 (l :: k3) k4 (m :: k4 -> *) (n :: k4 -> *) (v :: k4). (GHC.Classes.Eq (m v), GHC.Classes.Eq (n v)) => GHC.Classes.Eq (Data.Mapping.OnEither k2 l m n v) instance forall k1 (k2 :: k1) k3 (l :: k3) k4 (m :: k4 -> *) k5 (n :: k5 -> k4) (v :: k5). GHC.Classes.Ord (m (n v)) => GHC.Classes.Ord (Data.Mapping.OnPair k2 l m n v) instance forall k1 (k2 :: k1) k3 (l :: k3) k4 (m :: k4 -> *) k5 (n :: k5 -> k4) (v :: k5). GHC.Classes.Eq (m (n v)) => GHC.Classes.Eq (Data.Mapping.OnPair k2 l m n v) instance (GHC.Classes.Ord a, GHC.Base.Semigroup a) => GHC.Base.Semigroup (Data.Mapping.OnBool a) instance (GHC.Classes.Ord a, GHC.Base.Monoid a) => GHC.Base.Monoid (Data.Mapping.OnBool a) instance (GHC.Classes.Ord a, GHC.Num.Num a) => GHC.Num.Num (Data.Mapping.OnBool a) instance (GHC.Classes.Ord b, Data.Algebra.Boolean.Boolean b) => Data.Algebra.Boolean.Boolean (Data.Mapping.OnBool b) instance (Data.Mapping.Mapping k m, GHC.Classes.Ord a, GHC.Base.Semigroup a) => GHC.Base.Semigroup (Data.Mapping.OnMaybe k m a) instance (Data.Mapping.Mapping k m, GHC.Classes.Ord a, GHC.Base.Monoid a) => GHC.Base.Monoid (Data.Mapping.OnMaybe k m a) instance (Data.Mapping.Mapping k m, GHC.Classes.Ord a, GHC.Num.Num a) => GHC.Num.Num (Data.Mapping.OnMaybe k m a) instance (Data.Mapping.Mapping k m, GHC.Classes.Ord a, Data.Algebra.Boolean.Boolean a) => Data.Algebra.Boolean.Boolean (Data.Mapping.OnMaybe k m a) instance (Data.Mapping.Mapping k m, Data.Mapping.Mapping l n, GHC.Classes.Ord a, GHC.Base.Semigroup a) => GHC.Base.Semigroup (Data.Mapping.OnEither k l m n a) instance (Data.Mapping.Mapping k m, Data.Mapping.Mapping l n, GHC.Classes.Ord a, GHC.Base.Monoid a) => GHC.Base.Monoid (Data.Mapping.OnEither k l m n a) instance (Data.Mapping.Mapping k m, Data.Mapping.Mapping l n, GHC.Classes.Ord a, GHC.Num.Num a) => GHC.Num.Num (Data.Mapping.OnEither k l m n a) instance (Data.Mapping.Mapping k m, Data.Mapping.Mapping l n, GHC.Classes.Ord a, Data.Algebra.Boolean.Boolean a) => Data.Algebra.Boolean.Boolean (Data.Mapping.OnEither k l m n a) instance (Data.Mapping.Mapping k m, Data.Mapping.Mapping l n, GHC.Classes.Ord a, GHC.Base.Semigroup a, forall v. GHC.Classes.Ord v => GHC.Classes.Ord (n v)) => GHC.Base.Semigroup (Data.Mapping.OnPair k l m n a) instance (Data.Mapping.Mapping k m, Data.Mapping.Mapping l n, GHC.Classes.Ord a, GHC.Base.Monoid a, forall v. GHC.Classes.Ord v => GHC.Classes.Ord (n v)) => GHC.Base.Monoid (Data.Mapping.OnPair k l m n a) instance (Data.Mapping.Mapping k m, Data.Mapping.Mapping l n, GHC.Classes.Ord a, GHC.Num.Num a, forall v. GHC.Classes.Ord v => GHC.Classes.Ord (n v)) => GHC.Num.Num (Data.Mapping.OnPair k l m n a) instance (Data.Mapping.Mapping k m, Data.Mapping.Mapping l n, GHC.Classes.Ord b, Data.Algebra.Boolean.Boolean b, forall v. GHC.Classes.Ord v => GHC.Classes.Ord (n v)) => Data.Algebra.Boolean.Boolean (Data.Mapping.OnPair k l m n b) instance (Data.Mapping.Mapping k m, Data.PartialOrd.PartialOrd v) => Data.PartialOrd.PartialOrd (Data.Mapping.PartialOrdWrapper k m v) instance (Data.Mapping.Mapping k m, GHC.Classes.Ord v) => Data.PartialOrd.PartialOrd (Data.Mapping.OrdWrapper k m v) instance forall k1 k2 (m :: * -> *) (n :: * -> *) (k3 :: k1) (l :: k2). (Data.Foldable.Foldable m, Data.Foldable.Foldable n) => Data.Foldable.Foldable (Data.Mapping.OnPair k3 l m n) instance (Data.Mapping.Mapping k m, Data.Mapping.Mapping l n, forall v. GHC.Classes.Ord v => GHC.Classes.Ord (n v)) => Data.Mapping.Mapping (k, l) (Data.Mapping.OnPair k l m n) instance forall k1 k2 (m :: * -> *) (n :: * -> *) (k3 :: k1) (l :: k2). (Data.Foldable.Foldable m, Data.Foldable.Foldable n) => Data.Foldable.Foldable (Data.Mapping.OnEither k3 l m n) instance (WithIndex.FoldableWithIndex k m, WithIndex.FoldableWithIndex l n) => WithIndex.FoldableWithIndex (Data.Either.Either k l) (Data.Mapping.OnEither k l m n) instance (Data.Mapping.Mapping k m, Data.Mapping.Mapping l n) => Data.Mapping.Mapping (Data.Either.Either k l) (Data.Mapping.OnEither k l m n) instance forall k1 (m :: * -> *) (k2 :: k1). Data.Foldable.Foldable m => Data.Foldable.Foldable (Data.Mapping.OnMaybe k2 m) instance WithIndex.FoldableWithIndex k m => WithIndex.FoldableWithIndex (GHC.Maybe.Maybe k) (Data.Mapping.OnMaybe k m) instance Data.Mapping.Mapping k m => Data.Mapping.Mapping (GHC.Maybe.Maybe k) (Data.Mapping.OnMaybe k m) instance Data.Foldable.Foldable Data.Mapping.OnBool instance WithIndex.FoldableWithIndex GHC.Types.Bool Data.Mapping.OnBool instance Data.Traversable.Traversable Data.Mapping.OnBool instance Data.Mapping.Mapping GHC.Types.Bool Data.Mapping.OnBool instance Data.Mapping.Neighbourly Data.Mapping.OnBool instance forall k1 (k2 :: k1). Data.Foldable.Foldable (Data.Mapping.Constant k2) instance Data.Mapping.Mapping k (Data.Mapping.Constant k) instance forall k1 (k2 :: k1). Data.Mapping.Neighbourly (Data.Mapping.Constant k2) instance forall k1 v (k2 :: k1). GHC.Base.Semigroup v => GHC.Base.Semigroup (Data.Mapping.Constant k2 v) instance forall k1 v (k2 :: k1). GHC.Base.Monoid v => GHC.Base.Monoid (Data.Mapping.Constant k2 v) instance forall k1 v (k2 :: k1). GHC.Num.Num v => GHC.Num.Num (Data.Mapping.Constant k2 v) instance forall k1 v (k2 :: k1). Data.Algebra.Boolean.Boolean v => Data.Algebra.Boolean.Boolean (Data.Mapping.Constant k2 v) instance (Data.Mapping.Mapping k m, GHC.Classes.Ord a, GHC.Base.Semigroup a) => GHC.Base.Semigroup (Data.Mapping.AlgebraWrapper k m a) instance (Data.Mapping.Mapping k m, GHC.Classes.Ord a, GHC.Base.Monoid a) => GHC.Base.Monoid (Data.Mapping.AlgebraWrapper k m a) instance (Data.Mapping.Mapping k m, GHC.Classes.Ord a, GHC.Num.Num a) => GHC.Num.Num (Data.Mapping.AlgebraWrapper k m a) instance (Data.Mapping.Mapping k m, GHC.Classes.Ord a, Data.Algebra.Boolean.Boolean a) => Data.Algebra.Boolean.Boolean (Data.Mapping.AlgebraWrapper k m a) module Data.Mapping.Piecewise -- | A data structure storing mappings that are constant on intervals. -- -- If the space of keys not discrete, then these mappings are -- right-continuous: values are in general defined on intervals $a leq x -- < b$ which are closed on the left and open on the right. data Piecewise k v Piecewise :: v -> Map k v -> Piecewise k v [leftEnd] :: Piecewise k v -> v [starts] :: Piecewise k v -> Map k v piecewiseFromAsc :: Eq k => v -> [(k, v)] -> Piecewise k v changeAt :: v -> k -> v -> Piecewise k v atLeast :: k -> Piecewise k Bool lessThan :: k -> Piecewise k Bool fromAscList :: (Ord k, Eq v) => v -> [(k, v)] -> Piecewise k v values :: Piecewise k v -> [v] instance (GHC.Classes.Ord v, GHC.Classes.Ord k) => GHC.Classes.Ord (Data.Mapping.Piecewise.Piecewise k v) instance (GHC.Classes.Eq v, GHC.Classes.Eq k) => GHC.Classes.Eq (Data.Mapping.Piecewise.Piecewise k v) instance (GHC.Classes.Ord k, GHC.Classes.Ord b, GHC.Base.Semigroup b) => GHC.Base.Semigroup (Data.Mapping.Piecewise.Piecewise k b) instance (GHC.Classes.Ord k, GHC.Classes.Ord b, GHC.Base.Monoid b) => GHC.Base.Monoid (Data.Mapping.Piecewise.Piecewise k b) instance (GHC.Classes.Ord k, GHC.Classes.Ord b, GHC.Num.Num b) => GHC.Num.Num (Data.Mapping.Piecewise.Piecewise k b) instance (GHC.Classes.Ord k, GHC.Classes.Ord b, Data.Algebra.Boolean.Boolean b) => Data.Algebra.Boolean.Boolean (Data.Mapping.Piecewise.Piecewise k b) instance (GHC.Show.Show k, GHC.Show.Show v) => GHC.Show.Show (Data.Mapping.Piecewise.Piecewise k v) instance Data.Foldable.Foldable (Data.Mapping.Piecewise.Piecewise k) instance GHC.Classes.Ord k => Data.Mapping.Mapping k (Data.Mapping.Piecewise.Piecewise k) instance Data.Mapping.Neighbourly (Data.Mapping.Piecewise.Piecewise k) module Data.Mapping.Util -- | inserts key with value only if absent, returns map if changed insertIfAbsent :: Ord k => k -> v -> Map k v -> (v, Maybe (Map k v)) -- | For use in maps where we don't want to store default values nonDefault :: Eq a => a -> a -> Maybe a -- | Helper function (not exported) equating :: Eq a => (b -> a) -> b -> b -> Bool module Data.Mapping.MapWithDefault -- | Mappings constant except on an enumerated set of values data MapWithDefault k v MapWithDefault :: v -> Map k v -> MapWithDefault k v [common] :: MapWithDefault k v -> v [exceptions] :: MapWithDefault k v -> Map k v fromList :: (Ord k, Eq v) => v -> [(k, v)] -> MapWithDefault k v fromListWithKey :: (Ord k, Eq v) => v -> (k -> u -> v -> v) -> [(k, u)] -> MapWithDefault k v instance (GHC.Classes.Ord v, GHC.Classes.Ord k) => GHC.Classes.Ord (Data.Mapping.MapWithDefault.MapWithDefault k v) instance (GHC.Classes.Eq v, GHC.Classes.Eq k) => GHC.Classes.Eq (Data.Mapping.MapWithDefault.MapWithDefault k v) instance (GHC.Classes.Ord k, GHC.Classes.Ord b, GHC.Base.Semigroup b) => GHC.Base.Semigroup (Data.Mapping.MapWithDefault.MapWithDefault k b) instance (GHC.Classes.Ord k, GHC.Classes.Ord b, GHC.Base.Monoid b) => GHC.Base.Monoid (Data.Mapping.MapWithDefault.MapWithDefault k b) instance (GHC.Classes.Ord k, GHC.Classes.Ord b, GHC.Num.Num b) => GHC.Num.Num (Data.Mapping.MapWithDefault.MapWithDefault k b) instance (GHC.Classes.Ord k, GHC.Classes.Ord b, Data.Algebra.Boolean.Boolean b) => Data.Algebra.Boolean.Boolean (Data.Mapping.MapWithDefault.MapWithDefault k b) instance (GHC.Show.Show k, GHC.Show.Show v) => GHC.Show.Show (Data.Mapping.MapWithDefault.MapWithDefault k v) instance Data.Foldable.Foldable (Data.Mapping.MapWithDefault.MapWithDefault k) instance GHC.Classes.Ord k => Data.Mapping.Mapping k (Data.Mapping.MapWithDefault.MapWithDefault k) instance (GHC.Enum.Enum k, GHC.Classes.Eq k) => Data.Mapping.Neighbourly (Data.Mapping.MapWithDefault.MapWithDefault k) -- | Decision diagrams, parametric in the mapping type for the decisions. -- -- This is inspired by binary decision diagrams (as described in detail -- in Knuth's The Art of Computer Programming, volume 4A); these are the -- specific case where m is BoolMapping and v is Bool. -- Our algorithms are mostly straightforward generalisations of those -- considered there. module Data.Mapping.Decision -- | A node of a decision diagram: which value do we scrutinise, and what -- do we do with it? data Node k m a Node :: !a -> !m Int -> Node k m a [nodeDecision] :: Node k m a -> !a [nodeBranch] :: Node k m a -> !m Int -- | A decision diagram (with no preferred starting point), containing -- leaves (representing final values of the decision process) indexed -- from -1 downwards, and nodes (representing the need to scrutinise a -- value) indexed from 0 upwards data Base k m a v Base :: Seq v -> Seq (Node k m a) -> Base k m a v [leaves] :: Base k m a v -> Seq v [nodes] :: Base k m a v -> Seq (Node k m a) baseLength :: Base k m a v -> Int -- | A decision diagram with a starting point data Decision k m a v Decision :: !Base k m a v -> !Int -> Decision k m a v [base] :: Decision k m a v -> !Base k m a v [start] :: Decision k m a v -> !Int decisionLength :: Decision k m a v -> Int -- | A value for every node of a base data BaseMap v BaseMap :: Seq v -> Seq v -> BaseMap v [onLeaves] :: BaseMap v -> Seq v [onNodes] :: BaseMap v -> Seq v -- | Index a BaseMap bindex :: BaseMap v -> Int -> v -- | Close a set under an operation closure :: (Int -> IntSet) -> IntSet -> IntSet -- | A general kind of recursive function on a Base baseRecurse :: (Ord c, Mapping k m) => (v -> c) -> (a -> m c -> c) -> Base k m a v -> BaseMap c -- | A general kind of recursive function on a Decision decisionRecurse :: (Ord c, Mapping k m) => (v -> c) -> (a -> m c -> c) -> Decision k m a v -> c -- | A general counting function generalCounts :: (Ord a, Ord n, Mapping k m) => (a -> a -> Int) -> a -> a -> (v -> n) -> (m n -> n) -> Decision k m a v -> n -- | How many values are true in a decision diagram with integer leaves? numberTrueGeneral :: Mapping k m => (m Integer -> Integer) -> Int -> Int -> Decision k m Int Bool -> Integer -- | How many values are True in a binary decision diagram with integer -- leaves? numberTrue :: Int -> Int -> Decision Bool OnBool Int Bool -> Integer -- | Assignments of variables that result in True chunksTrue :: (Mapping k m, FoldableWithIndex k m, Ord k, Ord a) => Decision k m a Bool -> [Map a k] -- | All true values (may be a very long list even for reasonable -- Decisions) 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] -- | What is the best assignment of keys to values resulting in a value on -- which p is True? 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) -- | Build a sequence from key-value pairs; we take on trust that all -- values are represented once. fromKeyVals :: Foldable f => f (Int, a) -> Seq a -- | A data structure for work-in-progress decision diagrams data Builder o k m a v Builder :: Map v Int -> Map (Node k m a) Int -> Map o Int -> Builder o k m a v [leavesMap] :: Builder o k m a v -> Map v Int [nodesMap] :: Builder o k m a v -> Map (Node k m a) Int [fromOld] :: Builder o k m a v -> Map o Int emptyBuilder :: Builder o k m a v addLeaf :: (Ord o, Ord v) => v -> o -> Builder o k m a v -> Builder o k m a v addNode :: (Ord o, Ord (m Int), Ord a, Mapping k m) => a -> m o -> o -> Builder o k m a v -> Builder o k m a v makeBuilder :: (Mapping k m, Ord o, Ord (m Int), Ord a, Ord v) => Map o v -> Map o (a, m o) -> Builder o k m a v buildBase :: Builder o k m a v -> Base k m a v buildDecision :: Ord o => o -> Builder o k m a v -> Decision k m a v -- | A decision tree based on a single decision singleNode :: (Mapping k m, Ord (m Int), Ord a, Ord v) => a -> m v -> Decision k m a v -- | A building block for BDD's - tests if a variable is true genTest :: Boolean b => a -> Decision Bool OnBool a b -- | Test if a variable is true (specialised to Bool) test :: a -> Decision Bool OnBool a Bool -- | Rapidly take the conjunction of the inputs buildAll :: Mapping k m => Map a (m Bool) -> Decision k m a Bool -- | Rapidly take the disjunction of the inputs buildAny :: Mapping k m => Map a (m Bool) -> Decision k m a Bool -- | Traverse bases 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) -- | Map bases baseMap :: (Ord a, Ord (m Int), Ord w, Mapping k m) => (v -> w) -> Base k m a v -> Builder Int k m a w -- | A more general map for Base, where the shape of nodes can -- change 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 -- | A more general map for Decision, where the shape of nodes can -- change 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 -- | Fill in some values of a map > act (restrict h d) f = let > f' x -- = case h x of > Just y -> y > Nothing -> f x > in act d -- f' restrict :: (Ord (m Int), Ord v, Ord a, Mapping k m) => (a -> Maybe k) -> Decision k m a v -> Decision k m a v -- | A general function for merging bases 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 -- | Merge two bases in an applicative functor 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) -- | Merge two bases 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 -- | Attempt to extend to a bijection checkBijection :: (Eq a, Eq v, Mapping k m) => Base k m a v -> Base k m a v -> Bij -> Maybe Bij -- | Are these Decisions isomorphic? findBijection :: (Eq a, Eq v, Mapping k m) => Decision k m a v -> Decision k m a v -> Maybe Bij -- | Output the structure of a Decision debugShow :: (Show a, Show v, Show (m Int)) => Decision k m a v -> String instance forall k1 a (m :: * -> *) (k2 :: k1). (GHC.Classes.Eq a, GHC.Classes.Eq (m GHC.Types.Int)) => GHC.Classes.Eq (Data.Mapping.Decision.Node k2 m a) instance forall k1 a (m :: * -> *) (k2 :: k1). (GHC.Classes.Ord a, GHC.Classes.Ord (m GHC.Types.Int)) => GHC.Classes.Ord (Data.Mapping.Decision.Node k2 m a) instance (Data.Mapping.Mapping k m, GHC.Classes.Ord (m GHC.Types.Int), GHC.Classes.Ord a, GHC.Classes.Ord v, GHC.Base.Semigroup v) => GHC.Base.Semigroup (Data.Mapping.Decision.Decision k m a v) instance (Data.Mapping.Mapping k m, GHC.Classes.Ord (m GHC.Types.Int), GHC.Classes.Ord a, GHC.Classes.Ord v, GHC.Base.Monoid v) => GHC.Base.Monoid (Data.Mapping.Decision.Decision k m a v) instance (Data.Mapping.Mapping k m, GHC.Classes.Ord (m GHC.Types.Int), GHC.Classes.Ord a, GHC.Classes.Ord v, GHC.Num.Num v) => GHC.Num.Num (Data.Mapping.Decision.Decision k m a v) instance (Data.Mapping.Mapping k m, GHC.Classes.Ord (m GHC.Types.Int), GHC.Classes.Ord a, GHC.Classes.Ord v, Data.Algebra.Boolean.Boolean v) => Data.Algebra.Boolean.Boolean (Data.Mapping.Decision.Decision k m a v) instance forall k1 (m :: * -> *) (k2 :: k1) a. Data.Foldable.Foldable m => Data.Foldable.Foldable (Data.Mapping.Decision.Decision k2 m a) instance (GHC.Classes.Ord a, GHC.Classes.Ord (m GHC.Types.Int), Data.Mapping.Mapping k m) => Data.Mapping.Mapping (a -> k) (Data.Mapping.Decision.Decision k m a) instance (GHC.Classes.Eq a, GHC.Classes.Eq v, Data.Mapping.Mapping k m) => GHC.Classes.Eq (Data.Mapping.Decision.Decision k m a v) instance (GHC.Classes.Ord a, GHC.Classes.Ord v, GHC.Classes.Ord (m GHC.Types.Int), Data.Mapping.Mapping k m) => GHC.Classes.Ord (Data.Mapping.Decision.Decision k m a v) instance (Data.Mapping.Mapping k m, Data.Mapping.Neighbourly m, GHC.Classes.Ord a, GHC.Classes.Ord (m GHC.Types.Int)) => Data.Mapping.Neighbourly (Data.Mapping.Decision.Decision k m a) instance forall k1 (k2 :: k1) (m :: * -> *) a. Data.Foldable.Foldable (Data.Mapping.Decision.Base k2 m a)