Sorry for the late reply to this thread, I tried to send this message yesterday, but ran into problems with my email setup.
> I'm starting to think that my base assumption (that Typed Units are more or > less equivalent to ML signatures, structures, and functors) is way off. The intent is that they are similar to ML signatures, structures, and functors, but unfortunately, they just aren't quite there yet. I think they support most of the uses of units you would find in the Racket codebase, but when I was implementing them there weren't many uses of them as ways to parameterize over different data types and I didn't make supporting that use case a priority. I do think that Typed Units would be significantly more useful if they supported more of the ML module system features, but there are some interesting questions about units and signatures with type parameters should interact with untyped racket programs. > The mention of `sig-type-form' in the error message suggests that it is > possible to do this, but I'm not seeing the concrete syntax for this > described anywhere. Am I overlooking something? You aren't overlooking anything. I had started trying to support `define-type` style type alias definitions inside of signature definitions, but at some point this was abandoned and probably should have been removed when support for Typed Units was added to Typed Racket. The error message here comes from a missing set of parentheses around the list of type declarations, but adding that doesn't fix the real problem that typed units don't currently support type parameterization. The documentation for typed units can be found at http://docs.racket-lang.org/ts-reference/Typed_Units.html?q=typed%20units I'm not sure how helpful it would be, basically only the `define-signature` form differs in racket and typed/racket, and the typed version of the other unit syntactic forms are mostly a subset of their untyped versions. I'm sorry that this probably doesn't help you solve your original problem, I hope we can eventually improve the support for units in Typed Racket to better match the features of ML modules. Dan On Tue, Nov 28, 2017 at 9:09 AM, Matthias Felleisen <matth...@ccs.neu.edu> wrote: > > > On Nov 28, 2017, at 10:02 AM, Richard Cobbe <rco...@pobox.com> wrote: > > > > On Tue, Nov 28, 2017 at 09:43:54AM -0500, Matthias Felleisen wrote: > >> > >> I have forwarded your email to Daniel Felty who designed and > implemented the typed units. I am hoping to get a response soon — Matthias > > > > Great, thanks. > > > >>> On Nov 26, 2017, at 6:11 PM, Richard Cobbe <rco...@pobox.com> wrote: > > > > <SNIP> > > > >>> I'm starting to think that my base assumption (that Typed Units are > more or > >>> less equivalent to ML signatures, structures, and functors) is way off. > > > > Probably worth clarifying this: I'm not claiming that Typed Units *have* > to > > work like ML functors, merely that this is my starting assumption, since > > they both appear to be designed to address many of the same problems. If > > they don't work like that, though, then I might need some additional > > documentation. > > > Yes. Units are not functors. > > I believe Daniel has written some documentation. Perhaps he can point us > there. > > > -- > You received this message because you are subscribed to the Google Groups > "Racket Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to racket-users+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.