I'm learning F#, starting with baby steps. Is there a way to write this code in a more succint way, while keeping the same semantics? Maybe by using a Seq
or something like that?
let rec repeatingPrompt predicate (message:string) =
Console.WriteLine(message)
let value = Console.ReadLine()
if predicate value then
value
else
repeatingPrompt predicate message