Skip to content

Commit 539c470

Browse files
committed
BangPatterns instead of seq
1 parent 089d200 commit 539c470

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Statistics/Sample.hs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{-# LANGUAGE FlexibleContexts #-}
2+
{-# LANGUAGE BangPatterns #-}
23
-- |
34
-- Module : Statistics.Sample
45
-- Copyright : (c) 2008 Don Stewart, 2009 Bryan O'Sullivan
@@ -459,8 +460,8 @@ x ^ 4 = (x * x) * (x * x)
459460
x ^ 5 = (x * x) * x * (x * x)
460461
-- x ^ n = x * (x ^ (n-1))
461462
x0 ^ n0 = go (n0-1) x0 where
462-
go 0 acc = acc
463-
go n acc = acc `seq` go (n-1) (acc*x0)
463+
go 0 !acc = acc
464+
go n acc = go (n-1) (acc*x0)
464465
{-# INLINE (^) #-}
465466

466467
-- don't support polymorphism, as we can't get unboxed returns if we use it.

0 commit comments

Comments
 (0)