mirror of
https://github.com/alpmestan/taggy.git
synced 2024-08-16 10:20:30 +03:00
Combinators: don't enable the ViewPatterns extension; use Kliesli composition in (/&).
This commit is contained in:
parent
a9c6224541
commit
349f7b7d50
@ -1,4 +1,4 @@
|
||||
{-# LANGUAGE LambdaCase, ViewPatterns #-}
|
||||
{-# LANGUAGE LambdaCase #-}
|
||||
|
||||
module Text.Taggy.Combinators (hasName, hasAttr, getAttr, innerText, (//), (/&), subtrees) where
|
||||
|
||||
@ -27,7 +27,7 @@ innerText = mconcat . map getContent . eltChildren
|
||||
|
||||
(/&) :: Element -> [(Element -> Bool)] -> [Element]
|
||||
(/&) element [] = [element]
|
||||
(/&) element (x:xs) = (=<<) (/& xs) . filter x . catElements $ eltChildren element
|
||||
(/&) element (x:xs) = (/& xs) <=< filter x . catElements $ eltChildren element
|
||||
|
||||
subtrees :: Element -> [Element]
|
||||
subtrees = ap (:) subtrees <=< catElements . eltChildren
|
||||
|
Loading…
Reference in New Issue
Block a user