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 trait

[racket-users] Typed racket and generics?

2021-01-30 Thread Stuart Hungerford
Hi Racketeers, Is there any way to have Racket code using `define-generics` interact with typed Racket code? (I think the answer is "no", but I thought I'd check for sure). Thanks, Stu -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To uns

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

2021-01-24 Thread Stuart Hungerford
On Mon, Jan 25, 2021 at 6:52 AM Jens Axel Søgaard wrote: That's a very interesting project. You are so to speak optimizing for > readability. > I immediately get a vision of a SICM-like book, but for algebra instead of > classical mechanics. > > Racket will be a good choice, since macros give you

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

2021-01-21 Thread Stuart Hungerford
On Fri, Jan 22, 2021 at 12:56 AM Hendrik Boom wrote: > [...] > > You might also want to look at the implementations of category theory in Agda. > Agda is a language which unifies execution and correctness proof to some > extent. > > Not that you want to implement catagory theory, but category the

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

2021-01-20 Thread Stuart Hungerford
On Thursday, 21 January 2021 at 14:49:19 UTC+11 Siddhartha Kasivajhula wrote: Depending on what you're trying to accomplish, you may find the > relation/composition > module > (which I authored) to be of interest. It doesn't mod

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

2021-01-20 Thread Stuart Hungerford
On Thursday, 21 January 2021 at 10:22:45 UTC+11 Jens Axel Søgaard wrote: Den ons. 20. jan. 2021 kl. 08.43 skrev Stuart Hungerford < > stuart.h...@gmail.com>: > >> On Wednesday, 20 January 2021 at 12:34:59 UTC+11 Robby Findler wrote: >> >> I'm no expert on algeb

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

2021-01-19 Thread Stuart Hungerford
On Wednesday, 20 January 2021 at 12:34:59 UTC+11 Robby Findler wrote: I'm no expert on algebras, but I think the way to work on this is not to > think "what Racket constructs are close that I might coopt to express what > I want?" but instead to think "what do I want my programs to look like" an

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

2021-01-19 Thread Stuart Hungerford
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 philosoph

[racket-users] Interaction of Typed Racket with define/match?

2017-11-13 Thread Stuart Hungerford
Hi, I'm trying to create a Typed Racket function that compares to 2-vectors of integers with an optional error term that defaults to 1: #lang typed/racket (define-type Reading (Vector Integer Integer)) (: close? (->* (Reading Reading) (Integer) Boolean)) (define/match (close? r1 r2 [err 1])

[racket-users] Idiomatic Racket approach for handling collisions in library provides?

2017-11-08 Thread Stuart Hungerford
Hi, A newbie question about idiomatic Racket code: Suppose I wanted to create several numeric modules that all had their own interpretation of what addition means. If each of them uses a (provide ... + ...) form, the various "+" exports are going to collide in client modules that (require ..

Re: [racket-users] Typed racket equivalent of Haskell newtype?

2015-05-24 Thread Stuart Hungerford
On Monday, 25 May 2015 02:43:58 UTC+10, Alex Knauth wrote: > Also opaque types might help you: > http://docs.racket-lang.org/ts-reference/special-forms.html#%28form._%28%28lib._typed-racket%2Fbase-env%2Fprims..rkt%29._require%2Ftyped%29%29 > http://docs.racket-lang.org/ts-reference/type-ref.html#

Re: [racket-users] Typed racket equivalent of Haskell newtype?

2015-05-23 Thread Stuart Hungerford
On Sunday, 24 May 2015 12:50:48 UTC+10, Matthias Felleisen wrote: > Stuart, would a predicated refinement type work for you: > > -- > http://docs.racket-lang.org/ts-reference/special-forms.html?q=define-predicate#%28form._%28%28lib._typed-racket%2Fbase-env%2Fprims..rkt%29._make-predicate%29%29

Re: [racket-users] Typed racket equivalent of Haskell newtype?

2015-05-23 Thread Stuart Hungerford
On Sunday, 24 May 2015 08:14:30 UTC+10, Alex Knauth wrote: > As far as I know, this doesn’t exist in typed racket currently, but I’m > wondering: (I’m thinking of seeing if I can implement this when I have time > this summer) > > How should sub-typing interact with this? > Should it be a comp

[racket-users] Typed racket equivalent of Haskell newtype?

2015-05-23 Thread Stuart Hungerford
Hi, Is there an idiomatic Typed Racket equivalent to the Haskell concept of newtypes? https://www.haskell.org/tutorial/moretypes.html That is, some way to have separate types that share a common structure? For example I'd like to define "Radians" and "Degrees" types that are both implemented

[racket-users] Tunable flonum comparison using math library

2015-05-19 Thread Stuart Hungerford
Hi, I've been trying out Racket for 2D graphics tasks and have come across the Racket math library. Firstly just wanted to say a big thank you to the developers for such a well thought out and documented library. I've had problems in the past with floating point comparison, especially around