
Is there any way to express a HashTable in typed/racket like: #hash((a . 1)(b . "b")(c . #(1 2 3)))
with any greater specificity than (HashTable Symbol (U Integer String (Vectorof Real)))
Because this type would be correct and more precise (HashTable 'a Integer 'b String 'c (Vectorof Real))

I don’t know of a way to do this. But, at this point, wouldn’t you be better off with a structure?

yes - I’m using structs at the moment, but hashes feel nicer to deal with functionally as you can use symbols as function arguments (I come from a Clojure background)

In terms of types - structs definitely have what I am looking for, but it can get a bit clunky having struct accessors everywhere. May just need to write a syntax wrapper

I see what you mean, but unfortunately I don’t have an answer for you. Except to say that at first I didn’t like structure accessors either, but I’m starting to appreciate them. Maybe you can give them a try. And good luck :+1:

ok - np thanks for getting back to me. Hopefully I’ll get used to the structs, syntax wrapping does feels rackety though