jaspervdj/blaze-html — Issue #54: Strange error messages with strings in 'do' blocks
Author: aslatter
Created: 2012-01-16 16:14:38+00:00
State: open

The code

~~~~
myPage :: Html
myPage = do {"Hello wordl!"; span otherHtml}
~~~~

will give me an error about unused results of monadic binds, suggesting I write:

~~~~
myPage :: Html
myPage = do {_ <- "Hello wordl!"; span otherHtml}
~~~~

A couple ideas for fixing this:

* Change the 'IsString' instance to 'HtmlM ()' instead of 'HtmlM a'. This causes problems for some reason - I'll look into it again.
* Add a functor instance for 'HtmlM', so I can use 'void' from base.