From e09104974d13f66f4ec2e7ae2310346996cf2356 Mon Sep 17 00:00:00 2001 From: Alberto Ruiz Date: Sat, 20 Jun 2015 13:49:48 +0200 Subject: NFData for Mod, alternative luPacked'' using gaxpy --- packages/base/src/Internal/Modular.hs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'packages/base/src/Internal/Modular.hs') diff --git a/packages/base/src/Internal/Modular.hs b/packages/base/src/Internal/Modular.hs index 1cae1ac..098817e 100644 --- a/packages/base/src/Internal/Modular.hs +++ b/packages/base/src/Internal/Modular.hs @@ -44,6 +44,7 @@ import Foreign.ForeignPtr(castForeignPtr) import Foreign.Storable import Data.Ratio import Data.Complex +import Control.DeepSeq ( NFData(..) ) @@ -51,6 +52,10 @@ import Data.Complex newtype Mod (n :: Nat) t = Mod {unMod:: t} deriving (Storable) +instance (NFData t) => NFData (Mod n t) + where + rnf (Mod x) = rnf x + infixr 5 ./. type (./.) x n = Mod n x -- cgit v1.2.3