Same as map, but for mapping to references.
Maps the value using the given function.
Returns the value if this instance is of type Value, or null if it is of type Reference.