Skip to content

Commit

Permalink
Add NFData (Normal.Update v blob) instance
Browse files Browse the repository at this point in the history
  • Loading branch information
phadej authored and jorisdral committed Apr 29, 2024
1 parent 87c482f commit fab76d6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Database/LSMTree/Internal/Normal.hs
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{-# LANGUAGE DeriveTraversable #-}
module Database.LSMTree.Internal.Normal (
LookupResult (..),
RangeLookupResult (..),
Update (..),
) where

import Control.DeepSeq (NFData (..))

-- | Result of a single point lookup.
data LookupResult k v blobref =
NotFound !k
Expand All @@ -26,3 +27,7 @@ data Update v blob =
Insert !v !(Maybe blob)
| Delete
deriving (Show, Eq)

instance (NFData v, NFData blob) => NFData (Update v blob) where
rnf Delete = ()
rnf (Insert v b) = rnf v `seq` rnf b

0 comments on commit fab76d6

Please sign in to comment.