function template_effect(fn, thunks = [], d = derived) {
	if (DEV) {
		// wrap the effect so that we can decorate stack trace with `in {expression}`
		// (TODO maybe there's a better approach?)
		return render_effect(() => {
			var outer = /** @type {Effect} */ (active_effect);
			var inner = () => fn(...deriveds.map(get));

			define_property(outer.fn, 'name', { value: '{expression}' });
			define_property(inner, 'name', { value: '{expression}' });

			const deriveds = thunks.map(d);
			block(inner);
		});
	}

	const deriveds = thunks.map(d);
	return block(() => fn(...deriveds.map(get)));
}
@param {(...expressions: any) => void | (() => void)} fn
@param {Array<() => any>} thunks
@returns {Effect}