W3C home > Mailing lists > Public > public-script-coord@w3.org > April to June 2013

Re: The Paradox of Partial Parametricity

From: Kevin Smith <zenparsing@gmail.com>
Date: Fri, 10 May 2013 09:58:24 -0400
Message-ID: <CA+mDt2yy9d=ShVSaKMtCg_VvLHK13-K65EjES7puTt6bH4LzBw@mail.gmail.com>
To: "Mark S. Miller" <erights@google.com>
Cc: Jonas Sicking <jonas@sicking.cc>, es-discuss <es-discuss@mozilla.org>, "public-script-coord@w3.org" <public-script-coord@w3.org>
>      class AsyncTable<T,U> {
>>         constructor() {
>>             this.m = Map<T,U>(); // encapsulation doesn't matter for this
>> example
>>         }
>>         set(keyP :Promise<T>, val :U) {
>>             keyP.then(key => { this.m.set(key, val) });
>>         }
>>         get(keyP :Promise<T>) :Promise<U> {
>>             return keyP.then(key => this.m.get(key));
>>         }
>>     }
>>
>>
The way to make this work would be to lift the value stored in the map.

    get(keyP :Promise<T>) :Promise<U> {
        return keyP.then(key => Q.fullfill(this.m.get(key)));
    }

Do you agree?  Is your premise that forgetting such a "lawyer-ly" detail
will amount to a foot-gun?

{ Kevin }
Received on Friday, 10 May 2013 13:58:59 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:37:49 UTC