Added a new helper function to Utils for joining pairs of lists with pairs of lists
This commit is contained in:
parent
d8b722df89
commit
091acfa848
|
@ -418,7 +418,7 @@ makeSingleEq f e desc = (lift (flatten e) >>* f) >>= makeEquation e ([{-TODO-}],
|
|||
|
||||
-- | A helper function for joining two problems
|
||||
accumProblem :: (EqualityProblem,InequalityProblem) -> (EqualityProblem,InequalityProblem) -> (EqualityProblem,InequalityProblem)
|
||||
accumProblem (a,b) (c,d) = (a ++ c, b ++ d)
|
||||
accumProblem = concatPair
|
||||
|
||||
|
||||
-- | Given a list of (written,read) expressions, an expression representing the upper array bound, returns either an error
|
||||
|
|
|
@ -117,6 +117,10 @@ combineCompare (LT:_) = LT
|
|||
combineCompare (GT:_) = GT
|
||||
combineCompare (EQ:os) = combineCompare os
|
||||
|
||||
-- Takes two pairs of lists, returns a pair with the fsts join and the snds joined
|
||||
concatPair :: ([a], [b]) -> ([a], [b]) -> ([a], [b])
|
||||
concatPair a b = (fst a ++ fst b, snd a ++ snd b)
|
||||
|
||||
-- | Maps two functions over members of a pair
|
||||
transformPair :: (x -> a) -> (y -> b) -> (x,y) -> (a,b)
|
||||
transformPair f g (x,y) = (f x, g y)
|
||||
|
|
Loading…
Reference in New Issue
Block a user