标签: haskell dom ghcjs ghcjs-dom
如何将Element.querySelectorAll body "h1" IO NodeList的结果转换为IO (List Node)。我知道我可以自己写一个函数。有内置函数吗?
Element.querySelectorAll body "h1"
IO NodeList
IO (List Node)
答案 0 :(得分:0)
我的实施:
nodeListToList nl = nl & NodeList.getLength <&> (\x -> [0..x - 1]) >>= mapM (item nl) <&> catMaybes