Haskell: Yesod and state
问题 I was reading through the code for a Toy URL Shortener. However, there's significant parts I just can't get my head around. It has the following code: data URLShort = URLShort { state :: AcidState URLStore } For testing purposes, I wrote something like this in my own app: data MyApp = MyApp { state :: Int } I could then compile by changing main = warpDebug 3000 MyApp to main = warpDebug 3000 (MyApp 42) And I could then do reads of the state in handlers by doing mystate <- fmap state getYesod