Hi Racketeers, I'd like to try re-implementing a library for experimenting with abstract algebraic structures in Racket (that is groups, fields, rings etc, not algebraic data types like sum or product types). With Racket's strong numeric hierarchy and programmable programming language philosophy it seems like a good environment for experimenting with mathematical structures.
This library was originally developed in Rust and more recently Haskell and made heavy use of Rust traits and Haskell typeclasses to implement these structures for the builtin numeric types as a well as my own derived numeric types (e.g. finite fields). I understand Racket is not Haskell (or Rust) and naively trying to emulate typeclasses or traits in Racket will likely lead to un-idiomatic code. Having said that, what Racket idioms would be most useful for this kind of project? A typical typeclass (from the Haskell version) would be: ``` class Monoid a => Group a where inverse :: a -> a power :: Int -> a -> a ``` Thanks, Stu -- 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. To view this discussion on the web visit https://groups.google.com/d/msgid/racket-users/a1ce47b2-9dab-4b33-b50b-557bfef7e331n%40googlegroups.com.