1

我重新安装了 yesod(cabal install yesod)并尝试了使用自定义字段的页面http://www.yesodweb.com/book/forms上的表单示例。编译器在数据构造函数和不在范围内的函数上给出错误。

有关代码和错误列表,请参见http://hpaste.org/49690。这是如何解决的?

从脚手架项目运行时,我得到了同样的错误......

4

1 回答 1

4

这些似乎是示例中的错误,由缺少import语句引起。

您需要导入这些模块:

  • Control.Monadmplus.
  • Data.MaybefromMaybe.
  • Safe对于readMay(来自安全包)。
  • Yesod.Form.CorefornewFormIdent和构造函数askParamsGForm

修复后,出现另一个错误:

FormSuccess (Params min max single plural)

应该

FormSuccess (Params (min, max) single plural)

我让它在 Yesod 0.8.2.1 上运行这些更改(使用 yesod-form-0.1.0.1)

于 2011-07-30T18:44:50.903 回答