title: Splitting up Yesod's Foundation.hs into different modules
body: <p>Starting out with the scaffolded Yesod app, Foundation.hs has quite a lot going on.  As my app has grown, I have been trying to split some functionality out into different modules.  For example, the <code>defaultLayout</code> definition, and the related definition of <code>MenuItem</code> types, looks like something that would be better off moved to a separate module.  However, my attempts to do so have been thwarted.</p>
  
  <p>To define menu items as part of the <code>defaultLayout</code> requires importing Foundation to get the route data constructors (ie <code>StaticR</code>, <code>AuthR</code> and my own routes defined in <code>config/routes</code>), and importing Application to get the Yesod instances for the <code>App</code> type.  But Foundation would need to import this module to define <code>defaultLayout</code>!</p>
  
  <p>Is it possible to move this stuff into a separate module?  How do people avoid massive monolithic Foundations?</p>