F#にHaskellのwhere
句のようなものがあるかどうか疑問に思っていました。これは、それが後で(つべこべ第一及び実装の詳細機能の中核部分を示しているように(IMO)やや可読バージョンF#にはHaskellのwhere節のようなものがありますか?
let roulleteWheel numberGenerator (scoredPopulation:ScoredPopulation) =
Seq.pick isMatch (Seq.zip scoredPopulation accumulatedScores)
where
let targetScore =
let totalScore = totalPopulationFitness scoredPopulation
Seq.head (numberGenerator 0.0 totalScore)
let isMatch (score, accumulatedScore) =
if (accumulatedScore >= targetScore) then
Some(score)
else
None
let accumulatedScores =
let scores = Seq.map (fun (_, score) -> score) scoredPopulation
Seq.skip 1 (Seq.scan (+) 0.0 scores)
に次のコード
let roulleteWheel numberGenerator (scoredPopulation:ScoredPopulation) =
let targetScore =
let totalScore = totalPopulationFitness scoredPopulation
Seq.head (numberGenerator 0.0 totalScore)
let isMatch (score, accumulatedScore) =
if (accumulatedScore >= targetScore) then
Some(score)
else
None
let accumulatedScores =
let scores = Seq.map (fun (_, score) -> score) scoredPopulation
Seq.skip 1 (Seq.scan (+) 0.0 scores)
Seq.pick isMatch (Seq.zip scoredPopulation accumulatedScores)
を形質転換するために可能にしますみなす!)。
私の推測では、F#がコードファイルを解析する方法では不可能だと思います。私は正しい? F#のキーワードの参照は、私が探しているようなものではないようです。それが存在しない場合は、表示されているコードをさらに除外する他の方法はありますか?私はそれがそのまま大丈夫だと言うでしょうが、あなたは決して知りません。