import Control.Applicative for 7.8.4

This commit is contained in:
Mark Wotton 2017-06-15 13:30:58 -04:00
parent 2a112b5516
commit 1bc30deee7

View File

@ -42,6 +42,7 @@ where
import Yesod.Test.CssQuery import Yesod.Test.CssQuery
import qualified Data.Text as T import qualified Data.Text as T
import qualified Control.Applicative
import Text.XML import Text.XML
import Text.XML.Cursor import Text.XML.Cursor
import qualified Data.ByteString.Lazy as L import qualified Data.ByteString.Lazy as L
@ -59,7 +60,7 @@ type HtmlLBS = L.ByteString
-- * Right: List of matching Html fragments. -- * Right: List of matching Html fragments.
findBySelector :: HtmlLBS -> Query -> Either String [String] findBySelector :: HtmlLBS -> Query -> Either String [String]
findBySelector html query = findBySelector html query =
map (renderHtml . toHtml . node) <$> findCursorsBySelector html query map (renderHtml . toHtml . node) Control.Applicative.<$> findCursorsBySelector html query
-- | Perform a css 'Query' on 'Html'. Returns Either -- | Perform a css 'Query' on 'Html'. Returns Either
-- --
@ -69,7 +70,7 @@ findBySelector html query =
findCursorsBySelector :: HtmlLBS -> Query -> Either String [Cursor] findCursorsBySelector :: HtmlLBS -> Query -> Either String [Cursor]
findCursorsBySelector html query = findCursorsBySelector html query =
runQuery (fromDocument $ HD.parseLBS html) runQuery (fromDocument $ HD.parseLBS html)
<$> parseQuery query Control.Applicative.<$> parseQuery query
-- | Perform a css 'Query' on 'Html'. Returns Either -- | Perform a css 'Query' on 'Html'. Returns Either
-- --
@ -80,7 +81,7 @@ findCursorsBySelector html query =
-- @since 1.5.7 -- @since 1.5.7
findAttributeBySelector :: HtmlLBS -> Query -> T.Text -> Either String [[T.Text]] findAttributeBySelector :: HtmlLBS -> Query -> T.Text -> Either String [[T.Text]]
findAttributeBySelector html query attr = findAttributeBySelector html query attr =
map (laxAttribute attr) <$> findCursorsBySelector html query map (laxAttribute attr) Control.Applicative.<$> findCursorsBySelector html query
-- Run a compiled query on Html, returning a list of matching Html fragments. -- Run a compiled query on Html, returning a list of matching Html fragments.