Hoogle Search

Within LTS Haskell 24.4 (ghc-9.10.2)

Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.

  1. adjustWithKey :: (Key -> a -> a) -> Key -> IntMap a -> IntMap a

    containers Data.IntMap.Strict.Internal

    Adjust a value at a specific key. When the key is not a member of the map, the original map is returned.

    let f key x = (show key) ++ ":new " ++ x
    adjustWithKey f 5 (fromList [(5,"a"), (3,"b")]) == fromList [(3, "b"), (5, "5:new a")]
    adjustWithKey f 7 (fromList [(5,"a"), (3,"b")]) == fromList [(3, "b"), (5, "a")]
    adjustWithKey f 7 empty                         == empty
    

  2. adjust :: Ord k => (a -> a) -> k -> Map k a -> Map k a

    containers Data.Map.Internal

    Update a value at a specific key with the result of the provided function. When the key is not a member of the map, the original map is returned.

    adjust ("new " ++) 5 (fromList [(5,"a"), (3,"b")]) == fromList [(3, "b"), (5, "new a")]
    adjust ("new " ++) 7 (fromList [(5,"a"), (3,"b")]) == fromList [(3, "b"), (5, "a")]
    adjust ("new " ++) 7 empty                         == empty
    

  3. adjustWithKey :: Ord k => (k -> a -> a) -> k -> Map k a -> Map k a

    containers Data.Map.Internal

    Adjust a value at a specific key. When the key is not a member of the map, the original map is returned.

    let f key x = (show key) ++ ":new " ++ x
    adjustWithKey f 5 (fromList [(5,"a"), (3,"b")]) == fromList [(3, "b"), (5, "5:new a")]
    adjustWithKey f 7 (fromList [(5,"a"), (3,"b")]) == fromList [(3, "b"), (5, "a")]
    adjustWithKey f 7 empty                         == empty
    

  4. adjust :: Ord k => (a -> a) -> k -> Map k a -> Map k a

    containers Data.Map.Lazy

    Update a value at a specific key with the result of the provided function. When the key is not a member of the map, the original map is returned.

    adjust ("new " ++) 5 (fromList [(5,"a"), (3,"b")]) == fromList [(3, "b"), (5, "new a")]
    adjust ("new " ++) 7 (fromList [(5,"a"), (3,"b")]) == fromList [(3, "b"), (5, "a")]
    adjust ("new " ++) 7 empty                         == empty
    

  5. adjustWithKey :: Ord k => (k -> a -> a) -> k -> Map k a -> Map k a

    containers Data.Map.Lazy

    Adjust a value at a specific key. When the key is not a member of the map, the original map is returned.

    let f key x = (show key) ++ ":new " ++ x
    adjustWithKey f 5 (fromList [(5,"a"), (3,"b")]) == fromList [(3, "b"), (5, "5:new a")]
    adjustWithKey f 7 (fromList [(5,"a"), (3,"b")]) == fromList [(3, "b"), (5, "a")]
    adjustWithKey f 7 empty                         == empty
    

  6. adjust :: Ord k => (a -> a) -> k -> Map k a -> Map k a

    containers Data.Map.Strict

    Update a value at a specific key with the result of the provided function. When the key is not a member of the map, the original map is returned.

    adjust ("new " ++) 5 (fromList [(5,"a"), (3,"b")]) == fromList [(3, "b"), (5, "new a")]
    adjust ("new " ++) 7 (fromList [(5,"a"), (3,"b")]) == fromList [(3, "b"), (5, "a")]
    adjust ("new " ++) 7 empty                         == empty
    

  7. adjustWithKey :: Ord k => (k -> a -> a) -> k -> Map k a -> Map k a

    containers Data.Map.Strict

    Adjust a value at a specific key. When the key is not a member of the map, the original map is returned.

    let f key x = (show key) ++ ":new " ++ x
    adjustWithKey f 5 (fromList [(5,"a"), (3,"b")]) == fromList [(3, "b"), (5, "5:new a")]
    adjustWithKey f 7 (fromList [(5,"a"), (3,"b")]) == fromList [(3, "b"), (5, "a")]
    adjustWithKey f 7 empty                         == empty
    

  8. adjust :: Ord k => (a -> a) -> k -> Map k a -> Map k a

    containers Data.Map.Strict.Internal

    Update a value at a specific key with the result of the provided function. When the key is not a member of the map, the original map is returned.

    adjust ("new " ++) 5 (fromList [(5,"a"), (3,"b")]) == fromList [(3, "b"), (5, "new a")]
    adjust ("new " ++) 7 (fromList [(5,"a"), (3,"b")]) == fromList [(3, "b"), (5, "a")]
    adjust ("new " ++) 7 empty                         == empty
    

  9. adjustWithKey :: Ord k => (k -> a -> a) -> k -> Map k a -> Map k a

    containers Data.Map.Strict.Internal

    Adjust a value at a specific key. When the key is not a member of the map, the original map is returned.

    let f key x = (show key) ++ ":new " ++ x
    adjustWithKey f 5 (fromList [(5,"a"), (3,"b")]) == fromList [(3, "b"), (5, "5:new a")]
    adjustWithKey f 7 (fromList [(5,"a"), (3,"b")]) == fromList [(3, "b"), (5, "a")]
    adjustWithKey f 7 empty                         == empty
    

  10. adjust :: (a -> a) -> Int -> Seq a -> Seq a

    containers Data.Sequence

    Update the element at the specified position. If the position is out of range, the original sequence is returned. adjust can lead to poor performance and even memory leaks, because it does not force the new value before installing it in the sequence. adjust' should usually be preferred.

Page 27 of many | Previous | Next