atype r = {A : int; B : string; C : int; D : string}
と a の値があるとします。
let aOptional : int option = ...
let bOptional : string option = ...
let cOptional : int option = ...
let dOptional : string option = ...
それらからどのようr optional
にエレガントに構築できますか(ネストされたケースなどなしで)?
ところで、haskellでControl.Applicative
次のように実行する方法は次のとおりです。
data R = R { a :: Integer, b :: String, c :: Integer, d :: String}
R <$> aOptional <*> bOptional <*> cOptional <*> dOptional :: Maybe R
fsharp で同等のものを探しています。