所以,我想构建一个自定义计算表达式,让我可以把它变成 -
testWorld |>
subscribe ClickTestButtonAddress [] addBoxes |>
addScreen testScreen TestScreenAddress |>
setP (Some TestScreenAddress) World.optActiveScreenAddress |>
addGroup testGroup TestGroupAddress |>
addEntityGuiLabel (testLabelGuiEntity, testLabelGui, testLabel) TestLabelAddress |>
addEntityGuiButton (testButtonGuiEntity, testButtonGui, testButton) TestButtonAddress |>
addEntityActorBlock (testFloorActorEntity, testFloorActor, testFloor) TestFloorAddress |>
(let hintRenderingPackageUse = HintRenderingPackageUse { FileName = "AssetGraph.xml"; PackageName = "Misc"; HRPU = () }
fun world -> { world with RenderMessages = hintRenderingPackageUse :: world.RenderMessages }) |>
(let hintAudioPackageUse = HintAudioPackageUse { FileName = "AssetGraph.xml"; PackageName = "Misc"; HAPU = () }
fun world -> { world with AudioMessages = hintAudioPackageUse :: world.AudioMessages })
变成这样的东西 -
fwd {
do! subscribe ClickTestButtonAddress [] addBoxes
do! addScreen testScreen TestScreenAddress
do! setP (Some TestScreenAddress) World.optActiveScreenAddress
do! addGroup testGroup TestGroupAddress
do! addEntityGuiLabel (testLabelGuiEntity, testLabelGui, testLabel) TestLabelAddress
do! addEntityGuiButton (testButtonGuiEntity, testButtonGui, testButton) TestButtonAddress
do! addEntityActorBlock (testFloorActorEntity, testFloorActor, testFloor) TestFloorAddress
let hintRenderingPackageUse = HintRenderingPackageUse { FileName = "AssetGraph.xml"; PackageName = "Misc"; HRPU = () }
do! fun world -> { world with RenderMessages = hintRenderingPackageUse :: world.RenderMessages }
let hintAudioPackageUse = HintAudioPackageUse { FileName = "AssetGraph.xml"; PackageName = "Misc"; HAPU = () }
do! fun world -> { world with AudioMessages = hintAudioPackageUse :: world.AudioMessages }}
<| runFwd testWorld
这是可能的,还是接近可能的?如果是这样,可以采取什么方法?这是一个单子,还是更小的东西?