57 execAction :: State Monopoly () 58 execAction = do 59 m <- get 60 let b = board m 61 let s = CL.value b 62 case s of 63 (CC _) -> execCommunityChest 64 (CH _) -> execChance 65 G2J -> execMove gotoJail 66 _ -> do 67 let v = insertWith (+) s 1 (visit m) 68 put m {visit = v} ...
80 let c = cc m 81 c' <- execCard c 82 put m {cc = c'} 83 84 execCard :: CardsDeck -> State Monopoly CardsDeck 85 execCard cd = do 86 let cd' = CL.next cd 87 case CL.value cd of 88 Just mv -> do 89 execMove mv 90 return cd' 91 Nothing -> do 92 m <- get 93 let s = CL.value $ board m 94 let v = insertWith (+) s 1 (visit m) 95 put m {visit = v} 96 return cd'I tried to play with some $! to force execution but it never goes deep enough and I don't really know where to place these. I did not copy the whole solution as requested on the Project Euler site.