JuliaLang/julia — pull request #8871 by lmsk (2014-11-01 17:58:34+00:00)
Title: Make mapreduce also work with Range{BigInt}

I noticed the following behavior: when calling one of

prod(1:big(16))
reduce(*, 1:big(16))

this results in

```
ERROR: `mapreduce_impl` has no method matching mapreduce_impl(::IdFun, ::MulFun, ::UnitRange{BigInt}, ::Int64, ::BigInt)
in _mapreduce at reduce.jl:168
in prod at reduce.jl:265
```

(On the other hand,

prod(1:big(15))
reduce(*, 1:big(15))
foldl(*, 1:big(16))
factorial(big(16))

all work fine.)

I propose this commit, which fixes that behavior, but should

mapreduce_pairwise_impl(f, op, A::AbstractArray, ifirst::Int, ilast::Int, blksize::Int)
mapreduce_seq_impl(f, op::AddFun, a::AbstractArray, ifirst::Int, ilast::Int)
mapreduce_impl(f, op::AddFun, A::AbstractArray, ifirst::Int, ilast::Int)
mapreduce_impl(f, op::MaxFun, A::AbstractArray, first::Int, last::Int)
mapreduce_impl(f, op::MinFun, A::AbstractArray, first::Int, last::Int)
mapreduce_impl(f, op::AndFun, A::AbstractArray, ifirst::Int, ilast::Int)
mapreduce_impl(f, op::OrFun, A::AbstractArray, ifirst::Int, ilast::Int)

possibly also be changed in the same way, even though their last arguments' being Int does not break anything (that I could find)?