A friend and I read on F # and are currently messing with the records.
We made the following entry to represent the person:
type Person = {name: string; father: Person; mother: Person;}
F # Interactive accepts it, and in some way the type makes sense, except that we cannot see how to use it. When we try to declare a person, we must declare the parents at the time of the announcement and, in turn, declare the parents and so on. Is there any way to use this type? And if not, then why can we even create it?
PS: We well know that since parents must be optional, we had to encapsulate them using the (Some x | None) option.
EDIT
My question is not how to fix this, the solution is already written in PS. My question is: can I use the above type for example? declare the person of the above form? If not, I should have made an unsuitable type. Why can I make this type?
source share