Just -base

justifyLeft :: Int -> Char -> Text -> Text
text Data.Text
O(n) Left-justify a string to the given length, using the specified fill character on the right. Subject to fusion. Performs replacement on invalid scalar values. Examples: > justifyLeft 7 'x' "foo" == "fooxxxx" > justifyLeft 3 'x' "foobar" == "foobar"
justifyLeft :: Int64 -> Char -> Text -> Text
text Data.Text.Lazy
O(n) Left-justify a string to the given length, using the specified fill character on the right. Subject to fusion. Performs replacement on invalid scalar values. Examples: > justifyLeft 7 'x' "foo" == "fooxxxx" > justifyLeft 3 'x' "foobar" == "foobar"
justifyRight :: Int -> Char -> Text -> Text
text Data.Text
O(n) Right-justify a string to the given length, using the specified fill character on the left. Performs replacement on invalid scalar values. Examples: > justifyRight 7 'x' "bar" == "xxxxbar" > justifyRight 3 'x' "foobar" == "foobar"
justifyRight :: Int64 -> Char -> Text -> Text
text Data.Text.Lazy
O(n) Right-justify a string to the given length, using the specified fill character on the left. Performs replacement on invalid scalar values. Examples: > justifyRight 7 'x' "bar" == "xxxxbar" > justifyRight 3 'x' "foobar" == "foobar"
adjust :: (a -> a) -> Int -> Seq a -> Seq a
containers Data.Sequence
O(log(min(i,n-i))). Update the element at the specified position. If the position is out of range, the original sequence is returned.
adjust :: (a -> a) -> Key -> IntMap a -> IntMap a
containers Data.IntMap.Strict, containers Data.IntMap.Lazy
O(min(n,W)). Adjust a value at a specific key. 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
adjust :: Ord k => (a -> a) -> k -> Map k a -> Map k a
containers Data.Map.Lazy, containers Data.Map.Strict
O(log n). 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
adjustWithKey :: (Key -> a -> a) -> Key -> IntMap a -> IntMap a
containers Data.IntMap.Strict, containers Data.IntMap.Lazy
O(min(n,W)). 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
adjustWithKey :: Ord k => (k -> a -> a) -> k -> Map k a -> Map k a
containers Data.Map.Lazy, containers Data.Map.Strict
O(log n). 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