update

update :: HashTable key val -> key -> val -> IO Bool
base Data.HashTable
Updates an entry in the hash table, returning True if there was already an entry for this key, or False otherwise. After update there will always be exactly one entry for the given key in the table. insert is more efficient than update if you don't care about multiple entries, or you know for sure that multiple entries can't occur. However, update is more efficient than delete followed by insert.
update :: (a -> Maybe a) -> Key -> IntMap a -> IntMap a
containers Data.IntMap.Strict, containers Data.IntMap.Lazy
O(min(n,W)). The expression (update f k map) updates the value x at k (if it is in the map). If (f x) is Nothing, the element is deleted. If it is (Just y), the key k is bound to the new value y. > let f x = if x == "a" then Just "new a" else Nothing > update f 5 (fromList [(5,"a"), (3,"b")]) == fromList [(3, "b"), (5, "new a")] > update f 7 (fromList [(5,"a"), (3,"b")]) == fromList [(3, "b"), (5, "a")] > update f 3 (fromList [(5,"a"), (3,"b")]) == singleton 5 "a"
update :: Int -> a -> Seq a -> Seq a
containers Data.Sequence
O(log(min(i,n-i))). Replace the element at the specified position. If the position is out of range, the original sequence is returned.
update :: Ord k => (a -> Maybe a) -> k -> Map k a -> Map k a
containers Data.Map.Lazy, containers Data.Map.Strict
O(log n). The expression (update f k map) updates the value x at k (if it is in the map). If (f x) is Nothing, the element is deleted. If it is (Just y), the key k is bound to the new value y. > let f x = if x == "a" then Just "new a" else Nothing > update f 5 (fromList [(5,"a"), (3,"b")]) == fromList [(3, "b"), (5, "new a")] > update f 7 (fromList [(5,"a"), (3,"b")]) == fromList [(3, "b"), (5, "a")] > update f 3 (fromList [(5,"a"), (3,"b")]) == singleton 5 "a"
updateTimeout :: EventManager -> TimeoutKey -> Int -> IO ()
base System.Event
updateAt :: (k -> a -> Maybe a) -> Int -> Map k a -> Map k a
containers Data.Map.Lazy
O(log n). Update the element at index, i.e. by its zero-based index in the sequence sorted by keys. If the index is out of range (less than zero, greater or equal to size of the map), error is called. > updateAt (\ _ _ -> Just "x") 0 (fromList [(5,"a"), (3,"b")]) == fromList [(3, "x"), (5, "a")] > updateAt (\ _ _ -> Just "x") 1 (fromList [(5,"a"), (3,"b")]) == fromList [(3, "b"), (5, "x")] > updateAt (\ _ _ -> Just "x") 2 (fromList [(5,"a"), (3,"b")]) Error: index out of range > updateAt (\ _ _ -> Just "x") (-1) (fromList [(5,"a"), (3,"b")]) Error: index out of range > updateAt (\_ _ -> Nothing) 0 (fromList [(5,"a"), (3,"b")]) == singleton 5 "a" > updateAt (\_ _ -> Nothing) 1 (fromList [(5,"a"), (3,"b")]) == singleton 3 "b" > updateAt (\_ _ -> Nothing) 2 (fromList [(5,"a"), (3,"b")]) Error: index out of range > updateAt (\_ _ -> Nothing) (-1) (fromList [(5,"a"), (3,"b")]) Error: index out of range
updateAt :: (k -> a -> Maybe a) -> Int -> Map k a -> Map k a
containers Data.Map.Strict
O(log n). Update the element at index. Calls error when an invalid index is used. > updateAt (\ _ _ -> Just "x") 0 (fromList [(5,"a"), (3,"b")]) == fromList [(3, "x"), (5, "a")] > updateAt (\ _ _ -> Just "x") 1 (fromList [(5,"a"), (3,"b")]) == fromList [(3, "b"), (5, "x")] > updateAt (\ _ _ -> Just "x") 2 (fromList [(5,"a"), (3,"b")]) Error: index out of range > updateAt (\ _ _ -> Just "x") (-1) (fromList [(5,"a"), (3,"b")]) Error: index out of range > updateAt (\_ _ -> Nothing) 0 (fromList [(5,"a"), (3,"b")]) == singleton 5 "a" > updateAt (\_ _ -> Nothing) 1 (fromList [(5,"a"), (3,"b")]) == singleton 3 "b" > updateAt (\_ _ -> Nothing) 2 (fromList [(5,"a"), (3,"b")]) Error: index out of range > updateAt (\_ _ -> Nothing) (-1) (fromList [(5,"a"), (3,"b")]) Error: index out of range
updateFlow :: (DynGraph gr, Num b, Ord b) => Path -> b -> gr a (b, b, b) -> gr a (b, b, b)
fgl Data.Graph.Inductive.Query.MaxFlow
Update flow and residual capacity along augmenting path from s to t in graph G. For a path [u,v,w,...] find the node u in G and its successor and predecessor list, then update the corresponding edges (u,v) and (v,u) on those lists by using the minimum residual capacity of the path.
updateLookupWithKey :: (Key -> a -> Maybe a) -> Key -> IntMap a -> (Maybe a, IntMap a)
containers Data.IntMap.Strict, containers Data.IntMap.Lazy
O(min(n,W)). Lookup and update. The function returns original value, if it is updated. This is different behavior than updateLookupWithKey. Returns the original key value if the map entry is deleted. > let f k x = if x == "a" then Just ((show k) ++ ":new a") else Nothing > updateLookupWithKey f 5 (fromList [(5,"a"), (3,"b")]) == (Just "a", fromList [(3, "b"), (5, "5:new a")]) > updateLookupWithKey f 7 (fromList [(5,"a"), (3,"b")]) == (Nothing, fromList [(3, "b"), (5, "a")]) > updateLookupWithKey f 3 (fromList [(5,"a"), (3,"b")]) == (Just "b", singleton 5 "a")
updateLookupWithKey :: Ord k => (k -> a -> Maybe a) -> k -> Map k a -> (Maybe a, Map k a)
containers Data.Map.Lazy, containers Data.Map.Strict
O(log n). Lookup and update. See also updateWithKey. The function returns changed value, if it is updated. Returns the original key value if the map entry is deleted. > let f k x = if x == "a" then Just ((show k) ++ ":new a") else Nothing > updateLookupWithKey f 5 (fromList [(5,"a"), (3,"b")]) == (Just "5:new a", fromList [(3, "b"), (5, "5:new a")]) > updateLookupWithKey f 7 (fromList [(5,"a"), (3,"b")]) == (Nothing, fromList [(3, "b"), (5, "a")]) > updateLookupWithKey f 3 (fromList [(5,"a"), (3,"b")]) == (Just "b", singleton 5 "a")
updateMax :: (a -> Maybe a) -> IntMap a -> IntMap a
containers Data.IntMap.Strict
O(log n). Update the value at the maximal key. > updateMax (\ a -> Just ("X" ++ a)) (fromList [(5,"a"), (3,"b")]) == fromList [(3, "b"), (5, "Xa")] > updateMax (\ _ -> Nothing) (fromList [(5,"a"), (3,"b")]) == singleton 3 "b"
updateMax :: (a -> Maybe a) -> IntMap a -> IntMap a
containers Data.IntMap.Lazy
O(min(n,W)). Update the value at the maximal key. > updateMax (\ a -> Just ("X" ++ a)) (fromList [(5,"a"), (3,"b")]) == fromList [(3, "b"), (5, "Xa")] > updateMax (\ _ -> Nothing) (fromList [(5,"a"), (3,"b")]) == singleton 3 "b"
updateMax :: (a -> Maybe a) -> Map k a -> Map k a
containers Data.Map.Lazy, containers Data.Map.Strict
O(log n). Update the value at the maximal key. > updateMax (\ a -> Just ("X" ++ a)) (fromList [(5,"a"), (3,"b")]) == fromList [(3, "b"), (5, "Xa")] > updateMax (\ _ -> Nothing) (fromList [(5,"a"), (3,"b")]) == singleton 3 "b"
updateMaxWithKey :: (Key -> a -> Maybe a) -> IntMap a -> IntMap a
containers Data.IntMap.Strict
O(log n). Update the value at the maximal key. > updateMaxWithKey (\ k a -> Just ((show k) ++ ":" ++ a)) (fromList [(5,"a"), (3,"b")]) == fromList [(3,"b"), (5,"5:a")] > updateMaxWithKey (\ _ _ -> Nothing) (fromList [(5,"a"), (3,"b")]) == singleton 3 "b"
updateMaxWithKey :: (Key -> a -> Maybe a) -> IntMap a -> IntMap a
containers Data.IntMap.Lazy
O(min(n,W)). Update the value at the maximal key. > updateMaxWithKey (\ k a -> Just ((show k) ++ ":" ++ a)) (fromList [(5,"a"), (3,"b")]) == fromList [(3,"b"), (5,"5:a")] > updateMaxWithKey (\ _ _ -> Nothing) (fromList [(5,"a"), (3,"b")]) == singleton 3 "b"
updateMaxWithKey :: (k -> a -> Maybe a) -> Map k a -> Map k a
containers Data.Map.Lazy, containers Data.Map.Strict
O(log n). Update the value at the maximal key. > updateMaxWithKey (\ k a -> Just ((show k) ++ ":" ++ a)) (fromList [(5,"a"), (3,"b")]) == fromList [(3,"b"), (5,"5:a")] > updateMaxWithKey (\ _ _ -> Nothing) (fromList [(5,"a"), (3,"b")]) == singleton 3 "b"
updateMin :: (a -> Maybe a) -> IntMap a -> IntMap a
containers Data.IntMap.Strict
O(log n). Update the value at the minimal key. > updateMin (\ a -> Just ("X" ++ a)) (fromList [(5,"a"), (3,"b")]) == fromList [(3, "Xb"), (5, "a")] > updateMin (\ _ -> Nothing) (fromList [(5,"a"), (3,"b")]) == singleton 5 "a"
updateMin :: (a -> Maybe a) -> IntMap a -> IntMap a
containers Data.IntMap.Lazy
O(min(n,W)). Update the value at the minimal key. > updateMin (\ a -> Just ("X" ++ a)) (fromList [(5,"a"), (3,"b")]) == fromList [(3, "Xb"), (5, "a")] > updateMin (\ _ -> Nothing) (fromList [(5,"a"), (3,"b")]) == singleton 5 "a"
updateMin :: (a -> Maybe a) -> Map k a -> Map k a
containers Data.Map.Lazy, containers Data.Map.Strict
O(log n). Update the value at the minimal key. > updateMin (\ a -> Just ("X" ++ a)) (fromList [(5,"a"), (3,"b")]) == fromList [(3, "Xb"), (5, "a")] > updateMin (\ _ -> Nothing) (fromList [(5,"a"), (3,"b")]) == singleton 5 "a"
updateMinWithKey :: (Key -> a -> Maybe a) -> IntMap a -> IntMap a
containers Data.IntMap.Strict
O(log n). Update the value at the minimal key. > updateMinWithKey (\ k a -> Just ((show k) ++ ":" ++ a)) (fromList [(5,"a"), (3,"b")]) == fromList [(3,"3:b"), (5,"a")] > updateMinWithKey (\ _ _ -> Nothing) (fromList [(5,"a"), (3,"b")]) == singleton 5 "a"
updateMinWithKey :: (Key -> a -> Maybe a) -> IntMap a -> IntMap a
containers Data.IntMap.Lazy
O(min(n,W)). Update the value at the minimal key. > updateMinWithKey (\ k a -> Just ((show k) ++ ":" ++ a)) (fromList [(5,"a"), (3,"b")]) == fromList [(3,"3:b"), (5,"a")] > updateMinWithKey (\ _ _ -> Nothing) (fromList [(5,"a"), (3,"b")]) == singleton 5 "a"
updateMinWithKey :: (k -> a -> Maybe a) -> Map k a -> Map k a
containers Data.Map.Lazy, containers Data.Map.Strict
O(log n). Update the value at the minimal key. > updateMinWithKey (\ k a -> Just ((show k) ++ ":" ++ a)) (fromList [(5,"a"), (3,"b")]) == fromList [(3,"3:b"), (5,"a")] > updateMinWithKey (\ _ _ -> Nothing) (fromList [(5,"a"), (3,"b")]) == singleton 5 "a"
updateParserState :: (State s u -> State s u) -> ParsecT s u m (State s u)
parsec Text.Parsec.Prim
updateParserState f applies function f to the parser state.
updatePosChar :: SourcePos -> Char -> SourcePos
parsec Text.Parsec.Pos, parsec Text.ParserCombinators.Parsec.Pos
Update a source position given a character. If the character is a newline ('\n') or carriage return ('\r') the line number is incremented by 1. If the character is a tab ('t') the column number is incremented to the nearest 8'th column, ie. column + 8 - ((column-1) `mod` 8). In all other cases, the column is incremented by 1.
updatePosString :: SourcePos -> String -> SourcePos
parsec Text.Parsec.Pos, parsec Text.ParserCombinators.Parsec.Pos
The expression updatePosString pos s updates the source position pos by calling updatePosChar on every character in s, ie. foldl updatePosChar pos string.
updateState :: Monad m => (u -> u) -> ParsecT s u m ()
parsec Text.Parsec.Prim, parsec Text.ParserCombinators.Parsec.Prim
An alias for modifyState for backwards compatibility.
updateWithKey :: (Key -> a -> Maybe a) -> Key -> IntMap a -> IntMap a
containers Data.IntMap.Strict, containers Data.IntMap.Lazy
O(min(n,W)). The expression (update f k map) updates the value x at k (if it is in the map). If (f k x) is Nothing, the element is deleted. If it is (Just y), the key k is bound to the new value y. > let f k x = if x == "a" then Just ((show k) ++ ":new a") else Nothing > updateWithKey f 5 (fromList [(5,"a"), (3,"b")]) == fromList [(3, "b"), (5, "5:new a")] > updateWithKey f 7 (fromList [(5,"a"), (3,"b")]) == fromList [(3, "b"), (5, "a")] > updateWithKey f 3 (fromList [(5,"a"), (3,"b")]) == singleton 5 "a"
updateWithKey :: Ord k => (k -> a -> Maybe a) -> k -> Map k a -> Map k a
containers Data.Map.Lazy, containers Data.Map.Strict
O(log n). The expression (updateWithKey f k map) updates the value x at k (if it is in the map). If (f k x) is Nothing, the element is deleted. If it is (Just y), the key k is bound to the new value y. > let f k x = if x == "a" then Just ((show k) ++ ":new a") else Nothing > updateWithKey f 5 (fromList [(5,"a"), (3,"b")]) == fromList [(3, "b"), (5, "5:new a")] > updateWithKey f 7 (fromList [(5,"a"), (3,"b")]) == fromList [(3, "b"), (5, "a")] > updateWithKey f 3 (fromList [(5,"a"), (3,"b")]) == singleton 5 "a"
package haskell-updater
package
haskell-updater rebuilds Haskell packages on Gentoo after a GHC upgrade or a dependency upgrade. haskell-updater is written so as to use only GHC's boot libraries so as to have no external dependencies. This version is for: GHC-6.12 + Cabal-1.8, GHC-7.0 + Cabal-1.10, GHC-7.2 + Cabal-1.12, GHC-7.4 + Cabal-1.14, GHC-7.6 + Cabal-1.16, GHC-7.6 + Cabal-1.18. Version 1.2.1
HsFieldUpdate :: HsQName -> HsExp -> HsFieldUpdate
haskell-src Language.Haskell.Syntax
data HsFieldUpdate
haskell-src Language.Haskell.Syntax
An fbind in a labeled record construction or update expression.
HsRecUpdate :: HsExp -> [HsFieldUpdate] -> HsExp
haskell-src Language.Haskell.Syntax
record update expression
mkRecConstrOrUpdate :: HsExp -> [HsFieldUpdate] -> P HsExp
haskell-src Language.Haskell.ParseUtils
oFFSET_StgUpdateFrame_updatee :: Int
base GHC.Constants
sIZEOF_StgUpdateFrame_NoHdr :: Int
base GHC.Constants