From 1c7601a6cca488202abb24578ac9163029f381ab Mon Sep 17 00:00:00 2001 From: Sam T Date: Mon, 26 Aug 2013 21:06:33 +0400 Subject: ~ Move instance for NFData to library. --- src/Data/BEncode.hs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/Data/BEncode.hs') diff --git a/src/Data/BEncode.hs b/src/Data/BEncode.hs index 62188ff..b53f6e5 100644 --- a/src/Data/BEncode.hs +++ b/src/Data/BEncode.hs @@ -102,6 +102,7 @@ module Data.BEncode import Control.Applicative +import Control.DeepSeq import Control.Monad import Data.Int import Data.Maybe (mapMaybe) @@ -146,6 +147,12 @@ data BEncode = BInteger {-# UNPACK #-} !Int64 | BDict Dict deriving (Show, Read, Eq, Ord) +instance NFData BEncode where + rnf (BInteger i) = rnf i + rnf (BString s) = rnf s + rnf (BList l) = rnf l + rnf (BDict d) = rnf d + -- | Result used in decoding operations. type Result = Either String -- cgit v1.2.3