select should accept [Tag]
I'd propose to give a following example of using Haquery in ghci, which is one of the common usages of fetching a website and parsing it.
import Haquery (select, parseHtml)
import Network.Wreq (get, responseBody)
import Control.Lens (^.)
import Data.Text (pack)
r <- get "http://nixos.org/channels/"
Prelude.concatMap (select (pack "a")) $ parseHtml $ pack $ show (r ^. responseBody)
Which motivates me to say that select should accept a list of Tags, since that's what parseHtml returns.
PS: I'm fairly new to Haskell ecosystem, so excuse my ignorance :)
Another strong reason is that the returned [Tag] can be then chained to subsequent select calls.
Yes, I think I'd also like this change. Any reason to the contrary, @crufter?
Just occured to me that we could also define
selects :: Text -> [Tag] -> [Tag]
selects sel tags = concat $ map (select sel) tags
@Wizek I will implement that