我正在尝试导入在Reflex FRP中使用的documentGetElementById函数。我尝试了下面的导入,但找不到函数(根据hackage应该在那里):
GHCi, version 8.0.1: http://www.haskell.org/ghc/ :? for help
[1 of 1] Compiling Main ( Test.hs, interpreted )
Ok, modules loaded: Main.
*Main> import Graphics.UI.Gtk.WebKit.DOM.Document
*Main Graphics.UI.Gtk.WebKit.DOM.Document> :t documentGetElementById
<interactive>:1:1: error:
Variable not in scope: documentGetElementById我将非常感谢你能帮助我解决这个问题。我在ghc 8.0.1上运行最新的Reflex平台构建,webkit现在可以在mac上运行。我在Linux上也看到了同样的问题。因此,它似乎不是特定于平台的。
我也在ghcjs-dom上做了github code search,但是documentGetElementById没有出现。所以,也许它已经被转移到其他地方了?
发布于 2016-08-23 21:32:48
经过ghcjs-dom重构后,documentGetElementById已重命名为getElementById。因此,如下所示的导入将会起作用:
*Main> import Graphics.UI.Gtk.WebKit.DOM.Document
*Main Graphics.UI.Gtk.WebKit.DOM.Document> :t getElementById
getElementById
:: (DocumentClass self, System.Glib.UTFString.GlibString string,
MonadIO m) =>
self -> string -> m (Maybe Graphics.UI.Gtk.WebKit.Types.Element)https://stackoverflow.com/questions/39023287
复制相似问题