From cd470f2d11e48d9f5e5110785408a62d806a0101 Mon Sep 17 00:00:00 2001 From: Rhys Date: Fri, 15 Jan 2016 12:07:27 +1100 Subject: [PATCH] Add NFData instance for Path --- path.cabal | 1 + src/Path/Internal.hs | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/path.cabal b/path.cabal index 39a5d46..6fd3bf7 100644 --- a/path.cabal +++ b/path.cabal @@ -20,6 +20,7 @@ library , exceptions , filepath , template-haskell + , deepseq test-suite test type: exitcode-stdio-1.0 diff --git a/src/Path/Internal.hs b/src/Path/Internal.hs index ce3792f..b1f53cd 100644 --- a/src/Path/Internal.hs +++ b/src/Path/Internal.hs @@ -6,6 +6,7 @@ module Path.Internal (Path(..)) where +import Control.DeepSeq (NFData (..)) import Data.Data -- | Path of some base and type. @@ -43,3 +44,6 @@ instance Ord (Path b t) where -- @x == y ≡ show x == show y@ instance Show (Path b t) where show (Path x) = show x + +instance NFData (Path b t) where + rnf (Path x) = rnf x