[MLton-user] Re: RFC: Extended Basis Library

Geoffrey Alan Washburn geoffw at cis.upenn.edu
Tue Mar 27 09:06:09 PST 2007


Vesa Karvonen wrote:

>> Okay, I'll look into preparing a proposal for these.  I already put
>> together some common signatures for sequences (SEQUENCE_CORE,
>> SEQUENCE_FINITE, SEQUENCE_INFINITE).
>
> Great.  I'm looking forward to seeing these.

As you saw, I sent out my proposals for »SEQUENCE_CORE«, 
»SEQUENCE_FINITE«, »SEQUENCE_INFINITE«.  However, I haven't thought as 
much on the signatures for sorting as I want to try and reconcile the 
three general sequence signatures with the proposal by Stephen. 

> Maybe we should just use oo for now until a better idea merges.


I've done that.  As I mentioned, I think, I was considering captial »O« 
as another possibility, but figured it would be best to get feedback on 
that first.


> So, based on the above description, the function could be named, for
> example, "toBindable" or "toBind".  I'm not suggesting here that this
> would necessarily be a better name than "hoist".  Feel free to choose the
> name.

I've settled on calling it »pure« for now.  But I'm still open to debate 
on it.


> BTW, you could also write it as
>
>  fun thunk th = return () >>= hoist th
>
> or
>
>  fun thunk th = return () >>= toBind th

    That is how it is implemented actually; I just expanded it out 
because the name for »pure« was still under discussion.  

> Just checking how the different names would look like.  Also, an
> alternative for "thunk" could be "fromThunk".  Then one might write
>
>   Monad.fromThunk th
>
> OTOH, the name "thunk" has the advantage of being shorter.

    »fromThunk« is more pleasing in some regard, but there is already a 
precedent for calling it simply »thunk« in the »PRODUCT_TYPE« 
signature.  And it is shorter.

> FYI, I've had a couple of (pre)ideas for potentially improving the fold
> technique on my "list of things to try out" for some time.  This is 
> one of
> the reasons why I haven't yet added any Fold stuff to the extended basis.
> (Currently there is some Fold stuff in the misc-util library.)  I'll try
> to find some time to consider the ideas ASAP.

    Okay, I think maybe I'll hold off on this »ZIP« until then, because 
it would be nice to abstract the »FOLD« bits out of it.

-- 
[Geoff Washburn|geoffw at cis.upenn.edu|http://www.cis.upenn.edu/~geoffw/]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mlton.org/pipermail/mlton-user/attachments/20070327/8e0bcb04/attachment.html


More information about the MLton-user mailing list