bounderProgram :: (Ord z, Ord r, Rep c) => Program z r c -> Either Infeasible (Program z r c)
bounderProgram p
 = do   (c',bs) <- bounderConstraint $ _constraints p
        return $ p
            { _constraints = c'
            , _bounds      = foldl merge (_bounds p) bs }
 where
  merge m (k,v)
   = case M.lookup k m of
     Just v'
      -> M.insert k (mergeBounds v' v) m
     Nothing
      -> M.insert k                 v  m
bounderProgram :: (Ord z, Ord r, Rep c) => Program z r c -> Either Infeasible (Program z r c)
bounderProgram p
 = do   (c',bs) <- bounderConstraint $ _constraints p
        return $ p
            { _constraints = c'
            , _bounds      = foldl merge (_bounds p) bs }
 where
  merge m (k,v)
   = case M.lookup k m of
     Just v'
      -> M.insert k (mergeBounds v' v) m
     Nothing
      -> M.insert k                 v  m
bounderProgram p
 = do   (c',bs) <- bounderConstraint $ _constraints p
        return $ p
            { _constraints = c'
            , _bounds      = foldl merge (_bounds p) bs }
 where
  merge m (k,v)
   = case M.lookup k m of
     Just v'
      -> M.insert k (mergeBounds v' v) m
     Nothing
      -> M.insert k                 v  m