My problem is that I'm trying to make my own datatype, but I can not use ints in the naming convention of the items that are appart of the datatype
datatype psu = 350w | 450w | 550w | ... etc;
error thrown:
stdIn:16.15-16.30 Error: syntax error: deleting STRING BAR STRING
Is there some way I can convert these numbers into a string that would be acceptable for the sml interpreter? I really don't want to name my variable "three hundred and fifty watts" or anything.
I tried looking up a toString and just making the variables explicitly strings, but I could not find a helpful toString and making the variables strings just threw another error
datatype psu = W350 | W450 | W550 | ..., ordatatype psu = Watts of int? What does this type represent and how are you going to use it?datatype psu = "350w" | "450w" | .... I think you've been so focused on strings that you're becoming stuck in them as a solution, but they rarely are.datatype psu = W350 | W450 | W550 | ...