11"""
22 module Concatenate
33
4- Alternative implementation for `Base.cat` through [` cat(!)`](@ref cat) .
4+ Alternative implementation for `Base.cat` through `Concatenate. cat(!)`.
55
66This is mostly a copy of the Base implementation, with the main difference being
77that the destination is chosen based on all inputs instead of just the first.
@@ -11,15 +11,19 @@ reminiscent of how Broadcast works.
1111
1212The various entry points for specializing behavior are:
1313
14- * Destination selection can be achieved through
14+ * Destination selection can be achieved through:
1515
16- Base.similar(concat::Concatenated{Style}, ::Type{T}, axes) where {Style}
16+ ```julia
17+ Base.similar(concat::Concatenated{Style}, ::Type{T}, axes) where {Style}
18+ ```
1719
1820* Custom implementations:
1921
20- Base.copy(concat::Concatenated{Style}) # custom implementation of cat
21- Base.copyto!(dest, concat::Concatenated{Style}) # custom implementation of cat! based on style
22- Base.copyto!(dest, concat::Concatenated{Nothing}) # custom implementation of cat! based on typeof(dest)
22+ ```julia
23+ Base.copy(concat::Concatenated{Style}) # custom implementation of cat
24+ Base.copyto!(dest, concat::Concatenated{Style}) # custom implementation of cat! based on style
25+ Base.copyto!(dest, concat::Concatenated{Nothing}) # custom implementation of cat! based on typeof(dest)
26+ ```
2327"""
2428module Concatenate
2529
@@ -136,7 +140,7 @@ Base.ndims(concat::Concatenated) = cat_ndims(dims(concat), concat.args...)
136140
137141Concatenate the supplied `args` along dimensions `dims`.
138142
139- See also [`cat`] and [`cat!`](@ref).
143+ See also [`cat`](@ref) and [`cat!`](@ref).
140144"""
141145concatenate (dims, args... ) = Base. materialize (concatenated (dims, args... ))
142146
@@ -145,7 +149,7 @@ concatenate(dims, args...) = Base.materialize(concatenated(dims, args...))
145149
146150Concatenate the supplied `args` along dimensions `dims`.
147151
148- See also [`concatenate`] and [`cat!`](@ref).
152+ See also [`concatenate`](@ref) and [`cat!`](@ref).
149153"""
150154cat (args... ; dims) = concatenate (dims, args... )
151155Base. materialize (concat:: Concatenated ) = copy (concat)
0 commit comments