Skip to content

Commit

Permalink
Compilation in 'match'
Browse files Browse the repository at this point in the history
  • Loading branch information
UnkindPartition committed Dec 20, 2011
1 parent 30d6f99 commit 9c5b39b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Text/Regex/Applicative/Interface.hs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ few a = reverse <$> Rep NonGreedy (flip (:)) [] a

-- | @s =~ a = match a s@
(=~) :: [s] -> RE s a -> Maybe a
s =~ a = match a s
(=~) = flip match
infix 2 =~

-- | Attempt to match a string of symbols against the regular expression.
Expand All @@ -96,10 +96,10 @@ infix 2 =~
-- >Nothing
--
match :: RE s a -> [s] -> Maybe a
match re str =
match re = let obj = compile re in \str ->
listToMaybe $
results $
foldl (flip step) (compile re) str
foldl (flip step) obj str

-- | Find a string prefix which is matched by the regular expression.
--
Expand Down

0 comments on commit 9c5b39b

Please sign in to comment.