[racket-users] Re: Looking for idiomatic way to represent very similar but different data types

2021-01-31 Thread jackh...@gmail.com
I'd suggest just going with the structs and making them transparent. It's only three structs and only with a handful of fields, abstracting over them with map and fold doesn't seem worth the added complexity IMO. But if you'd really like to map and fold over structs, I highly recommend using

[racket-users] Looking for idiomatic way to represent very similar but different data types

2021-01-31 Thread making-a-racket
Hello. I have a project where I am needing to represent vectors (in the mathematical sense), points, and colors. Both the vectors and points will be 3D. I'm having trouble knowing what's an idiomatic way to represent and interact with data types that are similar but different. In general, I

Re: [racket-users] Moving a Rust/Haskell abstract algebra library to Racket?

2021-01-31 Thread Stuart Hungerford
On Sunday, 31 January 2021 at 08:07:27 UTC+11 Jens Axel Søgaard wrote: Den tor. 21. jan. 2021 kl. 05.06 skrev Stuart Hungerford < > stuart.h...@gmail.com>: > >> [...] >> By using the Rust trait system (and later Haskell typeclasses) I could >> create structure traits/typeclasses that don't clash