golfing with curry

This commit is contained in:
Joey Hess 2011-09-18 21:02:40 -04:00
parent b516cecff2
commit 8d1e8c0760

View file

@ -42,9 +42,7 @@ generate :: [Token op] -> Matcher op
generate ts = generate' Any ts
generate' :: Matcher op -> [Token op] -> Matcher op
generate' m [] = m
generate' m ts = generate' m' rest
where
(m', rest) = consume m ts
generate' m ts = uncurry generate' $ consume m ts
{- Consumes one or more Tokens, constructs a new Matcher,
- and returns unconsumed Tokens. -}