Evaluating functor application only once
Phil Clayton <[email protected]> Thu, 4 Apr 2019 07:53:29 +0100
| Newsgroups | gmane.comp.lang.ml.mlton.user |
|---|---|
| Message-ID | <[email protected]> |
In the absence of applicative functors, I am trying to ensure that
certain functors are applied only once. (Without going into too much
detail, the issue is that a library that needs e.g.
structure GUInt8Array = CArray(GUInt8)
can't know whether another library has already introduced the same
structure.)
My approach is to have the functor application in its own SML file:
<Name>.sml
structure <Name> = F(X)
With Poly/ML, which doesn't support MLB files, I can have a variant of
"use" that only processes a file <Name>.sml if there is no existing
structure <Name>.
With MLB files, I plan to also introduce <Name>.mlb (which contains only
<Name>.sml) and refer to that, so that it won't have any effect if
another library has already evaluated <Name>.mlb. What I am doing is
inherently complier-specific, so I wondered - is there is any other
MLton-specific way of achieving the same thing, e.g. MLB extension?
Phil
--
You received this message because you are subscribed to the Google Groups "MLton-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].