Permalink
Browse files

Fixed bugs in `between'.

  • Loading branch information...
1 parent 7b34388 commit 61aacd38c65ad0b2c8da46a10bb7dd5eb529023a @MedeaMelana committed Jan 12, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 Control/Frequency.hs
View
@@ -91,5 +91,5 @@ atLeast n = (++) <$> exactly n <*> many
-- | Allow an action to be run between so and so many times (inclusive).
between :: Int -> Int -> Freq a [a]
between 0 0 = zero []
-between 0 m = zero [] <|> between 0 (m - 1)
-between n m = (++) <$> atLeast n <*> between 0 (m - n)
+between 0 m = zero [] <|> (:) <$> one <*> between 0 (m - 1)
+between n m = (++) <$> exactly n <*> between 0 (m - n)

0 comments on commit 61aacd3

Please sign in to comment.