I am going through "Programming Languages" in coursera. I am having a hard time to understand what "datatype bindings" are.
https://www.coursera.org/lecture/programming-languages/datatype-bindings-vysQv
Are datatype bindings similar to type alias(in Golang)?
In SML this is the example given to explain datatype bindings.
datatype mytype = TwoInts of int * int
| Str of string
| Pizza
Here, from what I understand mytype
is a new custom defined datatype.
It consists of two sub-parts, one of which is TwoInts
of type int*int
and another part Str
of type string
.
I do not understand what Pizza
is.
I tried googling about datatype
bindings. While I could find many interesting articles on databindings
couldn't find useful articles on datatype bindings
.
I understand Golang and Ruby pretty well. So, any explain with examples from these languages if possible would be even more helpful.
Thanks