[MLton-user] Re: More Extended Basis Library

Vesa Karvonen vesa.a.j.k at gmail.com
Sun Mar 4 14:48:06 PST 2007


On 3/4/07, Geoffrey Alan Washburn <geoffw at cis.upenn.edu> wrote:
[...]
>      I am thinking about it more categorically/algebraically, rather than
> for specifying the structure of the datatype.  Here are perhaps what I would
> consider the minimal signatures for »HAS_PRODUCTS« and »HAS_UNIT«
>
>      signature HAS_PRODUCTS = sig
>         type t
>         val formProduct : t * t -> t
>         val isProduct : t -> bool
>         val fst : t -> t Option.t
>         val snd : t -> t Option.t
>      end
>
>      signature HAS_UNIT = sig
>         type t
>         val formUnit : unit -> t
>         val isUnit : t -> bool
>      end
>
>  Then one could provide implementations of »HAS_PRODUCTS« and »HAS_UNIT« for
> any number of things, such as lists, sets, prime integers, etc. that
> implements some notion of products and units on that data type. For sets one
> could use the empty set as the unit, and the Cartesian product on sets as
> the product operation.  For prime integers one could use multiplication as
> the product and 1 as the unit. [...]

Ah, I see now what you mean.  I can see that in some contexts these could
be useful.

> I suppose it is arguable that these are too abstract to be useful as
> part of the extended basis.

I don't think that they are necessarily too abstract, but I would
definitely like to see them put to practical use (preferably inside the
EB) before adding them to the EB.  So, are you using modules that
implement signatures like these?  Which modules would you expect to
implement these signatures in the Extended Basis?  How would those
implementations be useful to you?

Also, instead of adding stuff directly to a rather heterogeneous library
such as the EB, it often makes more sense to develop a separate focused
library.

-Vesa Karvonen


More information about the MLton-user mailing list