light_map


Description:

[ CCode ( cname = "gee_future_light_map_fixed" , ordering = 10 , vfunc_name = "light_map_fixed" ) ]
public virtual Future<A> light_map<A> (owned LightMapFunc<A,G> func)

Maps a future value to another value by a function and returns the another value in future.

Note:

The function may be reevaluated at any time and it might be called lazily. Therefore it is recommended for it to be idempotent. If the function needs to be called eagerly or have side-effects it is recommended to use map.

Note:

As time taken by function does not contribute to wait_until and the implementation is allowed to compute value eagerly by wait_async it is recommended to use task and flat_map for longer computation.

Parameters:

func

Function applied to value

Returns:

Value returned by function

Since:

0.11.4

See also:

flat_map, map