I am currently in the process of rewriting an HTML file in Lucid for use with a Spock web server. However, for some reason this particular snippet gives me an error:
sidebar :: Html ()
sidebar = do
nav_ [id_ "sidebar"] $ do
div [class_ "sidebar-header"] $
h3_ "Sidebar"
div [class_ "list-group"] $ do
a_ [href_ "#", class_ "menuItem list-group-item rounded-0"] "Item 1"
a_ [href_ "#", class_ "menuItem list-group-item rounded-0"] "Item 2"
Namely, the error is:
Couldn't match type `[Attribute]'
with `HtmlT Data.Functor.Identity.Identity ()'
arising from a use of `nav_'
I noticed that removing the div and just having the h3
fixes the problem, but that is not what I want. I did some googling to try to find the issue, but from what I could see the library does not have that many examples online that I could try to look at. Stackoverflow and Reddit searches did not reveal anything either.
This is my first actual project where I have used Lucid, so it is entirely possible that there is an obvious blunder somewhere.