diff options
author | Teddy Wing | 2017-08-20 12:45:17 +0200 |
---|---|---|
committer | Teddy Wing | 2017-08-20 15:15:14 +0200 |
commit | de7e162e6865b9e805154b7c7178406309746e6f (patch) | |
tree | a2c59126b3d2a7ea9eff762e2a02f1b909b093d7 | |
parent | e94543c1b42bac8928aa8bf4fa3341563f7631b8 (diff) | |
download | sorbot-de7e162e6865b9e805154b7c7178406309746e6f.tar.bz2 |
Factorial: Use `Integral`
Apparently that's short for `Enum a, Num a`.
-rw-r--r-- | src/Plugin/Factorial.hs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Plugin/Factorial.hs b/src/Plugin/Factorial.hs index f8cfee2..692d20f 100644 --- a/src/Plugin/Factorial.hs +++ b/src/Plugin/Factorial.hs @@ -25,5 +25,5 @@ factorialAction message = do let number = last m return $ Right $ showt $ calculate $ (read number :: Int) -calculate :: (Enum a, Num a) => a -> a +calculate :: (Integral a) => a -> a calculate n = product [1..n] |