Skip to content

Commit

Permalink
Fix promote doing an unnecessary split (#373)
Browse files Browse the repository at this point in the history
  • Loading branch information
MaximilianAlgehed authored Mar 21, 2024
1 parent 3479a1a commit 8c26daf
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/Test/QuickCheck/Gen/Unsafe.hs
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,11 @@ module Test.QuickCheck.Gen.Unsafe where

import Test.QuickCheck.Gen
import Control.Monad
import Control.Applicative

-- | Promotes a monadic generator to a generator of monadic values.
promote :: Monad m => m (Gen a) -> Gen (m a)
promote m = do
eval <- delay
return (liftM eval m)
promote m = flip liftM m <$> delay

-- | Randomly generates a function of type @'Gen' a -> a@, which
-- you can then use to evaluate generators. Mostly useful in
Expand Down

0 comments on commit 8c26daf

Please sign in to comment.