Permalink
Browse files

Make Result an instance of NFData

  • Loading branch information...
bos committed Apr 1, 2011
1 parent a2ae362 commit 5bdfbf5d3bc8f27e2b4c8ad95e1e50c436c1275c
Showing with 4 additions and 0 deletions.
  1. +4 −0 Data/Aeson/Types.hs
View
@@ -74,6 +74,10 @@ data Result a = Error String
| Success a
deriving (Eq, Show, Typeable)
+instance (NFData a) => NFData (Result a) where
+ rnf (Success a) = rnf a
+ rnf (Error err) = rnf err
+
instance Functor Result where
fmap f (Success a) = Success (f a)
fmap _ (Error err) = Error err

0 comments on commit 5bdfbf5

Please sign in to comment.