I am trying to figure out how to design a type for trees in F# and was looking at this thread for some help Tree Representation in F#.
In it, they define:
type Tree =
| Branch of string * Tree list
| Leaf of string
I am not sure what the * operator between string and Tree is supposed to do. I have been seeing it all over the place, but don't know what to search to find the answer.
Thanks!
This is the Tuple type name, from Microsoft Documentation
Names of Tuple Types
When you write out the name of a type that is a tuple, you use the * symbol to separate elements. For a tuple that consists of an int, a float, and a string, such as (10, 10.0, "ten"), the type would be written as follows.
int * float * string
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With