Alexis King
2015-03-15 00:39:48 UTC
Iâve had the 2htdp-typed package <https://github.com/lexi-lambda/racket-2htdp-typed> available for a little while now, which is a Typed Racket wrapper for the HtDP/2e teachpacks. It was missing big-bang, since it is implemented as a macro, but I have now added support for big-bang in Typed Racket.
The syntax of big-bang is identical to its untyped equivalent except for one thing: it requires an annotation that specifies what the type of the WorldState parameter should be. The exact syntax for big-bang is provided in the documentation.
There are still a couple of unsupported features:
The universe/networked worlds (âThe World is Not Enoughâ) are not supported. This actually shouldnât be terribly difficult to add, I just have absolutely no experience working with universe programs, so I havenât tried.
The 2htdp/planetcute collection of sprites is not yet available in Typed Racket. This also shouldnât be terribly difficult to add, but my first attempt ran into some complexities in how the identifiers are provided that I did not anticipate, and I havenât taken the time to look into it since. (See https://github.com/racket/htdp/issues/2 <https://github.com/racket/htdp/issues/2> for some limited information about that.)
Otherwise, I think everything should work just fine. I donât have many programs that use these libraries sitting around, but Iâd love to know if this wrapper works with existing world/universe programs.
Feedback and bug reports much appreciated, pull requests welcome!
Alexis King
The syntax of big-bang is identical to its untyped equivalent except for one thing: it requires an annotation that specifies what the type of the WorldState parameter should be. The exact syntax for big-bang is provided in the documentation.
There are still a couple of unsupported features:
The universe/networked worlds (âThe World is Not Enoughâ) are not supported. This actually shouldnât be terribly difficult to add, I just have absolutely no experience working with universe programs, so I havenât tried.
The 2htdp/planetcute collection of sprites is not yet available in Typed Racket. This also shouldnât be terribly difficult to add, but my first attempt ran into some complexities in how the identifiers are provided that I did not anticipate, and I havenât taken the time to look into it since. (See https://github.com/racket/htdp/issues/2 <https://github.com/racket/htdp/issues/2> for some limited information about that.)
Otherwise, I think everything should work just fine. I donât have many programs that use these libraries sitting around, but Iâd love to know if this wrapper works with existing world/universe programs.
Feedback and bug reports much appreciated, pull requests welcome!
Alexis King