有麻烦解开也许和空的值如下:也许嵌套和可空
container <-
unsafePartial
(fromJust <<< toMaybe
<$> DOM.querySelector (DOM.QuerySelector "body")
(DOM.htmlDocumentToParentNode document))
使我有以下错误:
Could not match type
Maybe
with type
Nullable
while trying to match type Maybe Element
with type Nullable t1
while checking that expression (querySelector (QuerySelector "body"))
(htmlDocumentToParentNode document)
has type t0 (Nullable t1)
in value declaration mainwhere t0 is an unknown type
t1 is an unknown type
我已经试过,但我无法找到我通过这里使用的各种类型的方式 (代码最初是从here)
是的,最终我通过应用unsafePartial并从最后一行直接将容器应用于容器来实现它。感谢您通知我输入的洞,看起来非常有用,虽然在这种情况下,它表明usafeCoerce不起作用。 – bensnowball
是的,不是每个建议都可以。这意味着它会进行类型检查。 –