<div dir="ltr"><br><br><div class="gmail_quote">On Sun, Sep 9, 2012 at 5:48 PM, Arthur Clemens <span dir="ltr">&lt;<a href="mailto:arthurclemens@gmail.com" target="_blank">arthurclemens@gmail.com</a>&gt;</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&#39;ll need the AdminR constructor: AdminR AdminRootR.</div></blockquote><div><br></div></div><div>It doesn&#39;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="&#39;Courier New&#39;">/admin AdminR:</font></div>

<div><font face="&#39;Courier New&#39;">    / AdminRootR GET</font></div><div><br></div></div><div><font face="&#39;Courier New&#39;">yesod devel</font> results in <font face="&#39;Courier New&#39;">Application.hs:27:1: Not in scope: data constructor `AdminRootR&#39;</font></div>

<div><br></div><div>changing that to</div><div><br></div><div><div><font face="&#39;Courier New&#39;">/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&#39;s going on<br>

under the surface.</div></blockquote><br></div></div><div>I can&#39;t, it results in </div><div><br></div><div><font face="&#39;Courier New&#39;">Import.hs:10:2: lexical error at character &#39;i&#39;</font></div><div><br>

</div><div>Using <font face="&#39;Courier New&#39;">ghc -cpp -ddump-splices main.hs </font></div><div><br></div>results in <font face="&#39;Courier New&#39;">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 &quot;naked expression&quot; error because TemplateHaskell isn&#39;t enabled.</div><div><br></div><div>Michael</div></div>