Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve documentation grammar and usage. #1088

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions containers/docs/map.rst
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,8 @@ value) pairs in the map ``m`` in *descending* key order.
Querying
^^^^^^^^

Lookup an entry in the map (lookup)
"""""""""""""""""""""""""""""""""""
Look up an entry in the map (lookup)
""""""""""""""""""""""""""""""""""""

::

Expand Down
2 changes: 1 addition & 1 deletion containers/docs/sequence.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ The following GHCi session shows some of the basic sequence functionality::
> 3


-- Lookup an element at a certain index (since version 0.4.8).
-- Look up an element at a certain index (since version 0.4.8).
Seq.lookup 2 nums
> Just 3

Expand Down
6 changes: 3 additions & 3 deletions containers/src/Data/IntMap/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@ member !k = go
notMember :: Key -> IntMap a -> Bool
notMember k m = not $ member k m

-- | \(O(\min(n,W))\). Lookup the value at a key in the map. See also 'Data.Map.lookup'.
-- | \(O(\min(n,W))\). Look up the value at a key in the map. See also 'Data.Map.lookup'.

-- See Note: Local 'go' functions and capturing
lookup :: Key -> IntMap a -> Maybe a
Expand Down Expand Up @@ -985,8 +985,8 @@ updateWithKey f k t@(Tip ky y)
| otherwise = t
updateWithKey _ _ Nil = Nil

-- | \(O(\min(n,W))\). Lookup and update.
-- The function returns original value, if it is updated.
-- | \(O(\min(n,W))\). Look up and update.
-- This function returns the original value, if it is updated.
-- This is different behavior than 'Data.Map.updateLookupWithKey'.
-- Returns the original key value if the map entry is deleted.
--
Expand Down
2 changes: 1 addition & 1 deletion containers/src/Data/IntMap/Strict/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ updateWithKey f !k t =
| otherwise -> t
Nil -> Nil

-- | \(O(\min(n,W))\). Lookup and update.
-- | \(O(\min(n,W))\). Look up and update.
-- The function returns original value, if it is updated.
-- This is different behavior than 'Data.Map.updateLookupWithKey'.
-- Returns the original key value if the map entry is deleted.
Expand Down
8 changes: 4 additions & 4 deletions containers/src/Data/Map/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ size (Bin sz _ _ _ _) = sz
{-# INLINE size #-}


-- | \(O(\log n)\). Lookup the value at a key in the map.
-- | \(O(\log n)\). Look up the value at a key in the map.
--
-- The function will return the corresponding value as @('Just' value)@,
-- or 'Nothing' if the key isn't in the map.
Expand Down Expand Up @@ -1115,8 +1115,8 @@ updateWithKey = go
{-# INLINE updateWithKey #-}
#endif

-- | \(O(\log n)\). Lookup and update. See also 'updateWithKey'.
-- The function returns changed value, if it is updated.
-- | \(O(\log n)\). Look up and update. See also 'updateWithKey'.
-- This function returns the 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
Expand Down Expand Up @@ -1470,7 +1470,7 @@ findIndex = go 0
{-# INLINABLE findIndex #-}
#endif

-- | \(O(\log n)\). Lookup the /index/ of a key, which is its zero-based index in
-- | \(O(\log n)\). Look up the /index/ of a key, which is its zero-based index in
-- the sequence sorted by keys. The index is a number from /0/ up to, but not
-- including, the 'size' of the map.
--
Expand Down
4 changes: 2 additions & 2 deletions containers/src/Data/Map/Strict/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -739,8 +739,8 @@ updateWithKey = go
{-# INLINE updateWithKey #-}
#endif

-- | \(O(\log n)\). Lookup and update. See also 'updateWithKey'.
-- The function returns changed value, if it is updated.
-- | \(O(\log n)\). Look up and update. See also 'updateWithKey'.
-- This function returns the 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
Expand Down
2 changes: 1 addition & 1 deletion containers/src/Data/Set/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1477,7 +1477,7 @@ findIndex = go 0
{-# INLINABLE findIndex #-}
#endif

-- | \(O(\log n)\). Lookup the /index/ of an element, which is its zero-based index in
-- | \(O(\log n)\). Look up the /index/ of an element, which is its zero-based index in
-- the sorted sequence of elements. The index is a number from /0/ up to, but not
-- including, the 'size' of the set.
--
Expand Down
Loading