# Why there is no documentation for \`merge\`

**URL:** <https://discourse.julialang.org/t/why-there-is-no-documentation-for-merge/116509>\
**Category:** General Usage\
**Tags:** question\
**Created:** [July 2, 2024, 9:52am UTC](https://discourse.julialang.org/t/why-there-is-no-documentation-for-merge/116509 "2024-07-02T09:52:19Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![VinodV](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/vinodv/32/32733_2.png) [@VinodV](https://discourse.julialang.org/u/VinodV)\
**Post date:** [July 2, 2024, 9:52am UTC](https://discourse.julialang.org/t/why-there-is-no-documentation-for-merge/116509/1 "2024-07-02T09:52:19Z")

</div>

`merge` is a useful function. Why there is no documentation found for it in the julia command line.

Documentation is here : [Collections and Data Structures · The Julia Language](https://docs.julialang.org/en/v1/base/collections/)

```julia
julia> a                            
Dict{Int64, Int64} with 3 entries:  
  2 => 4                            
  3 => 6                            
  1 => 2                            
                                    
julia> b                            
Dict{Int64, Int64} with 4 entries:  
  4 => 10                           
  2 => 8                            
  3 => 9                            
  1 => 7                            
                                    
julia> c = merge(a,b)               
Dict{Any, Any} with 4 entries:      
  4 => [10]                         
  2 => [4, 8]                       
  3 => [6, 9]                       
  1 => [2, 7]

```

```julia
help?> merge
search: merge merge! mergewith mergewith! MergeSort

  No documentation found.

  merge is a Function.

  # 1 method for generic function "merge" from Main:
   [1] merge(d...)
       @ REPL[6]:1

```

---

<div class="post-metadata">

**Author:** ![Jake](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jake/32/46007_2.png) [@Jake](https://discourse.julialang.org/u/Jake)\
**Post date:** [July 2, 2024, 11:57am UTC](https://discourse.julialang.org/t/why-there-is-no-documentation-for-merge/116509/2 "2024-07-02T11:57:44Z")

</div>

I just tried it on 1.10.4 with the following result

```julia
help?> merge
search: merge merge! mergewith mergewith! MergeSort

  merge(d::AbstractDict, others::AbstractDict...)

  Construct a merged collection from the given collections. If necessary, the types of the resulting collection will
  be promoted to accommodate the types of the merged collections. If the same key is present in another collection,
  the value for that key will be the value it has in the last collection listed. See also mergewith for custom
  handling of values with the same key.

  Examples
  ≡≡≡≡≡≡≡≡

```

---

<div class="post-metadata">

**Author:** ![GHTaarn](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ghtaarn/32/216007_2.png) [@GHTaarn](https://discourse.julialang.org/u/GHTaarn)\
**Post date:** [July 2, 2024, 12:03pm UTC](https://discourse.julialang.org/t/why-there-is-no-documentation-for-merge/116509/3 "2024-07-02T12:03:06Z")

</div>

Are you satisfied with the documentation now or do you still need help?

I get many pages of documentation for `merge`, so it is available if working correctly.

---

<div class="post-metadata">

**Author:** ![GunnarFarneback](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gunnarfarneback/32/1827_2.png) [@GunnarFarneback](https://discourse.julialang.org/u/GunnarFarneback)\
**Post date:** [July 2, 2024, 12:09pm UTC](https://discourse.julialang.org/t/why-there-is-no-documentation-for-merge/116509/4 "2024-07-02T12:09:17Z")

</div>

I suspect that you have defined your own `merge` function. E.g. doing this in a fresh session gives the behavior you see:

```julia
julia> merge(d...) = first(d)
merge (generic function with 1 method)

help?> merge
search: merge merge! mergewith mergewith! MergeSort

  No documentation found.

  merge is a Function.

  # 1 method for generic function "merge" from Main:
   [1] merge(d...)
       @ REPL[1]:1

```

---

<div class="post-metadata">

**Author:** ![ericphanson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ericphanson/32/215186_2.png) [@ericphanson](https://discourse.julialang.org/u/ericphanson)\
**Post date:** [July 2, 2024, 12:09pm UTC](https://discourse.julialang.org/t/why-there-is-no-documentation-for-merge/116509/5 "2024-07-02T12:09:51Z")

</div>

> [@VinodV](#):
>
> ```julia
> # 1 method for generic function "merge" from Main:
> 
> ```

BTW this is an important clue: it means that the name `merge` refers to a function defined in Main (i.e. your code), instead of the name from Base. This is called _shadowing_, i.e. your name is shadowing that of the name from Base. If you do `?Base.merge` you can get the documentation for `Base.merge`.

edit: Scooped by Gunnar 🙂
