The Polymorphic Identifiers and storage combinators of Objective-Smalltalk do exactly this.

    s3:bucket/key ← data.
    s3:bucket/key ← file:myfile.txt

https://objective.st

https://dl.acm.org/doi/10.1145/2508168.2508169

https://dl.acm.org/doi/10.1145/3359591.3359729

(not sure why the certificate expired...will have to check up on that.)