From ab82f57d8d2c70bc92b0ad2f67597264bf7c56cc Mon Sep 17 00:00:00 2001 From: Katharine Hyatt Date: Thu, 28 Feb 2019 12:27:28 -0600 Subject: [PATCH] Document AbstractDict and AbstractSet --- base/essentials.jl | 13 +++++++++++++ doc/src/base/collections.md | 2 ++ doc/src/manual/conversion-and-promotion.md | 2 +- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/base/essentials.jl b/base/essentials.jl index 122eb385f19de..719869d67a744 100644 --- a/base/essentials.jl +++ b/base/essentials.jl @@ -6,7 +6,20 @@ const Callable = Union{Function,Type} const Bottom = Union{} +""" + AbstractSet{T} + +Supertype for set-like types whose elements are of type `T`. +[`Set`](@ref), [`BitSet`](@ref) and other types are subtypes of this. +""" abstract type AbstractSet{T} end + +""" + AbstractDict{K, V} + +Supertype for dictionary-like types with keys of type `K` and values of type `V`. +[`Dict`](@ref), [`IdDict`](@ref) and other types are subtypes of this. +""" abstract type AbstractDict{K,V} end # The real @inline macro is not available until after array.jl, so this diff --git a/doc/src/base/collections.md b/doc/src/base/collections.md index c070111d50a7c..2e5ad94307e84 100644 --- a/doc/src/base/collections.md +++ b/doc/src/base/collections.md @@ -191,6 +191,7 @@ for the key `x`). Multiple arguments to `D[...]` are converted to tuples; for e `D[x,y]` is equivalent to `D[(x,y)]`, i.e. it refers to the value keyed by the tuple `(x,y)`. ```@docs +Base.AbstractDict Base.Dict Base.IdDict Base.WeakKeyDict @@ -233,6 +234,7 @@ Partially implemented by: ## Set-Like Collections ```@docs +Base.AbstractSet Base.Set Base.BitSet Base.union diff --git a/doc/src/manual/conversion-and-promotion.md b/doc/src/manual/conversion-and-promotion.md index baf2314dbcb9f..8a9c72ba3f26f 100644 --- a/doc/src/manual/conversion-and-promotion.md +++ b/doc/src/manual/conversion-and-promotion.md @@ -194,7 +194,7 @@ already of the requested type: convert(::Type{T}, x::T) where {T<:Number} = x ``` -Similar definitions exist for `AbstractString`, `AbstractArray`, and `AbstractDict`. +Similar definitions exist for `AbstractString`, [`AbstractArray`](@ref), and [`AbstractDict`](@ref). ## Promotion