Skip to content

Commit

Permalink
Add strictness to sampling from CT
Browse files Browse the repository at this point in the history
When result is returned strictly GHC is able to unbox it.
  • Loading branch information
Shimuuar committed May 11, 2024
1 parent 0fc0950 commit 8a22460
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion System/Random/MWC/CondensedTable.hs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ genFromTable :: (StatefulGen g m, Vector v a) => CondensedTable v a -> g -> m a
{-# INLINE genFromTable #-}
genFromTable table gen = do
w <- uniformM gen
return $ lookupTable table $ fromIntegral (w :: Word32)
return $! lookupTable table $ fromIntegral (w :: Word32)

lookupTable :: Vector v a => CondensedTable v a -> Word64 -> a
{-# INLINE lookupTable #-}
Expand Down

0 comments on commit 8a22460

Please sign in to comment.