From d911a342580c7c22cc5e7058dfc6f8b51d95143d Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Mon, 19 Jun 2017 10:36:00 +0100 Subject: [PATCH] fix build failure with -f-support_deepseq disabled MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit How to reproduce: ``` $ cabal configure -f-support_deepseq Resolving dependencies... Configuring cryptonite-0.23... $ cabal build Building cryptonite-0.23... Preprocessing library cryptonite-0.23... [114 of 120] Compiling Crypto.PubKey.RSA.Types ( Crypto/PubKey/RSA/Types.hs, dist/build/Crypto/PubKey/RSA/Types Crypto/PubKey/RSA/Types.hs:48:30: error: • No instance for (NFData Integer) arising from a use of ‘rnf’ • In the first argument of ‘seq’, namely ‘rnf n’ In the expression: rnf n `seq` rnf e `seq` sz `seq` () In an equation for ‘rnf’: rnf (PublicKey sz n e) = rnf n `seq` rnf e `seq` sz `seq` () ``` The fix is to inctoruce 'NFData Integer' instance to `Crypto/Internal/DeepSeq`. Closes: https://github.com/haskell-crypto/cryptonite/issues/171 Signed-off-by: Sergei Trofimovich --- Crypto/Internal/DeepSeq.hs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Crypto/Internal/DeepSeq.hs b/Crypto/Internal/DeepSeq.hs index 9da7988..86b7845 100644 --- a/Crypto/Internal/DeepSeq.hs +++ b/Crypto/Internal/DeepSeq.hs @@ -30,4 +30,6 @@ instance NFData Word64 where rnf w = w `seq` () instance NFData Bytes where rnf b = b `seq` () instance NFData ScrubbedBytes where rnf b = b `seq` () +instance NFData Integer where rnf i = i `seq` () + #endif