Haskell 漂亮的打印哈姆雷特输出?
Im使用以下模板构建一些XML:Haskell 漂亮的打印哈姆雷特输出?,haskell,yesod,Haskell,Yesod,Im使用以下模板构建一些XML: xml nw config = renderHtml [shamlet| <nw version="#{version config}" nr="#{nw}"> <compatibleHardwares> $forall hw <- hws <compatibleHardware> #{hw} |] where hws = (co
xml nw config = renderHtml [shamlet|
<nw version="#{version config}" nr="#{nw}">
<compatibleHardwares>
$forall hw <- hws
<compatibleHardware>
#{hw}
|]
where
hws = (compatiblehardware config)
xml nw config=renderHtml[shamlet|
$forall hw您的意思是,作为实际的哈姆雷特代码,还是作为正确缩进的html?作为正确缩进的html。我要睡觉了,所以没有完整的答案,但它看起来允许为可读性在输出中添加新行。
<nw version="1.0" nr="NW011"><compatibleHardwares><compatibleHardware>X4578</compatibleHardware>
</compatibleHardwares>
</nw>