<div dir="ltr"><br><br><div class="gmail_quote">On Sun, Sep 9, 2012 at 5:48 PM, Arthur Clemens <span dir="ltr"><<a href="mailto:arthurclemens@gmail.com" target="_blank">arthurclemens@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word"><div><div class="im"><blockquote type="cite"><div>You'll need the AdminR constructor: AdminR AdminRootR.</div></blockquote><div><br></div></div><div>It doesn't work in the scaffolded site, whereas it works as expected in a single file site like <a href="https://github.com/yesodweb/yesod/wiki/Hierarchical-routes-and-breadcrumbs" target="_blank">https://github.com/yesodweb/yesod/wiki/Hierarchical-routes-and-breadcrumbs</a></div>
<div><br></div><div>I created a new scaffolded site, used add-handler to create Handler/Admin.hs, and changed the route in config/routes to</div><div><div class="im"><div><br></div><div><font face="'Courier New'">/admin AdminR:</font></div>
<div><font face="'Courier New'"> / AdminRootR GET</font></div><div><br></div></div><div><font face="'Courier New'">yesod devel</font> results in <font face="'Courier New'">Application.hs:27:1: Not in scope: data constructor `AdminRootR'</font></div>
<div><br></div><div>changing that to</div><div><br></div><div><div><font face="'Courier New'">/admin AdminRootR GET</font></div><div><br></div><div>runs without errors.</div><div><br></div></div></div><div class="im">
<br></div></div></div></blockquote><div><br></div><div>Just to confirm: does your `cabal` file state Yesod version 1.0 or 1.1?</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word"><div><div class="im"><blockquote type="cite"><div> If you use<br>-ddump-splices when compiling, GHC will spit out the generated<br>code/data types, which should give a good idea of what's going on<br>
under the surface.</div></blockquote><br></div></div><div>I can't, it results in </div><div><br></div><div><font face="'Courier New'">Import.hs:10:2: lexical error at character 'i'</font></div><div><br>
</div><div>Using <font face="'Courier New'">ghc -cpp -ddump-splices main.hs </font></div><div><br></div>results in <font face="'Courier New'">Model.hs:13:1: Parse error: naked expression at top level</font><span class="HOEnZb"><font color="#888888"><br>
<div><br></div><div>Arthur</div><div><br></div></font></span></div></blockquote></div><br><div>Sorry, I should have clarified: you can do something like:</div><div><br></div><div> cabal configure --ghc-option=-ddump-splices</div>
<div><br></div><div>Then `cabal build` will pass in that option. You get the "naked expression" error because TemplateHaskell isn't enabled.</div><div><br></div><div>Michael</div></div>