function Rx.map(y)assert(type(y)=="\102\117\110\099\116\105\111\110","\066\097\100 \112\114\111\106\101\099\116 \099\097\108\108\098\097\099\107")return function(m)assert(Observable.isObservable(m),"\066\097\100 \111\098\115\101\114\118\097\098\108\101")return Observable.new(function(R)return m:Subscribe(function(...)R:Fire(y(...))end,R:GetFailComplete())end)end end
--[=[
	http://reactivex.io/documentation/operators/map.html

	Maps one value to another

	```lua
	Rx.of(1, 2, 3, 4, 5):Pipe({
		Rx.map(function(x)
			return x + 1
		end)
	}):Subscribe(print) -> 2, 3, 4, 5, 6
	```

	@param project (T) -> U
	@return (source: Observable<T>) -> Observable<U>
]=]
function Rx.map(project)
	assert(type(project) == "function", "Bad project callback")

	return function(source)
		assert(Observable.isObservable(source), "Bad observable")

		return Observable.new(function(sub)
			return source:Subscribe(function(...)
				sub:Fire(project(...))
			end, sub:GetFailComplete())
		end)
	end
end
