Slide 173
Slide 173 text
// Lightning strikes! It's alive!
let liveBody, remainingFromBody = runM bodyM vf
// val liveBody : LiveBody =
// {leftLeg = LiveLeftLeg ("Boris",{units = 1})
// rightLeg = LiveLeftLeg ("Boris",{units = 1})
// leftArm = LiveLeftArm ("Victor",{units = 1})
// rightArm = {lowerArm = LiveRightLowerArm
// ("Tom",{units = 1})
// upperArm = LiveRightUpperArm
// ("Jerry",{units = 1}) }
// head = {brain = LiveBrain
// ("Abby Normal",{units = 1})
// emptyHead = EmptyHead "Yorick"}
// heart = BeatingHeart (
// LiveHeart ("Anne",{units = 1}),
// {units = 1})}
// val remainingFromBody : VitalForce = {units = 2}
Demo: Whole body
The state is automatically kept up-to-date