[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: A Plan for Hacking

From: William ML Leslie
Subject: Re: A Plan for Hacking
Date: Mon, 26 Sep 2011 21:10:31 +1000

On 26 September 2011 19:11, Marijn <address@hidden> wrote:
> Hash: SHA1
> Hi Noah,
> On 09/26/11 00:33, Noah Lavine wrote:
>> I thought of another use-case, and I wonder if you think this is
>> on-topic or not:
>> - You write a parallel version of map that is fast, but only
>> correct if its argument has no side-effects. You'd like to use this
>> parallel map instead of the regular one, but only when it is
>> correct.
> This seems to assume that map does its thing one element after
> another, but that is not what the spec says it does. Note "The dynamic
> order in which proc is applied to the elements of the lists is
> unspecified." in the below R5RS quote:
> (map proc list1 list2 . . . )
> The lists must be lists, and proc must be a procedure taking
> as many arguments as there are lists and returning a single
> value. If more than one list is given, then they must all
> be the same length. Map applies proc element-wise to the
> elements of the lists and returns a list of the results, in
> order. The dynamic order in which proc is applied to the
> elements of the lists is unspecified.

If you want to reason about the interference of effects, you might
like the original effect typing paper.  They were originally employed
as a means to infer accurate principal type in the presence of
mutability and type parametrism, which might also be useful to you if
you find HM unsuitable, but for reasoning about the /relative purity/
of a call I've found them invaluable.  The paper also touches on
region types, which may be used to remove heap allocation in many
cases, although that application of them is not discussed there.

The Type and Effect Discipline. Jean-Pierre Talpin. Pierre Jouvelot, ENS.

William Leslie

reply via email to

[Prev in Thread] Current Thread [Next in Thread]