# How to discover what functions can be called on a type

**URL:** https://discourse.julialang.org/t/how-to-discover-what-functions-can-be-called-on-a-type/28236
**Category:** General Usage
**Created:** [August 31, 2019, 1:21pm UTC](https://discourse.julialang.org/t/how-to-discover-what-functions-can-be-called-on-a-type/28236 "2019-08-31T13:21:01Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![jtf621](https://avatars.discourse-cdn.com/v4/letter/j/eada6e/32.png) [@jtf621](https://discourse.julialang.org/u/jtf621)
#### Post date: [August 31, 2019, 1:21pm UTC](https://discourse.julialang.org/t/how-to-discover-what-functions-can-be-called-on-a-type/28236/1 "2019-08-31T13:21:01Z")

</div>

What are the different ways using a Julia shell to discover what functions can be called on a type?

I am learning Julia as an experienced Python programmer. In python, I would open ipython, instantiate a variable of the type I wanted and hit . and see lots of functions dispatched on the type. I know Julia is multiple dispatch unlike Python, but I hope there is a simple way to see all the functions that I can call on a type.

My specific case is using counters from DataStructures. I read the docs [https://juliacollections.github.io/DataStructures.jl/latest/accumulators.html](https://juliacollections.github.io/DataStructures.jl/latest/accumulators.html).

In usage I can’t see that you can call `nlargest` on a counter result.

If I ?counter or ?cnt I don’t get any mention of nlargest, only functions that are somewhat spelled like the search term

I hope there is a way that aids discoverability?

`using DataStructures cnt = counter(split("A B C 1 A 2 A B"))`

`Accumulator{SubString{String},Int64} with 5 entries: "B" => 2 "A" => 3 "1" => 1 "C" => 1 "2" => 1`

---

<div class="post-metadata">

### Author: ![pfitzseb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pfitzseb/32/45566_2.png) [@pfitzseb](https://discourse.julialang.org/u/pfitzseb)
#### Post date: [August 31, 2019, 1:26pm UTC](https://discourse.julialang.org/t/how-to-discover-what-functions-can-be-called-on-a-type/28236/2 "2019-08-31T13:26:18Z")

</div>

Try

```julia
methodswith(typeof(cnt), supertypes=true)

```

---

<div class="post-metadata">

### Author: ![jtf621](https://avatars.discourse-cdn.com/v4/letter/j/eada6e/32.png) [@jtf621](https://discourse.julialang.org/u/jtf621)
#### Post date: [August 31, 2019, 9:44pm UTC](https://discourse.julialang.org/t/how-to-discover-what-functions-can-be-called-on-a-type/28236/3 "2019-08-31T21:44:05Z")

</div>

Thank you. That gets me an array of methods.

`methodswith(Accumulator)` was also helpful.

Is there a simpler way to see the help for this list than manually typing each method into the help shell?

I tried  
`julia> map(? , methodswith(Accumulator))`  
`ERROR: syntax: invalid identifier name "?"`

and

`map(Docs.getdoc , methodswith(Accumulator))`  
which returns an array of nothing `29-element Array{Nothing,1}:`

---

<div class="post-metadata">

### Author: ![pfitzseb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pfitzseb/32/45566_2.png) [@pfitzseb](https://discourse.julialang.org/u/pfitzseb)
#### Post date: [September 1, 2019, 8:42am UTC](https://discourse.julialang.org/t/how-to-discover-what-functions-can-be-called-on-a-type/28236/4 "2019-09-01T08:42:47Z")

</div>

You can do something like

```julia
foreach(methodswith(typeof(cnt), supertypes=true)) do m
    display(Docs.doc(Docs.Binding(m.module, m.name), m.sig))
end

```

---

<div class="post-metadata">

### Author: ![jtf621](https://avatars.discourse-cdn.com/v4/letter/j/eada6e/32.png) [@jtf621](https://discourse.julialang.org/u/jtf621)
#### Post date: [September 1, 2019, 8:16pm UTC](https://discourse.julialang.org/t/how-to-discover-what-functions-can-be-called-on-a-type/28236/5 "2019-09-01T20:16:22Z")

</div>

Thank you. Works well.
