getting ''a type instead of 'a in sml

60 views Asked by At

I've written a hash-table for an sml assignment. I've made a polymorphic builder for the hashtable but when I use the insert function I created, I get a comparable type (''a instead of 'a) although i'm not making any comparisons that include the type. Does anyone maybe has an idea why? I'm sorry if my code is a bit messy i've highlighted the important parts, the rest are just helper functions.

code and signature enter image description here

1

There are 1 answers

0
Shalev rissin On BEST ANSWER

the solution is using a switch case instead of "if" comparisons, that way the compiler can get mixed up and assume a type needs to be comparable although it does not.