Skip to content

Commit

Permalink
Merge pull request #189 from IntersectMBO/nfdata-update
Browse files Browse the repository at this point in the history
Add NFData (Normal.Update v blob) instance
  • Loading branch information
jorisdral committed Apr 29, 2024
2 parents 87c482f + fab76d6 commit 4045e3e
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 4045e3e

Please sign in to comment.