Type stability is the main concern and consistency is the other. You want
minimum(::Vector{T}) to return an element of type T but not all T have an
infinite value. We could, of course, do that for floating-point types that
do have an Inf value, but now you have an inconsistency in the behavior or
minimum – it's an error to pass it some empty collection but not others. I
would personally not be averse to making minimum return the appropriate
infinity for empty collections with floating-point element type, but others
may have strong opinions. You could also use typemax, which is something
more types can support, which I would also be ok with, but that is a bit
less obvious.


On Tue, Apr 1, 2014 at 12:02 PM, Andrew Dabrowski <[email protected]>wrote:

> This was probably discussed and settled long ago, in which case just point
> me to the thread.
>
> Why not define
>
> minimum( empty ) = Inf
>
> whenever empty is an iterable with no elements?
>
>

Reply via email to