AusCoder
6/25/2017 - 11:39 AM

Wai

statefulApp' :: MVar Int -> Application
statefulApp' countRef _ respond = do
  newCount <- modifyMVar countRef $ \count -> return (count, count + 1)
  let msg = byteString "You are visitor number: " <> intDec newCount
  respond $ responseBuilder status200 textHeader msg