mirror of
https://github.com/pavelchristof/syntax.git
synced 2024-10-03 21:47:21 +03:00
Change filtered to bifiltered.
This commit is contained in:
parent
9649016884
commit
e07a5d6d7b
@ -22,7 +22,7 @@ module Data.Syntax (
|
||||
|
||||
import Prelude hiding (take, takeWhile)
|
||||
|
||||
import Control.Lens
|
||||
import Control.Lens.Iso
|
||||
import Control.Lens.SemiIso
|
||||
import Data.MonoTraversable
|
||||
import Data.SemiIsoFunctor
|
||||
@ -58,16 +58,16 @@ class ( SemiIsoAlternative syn
|
||||
|
||||
-- | Any character except the given one.
|
||||
notChar :: Element seq -> syn (Element seq)
|
||||
notChar c = filtered (/= c) /$/ anyChar
|
||||
notChar c = bifiltered (/= c) /$/ anyChar
|
||||
|
||||
-- | Any character satisfying a predicate.
|
||||
satisfy :: (Element seq -> Bool) -> syn (Element seq)
|
||||
satisfy p = filtered p /$/ anyChar
|
||||
satisfy p = bifiltered p /$/ anyChar
|
||||
|
||||
-- | Transforms a character using a SemiIso and filters out values
|
||||
-- not satisfying the predicate.
|
||||
satisfyWith :: ASemiIso' a (Element seq) -> (a -> Bool) -> syn a
|
||||
satisfyWith ai p = filtered p . ai /$/ anyChar
|
||||
satisfyWith ai p = bifiltered p . ai /$/ anyChar
|
||||
|
||||
-- | A specific string.
|
||||
string :: seq -> syn ()
|
||||
|
Loading…
Reference in New Issue
Block a user