Derived functors and sheaf cohomology