我正在将 D3 可视化从 Javascript 转换为 Purescript,并且在尝试将选择保存在 do 块中时出现语法错误。
这是代码:
enterCountry country = do
sel <- select "g.root"
.. selectAll "g.country"
.. data (\c -> c.name)
.. enter
.. append "g" .. attr "class" "country"
sel .. append "title" .. text (\c -> c.name)
这是错误:
unexpected LArrow
expecting no indentation or end of input
See https://github.com/purescript/purescript/wiki/Error-Code-ErrorParsingModule for more information, or to contribute content related to this error.
错误指向以开头的行sel <- ...