Skip to content

Piracy of map(f) #179

@mcabbott

Description

@mcabbott

This package overwrites Base's behaviour for one-argument map, for example:

julia> map(println)  # calls println()


julia> using FillArrays

julia> map(println)
ERROR: MethodError: reducing over an empty collection is not allowed; consider supplying `init` to the reducer
Stacktrace:
  [1] reduce_empty(op::Base.MappingRF{typeof(length), Base.BottomRF{typeof(min)}}, #unused#::Type{Union{}})
    @ Base ./reduce.jl:356
...
  [9] mapreduce(f::Function, op::Function, itr::Tuple{})
    @ Base ./reduce.jl:302
 [10] map(::Function)
    @ FillArrays ~/.julia/packages/FillArrays/5Arin/src/fillbroadcast.jl:6

julia> @which map(println)
map(f::Function, vs::FillArrays.AbstractFill{<:Any, 1}...)
     @ FillArrays ~/.julia/packages/FillArrays/5Arin/src/fillbroadcast.jl:5

Blame points to #146 unfortunately...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions