on master help sign in
Change filtered to bifiltered.
e07a5d6Paweł Nowak
Data/Syntax.hs+4−4
@@ -22,7 +22,7 @@ module Data.Syntax (
22
22
23import Prelude hiding (take, takeWhile)
23import Prelude hiding (take, takeWhile)
24
24
25−import Control.Lens
25+import Control.Lens.Iso
26import Control.Lens.SemiIso
26import Control.Lens.SemiIso
27import Data.MonoTraversable
27import Data.MonoTraversable
28import Data.SemiIsoFunctor
28import Data.SemiIsoFunctor
@@ -58,16 +58,16 @@ class ( SemiIsoAlternative syn
58
58
59 -- | Any character except the given one.
59 -- | Any character except the given one.
60 notChar :: Element seq -> syn (Element seq)
60 notChar :: Element seq -> syn (Element seq)
61− notChar c = filtered (/= c) /$/ anyChar
61+ notChar c = bifiltered (/= c) /$/ anyChar
62
62
63 -- | Any character satisfying a predicate.
63 -- | Any character satisfying a predicate.
64 satisfy :: (Element seq -> Bool) -> syn (Element seq)
64 satisfy :: (Element seq -> Bool) -> syn (Element seq)
65− satisfy p = filtered p /$/ anyChar
65+ satisfy p = bifiltered p /$/ anyChar
66
66
67 -- | Transforms a character using a SemiIso and filters out values
67 -- | Transforms a character using a SemiIso and filters out values
68 -- not satisfying the predicate.
68 -- not satisfying the predicate.
69 satisfyWith :: ASemiIso' a (Element seq) -> (a -> Bool) -> syn a
69 satisfyWith :: ASemiIso' a (Element seq) -> (a -> Bool) -> syn a
70− satisfyWith ai p = filtered p . ai /$/ anyChar
70+ satisfyWith ai p = bifiltered p . ai /$/ anyChar
71
71
72 -- | A specific string.
72 -- | A specific string.
73 string :: seq -> syn ()
73 string :: seq -> syn ()