After spending quite a bit of time in the Customizing broadcasting section of the doc, reading a few questions here and trawling through the source code of StaticArrays.jl I’m throwing the sponge. (Once I’ve figured this out, I’ll try to help make this broadcasting section of the docs more accessible for the lay person like me…).

My specs are pretty simple:

```
struct MyType{R} <: AbstractVector{R}
data::Matrix{R}
metadata
end
```

I’d like to be able to do what’s required so that a user can do `f.(x)`

where `x`

is an instance of `MyType`

. This is pretty much identical to the `ArrayAndChar`

example from the docs with one difference: `data`

is a Matrix, elements of MyType are the rows. Something like

```
Base.length(m::MyType) = size(m.data, 1)
Base.getindex(m::MyType, i::Integer) = m.data[i,:]
Base.getindex(m::MyType, I::AbstractVector{<:Integer}) = MyType(m.data[I, :], m.metadata)
```

What I’d like to do is that `f.(x)`

applies `f`

to rows of `x.data`

. I don’t need operations etc, just this broadcasting rule. As a toy example, I’d like to be able to do `maximum.(x)`

and get a vector of maxes i.e. similar as the `[maximum(x[i]) for i in 1:length(x)]`

. (In practice I’d like `f`

to make use of the metadata but that doesn’t seem to be the hard bit)

After thoroughly confusing myself between the custom `similar`

and `copyto!`

, I admit I don’t understand what’s going on, help would be very welcome, thanks!