Created
December 8, 2015 00:19
-
-
Save markprovan/ecb90c1c7782101fa2db to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
update : Action -> Model -> Model | |
update action model = | |
case action of | |
Toggle seatToToggle -> | |
let | |
updateSeat seatFromModel = | |
if seatFromModel.seatNo == seatToToggle.seatNo then | |
-- Not working, compiler expects `=` | |
{ seatFromModel | occupied <- not seatFromModel.occupied } | |
-- Works | |
{ seatFromModel | occupied = not seatFromModel.occupied } | |
else seatFromModel | |
in | |
List.map updateSeat model |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment