≈ the.bay.news

Nested `map` with a capturing closure is not inferred

Julia Programming Language
Nested `map` with a capturing closure is not inferred
A map whose function itself calls map with a closure capturing a variable loses its inferred element type, even though each map alone is inferred fine: using Test h(t, d) = map(u -> u + d, t) # inner map alone f(ts, d) = map(t -> map(u -> u + d, t), ts) # nested map, inner closure captures `d` g(ts) = map(t -> map(u -> u + 1, t), ts) # nested map, inner closure captures nothing ts = [[1.0, 2.0], [3.0]] @inferred h(ts[1], 1.0) @inferred g(ts) @inferred f(ts, 1.0) ...

0 comments

Sign in to join the discussion — your thebay.events account works here.

No comments yet.