def Gregory(type=float):
	"""Return partial sums of the Gregory series converging to atan(1) == pi/4.

	Yield 1 - 1/3 + 1/5 - 1/7 + ... computed with the given type.
	"""
	return seq(type(1), step=2) >> map(lambda x: 1/x) >> alt_sign >> fold(operator.add)