So the first line states that safeInput
is a function which takes a Map option
a key
a value
and then returns a map option
. The fun
keyword is just a way of creating the function.
An equivalent function is
let safeInput (x:Map<'a,'b> option) (y:'a) (z:'b) :Map<'a,'b> option =
match x with
| Some d -> Some(d.Add(y,z))
| None -> Some([y,z]|>Map.ofList)