This does not mean that F # does not allow you to return null.
This is because then the part and the other part are of different types.
You can use the parameter type .
let retVal = if reader.Read() then Some (reader.GetString(0), getBytesData reader 1, reader.GetDateTime(2)) else None
when you use retVal , you use pattern matching:
match retVal with | Some v -> ... | None -> // null case
source share