rackcheck icon indicating copy to clipboard operation
rackcheck copied to clipboard

Typing

Open Lazerbeak12345 opened this issue 2 years ago • 6 comments
trafficstars

I was thinking about adding typed/racket support to this library. There's a lot of ways to do this. Here's some ways that look simple enough to me.

  • We could make a new dir within rackcheck-lib called typed and re-export everything from rackcheck.
  • The same, but within a new lib rackcheck-typed

Alternatively (or even in parallel?), one could gradually type the library and get it to work that way.

What do you think?

Lazerbeak12345 avatar Jan 25 '23 21:01 Lazerbeak12345

I think that would be great. Adding a rackcheck-typed package to this repository would be the way to go. That way, rackcheck-lib won't have to depend on typed-racket for the folks that don't use typed racket.

Bogdanp avatar Jan 26 '23 06:01 Bogdanp

Ok, so I started work on this then discovered that since part of the public api relies on racket/stream (which has not yet been typed) that library will have to be typed first. https://github.com/racket/typed-racket/issues/970

Lazerbeak12345 avatar Jan 26 '23 19:01 Lazerbeak12345

I've started work on typing that upstream thing. Feel free to leave feedback lol.

Lazerbeak12345 avatar Jan 28 '23 05:01 Lazerbeak12345

Me and several other discord users talked about this in the racket discord. https://discord.com/channels/571040468092321801/993032505127088209/1070776863900844102

I'll just use the Sequenceof type in place of Streamof for now.

Lazerbeak12345 avatar Feb 02 '23 19:02 Lazerbeak12345

I've determined that this typed api might not be very useful, due to severe limitations of typed/racket.

Without looking at tools outside of the core package (which may prove useful), it is impossible to add type parameters to structs defined in untyped racket (currently). There doesn't seem to be any plan to change this - and since your great API makes use of structs in the way it does, I would normally just parameterize the type.

I'll be taking a step back from this for now. Perhaps I'll come up with another approach.

Lazerbeak12345 avatar Feb 20 '23 00:02 Lazerbeak12345

No worries and thanks for trying! Sorry I couldn't be of more help, but I don't really use typed racket.

Bogdanp avatar Feb 20 '23 06:02 Bogdanp