Re: ML/OCaml style functors via includes

2017-10-18 Thread gmhwxi
Say we want to do something like what you mentioned: >> potential use case would be, for example, being able write code that is "functorized" over atomics and threads, with implementations like >>a) pthreads and c11 atomics modules for production use >>b) userspace threads and atomics modules,

Re: ML/OCaml style functors via includes

2017-10-18 Thread gmhwxi
The most natural way I can think of to implement sets in ATS is the following one: abstype myset(a:t@ype) = ptr extern fun {a:t@ype} element(): myset(a) extern fun {a:t@ype} add(x0: a, xs: myset(a)): myset(a) extern fun {a:t@ype} member(x0: a, xs: myset(a)): bool And here is a list-based

Re: ML/OCaml style functors via includes

2017-10-18 Thread Andrew Knapp
As a concrete example, an ATS port of the short ML example from this message would be very helpful, even if none of the functions are actually implemented. https://mail.haskell.org/pipermail/haskell/2004-August/014463.html I'd also like to know which of the features of the ML module system

Re: ML/OCaml style functors via includes

2017-10-18 Thread gmhwxi
The following article may shed some light on this issue: http://ats-lang.sourceforge.net/EXAMPLE/EFFECTIVATS/DivideConquer/main.html If you can tell me something a bit more concrete, I will probably be able to say more. On Wednesday, October 18, 2017 at 3:53:34 PM UTC-4, Andrew Knapp wrote: >

ML/OCaml style functors via includes

2017-10-18 Thread Andrew Knapp
Hello, Chapter 3 of "A Tutorial on Programming Features in ATS" mentions that file inclusion can be used to emulate SML or OCaml style functors in a limited manner. Is there an example of this technique somewhere? I would use the record-based functor method, as described in the