ok, fooling around with it more, this does compile:
func consumingMap<A>(
_ f: @escaping (inout A) -> Void
) -> (consuming Ref<A>) -> Ref<A> {
{ (ref: consuming Ref<A>) -> Ref<A> in
var newRef = ref
f(&newRef.value)
return newRef
}
}
Seems like I should not have to spell out the full type-annotation here..