How to use $, possibly in a village

In Yesod, I have a form that populates a type

data Field = Field Text Text text deriving Show 

When I write hmml hamml to display it, I run into the problem that the field is completed in Maybe Maybe Field . So in the tree I am trying to do the following as shown here

(snippet in postHomeR function)

 let fieldData = case result of FormSuccess res -> Just res _ -> Nothing 

(In the tree)

 <ul> $maybe (Field one two three) <- fieldData <li>#{show one} 

However, when compiling, there is a Not in scope: one error. Why is the variable not created / filled out correctly?

+4
source share
1 answer

You need to defer <li> so that it is inside the $ maybe block. Since he is sitting now, he is native to $, perhaps, and therefore the variables associated with $ may not be in the field.

+3
source

All Articles