[web-devel] [ Newbie ] Problem with Route type

Michael Snoyman michael at snoyman.com
Thu Jun 30 14:42:39 CEST 2011


You might want to try adding explicit type signatures to adminLayout.
If that doesn't work, mind pasting in the contents of the relevant
Hamlet files?

On Wed, Jun 29, 2011 at 12:54 PM, Kamil Ciemniewski
<ciemniewski.kamil at gmail.com> wrote:
> Hi all,
>
> I've got another newbie problem.
>
> Compiler yells at me:
> Handler/Admin.hs:15:3:
>     Couldn't match type `Route master0' with `MyAppRoute'
>     In the expression: adminLayout
>     In the expression:
>         adminLayout
>       $ do { h2id <- lift newIdent;
>              addWidget ($(widgetFile "admin/overview/index")) }
>     In the expression:
>       do { adminLayout
>          $ do { h2id <- lift newIdent;
>                 addWidget ($(widgetFile "admin/overview/index")) } }
>
> The adminLayout is defined as:
> adminLayout widget = do
>         mmsg <- getMessage
>     pc <- widgetToPageContent $ do
>         widget
>     hamletToRepHtml $(Settings.hamletFile "admin/admin-layout")
>
> And data types are defined as:
> data MyApp = MyApp
>     { getStatic :: Static -- ^ Settings for static file serving.
>     }
> type Handler = GHandler MyApp MyApp
> type Widget = GWidget MyApp MyApp
> mkYesodData "MyApp" $(parseRoutesFile "config/routes")
>
> routes are:
> /static StaticR Static getStatic
>
> /favicon.ico FaviconR GET
> /robots.txt RobotsR GET
>
> / RootR GET
>
> /admin AdminR GET
>
> It's probably a silly mistake somewhere but, well.. I'm a newbie.
>
> Best regards
> Kamil Ciemniewski
>
> _______________________________________________
> web-devel mailing list
> web-devel at haskell.org
> http://www.haskell.org/mailman/listinfo/web-devel
>
>



More information about the web-devel mailing list