0

How can I convert the result of Element.querySelectorAll body "h1" which is IO NodeList to IO (List Node). I know I could write a function myself. Is there a builtin function?

michaelmesser
  • 3,601
  • 2
  • 19
  • 42

1 Answers1

0

My implementation:

nodeListToList nl = nl
       & NodeList.getLength
     <&> (\x -> [0..x - 1])
     >>= mapM (item nl)
     <&> catMaybes
michaelmesser
  • 3,601
  • 2
  • 19
  • 42