This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
Hi, I have been having issues with polymorphic functions when using
partial. I finally got it to pass but I don’t know what 3rd, 4th and 5th parameters are for.
Apart from that, is there a better way to describe the types in this case?
(t/ann zipmap-test [(t/Vec t/Kw) -> (t/Map t/Kw t/Str)]) (defn zipmap-test [column-names] (let [partialt (t/inst partial (t/Map t/Kw t/Str) (t/Vec t/Kw) t/Any t/Any t/Any (t/Vec t/Str))] ((partialt zipmap column-names) ["a" "b" "c" "d"])))
@ambrosebs using inst in zipmap actually worked! I tried that first but I actually sent (t/Vec t/Kw) (t/Vec (t/Str) as arguments, and though that the problem must be in partial.