Edge Rewrite
// HTMLRewriter · presentation

This page was redesigned at the edge.

Cloudflare fetched the original article and streamed it through HTMLRewriter to apply an entirely new visual system without rebuilding the source page.

// request.cf · coarse context

A page that knows where it met you.

Only coarse request metadata is shown. This demo does not display or persist visitor IP addresses.

Country
US
Cloudflare location
CMH
Connection
HTTP/2
Language
Not provided

Ray ID: a21f3a54cc70c424

Jump to content

Talk:Bounded quantification

Page contents not supported in other languages.
Add topic
From Wikipedia, the free encyclopedia
Latest comment: 3 years ago by ディーエッフ in topic Overview

Overview

[edit]

The purpose of bounded quantification is to allow for polymorphic functions to depend on some specific behaviour of objects instead of type inheritance. It assumes a record-based model for object classes, where every class member is a record element and all class members are named functions. Object attributes are represented as functions that take no argument and return an object. The specific behaviour is then some function name along with the types of the arguments and the return type. Bounded quantification allows to considers all objects with such a function. An example would be a polymorphic min function that considers all objects that are comparable to each other.

This description doesn't sound at all like bounded quantification to me, it sounds like duck typing, structural typing or typeclasses. I also don't understand the relevance of the middle bit about a record-based model, but it seems to be describing a very specific implementation (possibly of typeclasses?) that I doubt applies universally to bounded quantification.ディーエッフ (talk) 13:14, 23 November 2022 (UTC)Reply

Example

[edit]

I don't think the example makes sense. Shouldn't it rather be min: ∀ T. {compareTo: T → int} → T → ?, that is to say, we don't really know how to type this without F-bounded quantification? Isn't this the very point of introducing F-bounded quantification, i.e., that we can't type the program without it? The erased Comparable interface is just an unsafe escape hatch. Maybe an example based on Cloneable<T> is more intuitive? Sgraf812 (talk) 08:18, 25 June 2019 (UTC)sgraf812Reply