mapping streams to primitive values