Collapsing leftMap and rightMap functions into map functions, and moving the double-sided map operation up to the reference structure level.