Does writing F # support circular reference A & # 8594; B & # 8594; A?

I want to use F # notation, write Race and Runner, where the Race links Runner and Runner refer to Race. Is this possible with Records, as is the case with regular classes?

type Race = { raceIdentifier : int carriedWeightMean : decimal prizeMoneyPercentileCountry : int64 noOfHorses : int runners : Runner list } type Runner = { horseId : int finishPositionSequence : int64 lbw : decimal horseNumberOfRaces : int mutable race : Race } 

I tried using the keyword "c", but this does not seem to work:

 type Race = { raceIdentifier : int carriedWeightMean : decimal prizeMoneyPercentileCountry : int64 noOfHorses : int race : Race } with Runner = { horseId : int finishPositionSequence : int64 lbw : decimal horseNumberOfRaces : int race : Race } 
+4
source share
1 answer

You want "and", not "s" ...

+7
source

Source: https://habr.com/ru/post/1334621/


All Articles