sml - How to have more than one type in ML? -


is possible in ml allow variable in ml have more 1 type?

for instance, if want node in tree int or string.

node of int * string 

i tried results in tuple type of (int, string). don't want tuple, either int or string. allowed?

as pointed out in comment, feature you're looking union types. believe syntax them in sml is:

datatype node = intnode of int               | stringnode of string 

Comments

Popular posts from this blog

php - How to display all orders for a single product showing the most recent first? Woocommerce -

asp.net - How to correctly use QUERY_STRING in ISAPI rewrite? -

angularjs - How restrict admin panel using in backend laravel and admin panel on angular? -