Skip to content

Commit

Permalink
`run' should try the longest sentence first.
Browse files Browse the repository at this point in the history
  • Loading branch information
MedeaMelana committed Jan 12, 2011
1 parent 50a5c27 commit 1b37d35
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Control/Frequency.hs
Expand Up @@ -51,8 +51,8 @@ instance Alternative (Freq a) where
-- | Run an action a certain number of times, using '<|>' to branch if
-- multiple frequencies are allowed.
run :: Alternative f => Freq a b -> f a -> f b
run (Freq mzer msuc) p = maybe empty pure mzer
<|> maybe empty (\f -> p <**> run f p) msuc
run (Freq mzer msuc) p = maybe empty (\f -> p <**> run f p) msuc
<|> maybe empty pure mzer



Expand Down

0 comments on commit 1b37d35

Please sign in to comment.