Re:Why Julia's DataFrames Are Still Slow
by thenoether on Sunday November 29, 2015 @10:09PM
(#10647421)
> if `f(x)` does not return something of type `Complex{T}`
Sorry, meant to say "if `f(g(x)` does not return something of type `Complex{T}`"
That's true in one sense - typed functions aren't really a thing yet (functor types are, but they're more clumsy to use in a lot of cases).
With regards to your first point, you can actually specify the types of returned values by utilizing assertions:
Type inference should totally pick up on the return type declared here, and an error is thrown if `f(x)` does not return something of type `Complex{T}`.Assertions obviously don't address all of the concerns you listed, but I find they still help a lot to address type inference "failures" in some places, and seem to be underutilized in a few cases.
This doesn't help any memory boxing/slowness inherent to `f` or `g`, but downstream methods (e.g. callers of `h`) can definitely benefit from the explicit information.