1 {-# LANGUAGE DeriveDataTypeable #-}
2 {-# LANGUAGE StandaloneDeriving #-}
3 {-# OPTIONS_GHC -fno-warn-orphans #-}
4 module Hcompta.Lib.Strict where
6 import Control.DeepSeq (NFData(..))
8 import qualified Data.Strict.Maybe as Strict
10 deriving instance Data x => Data (Strict.Maybe x)
11 instance Monoid x => Monoid (Strict.Maybe x) where
12 mempty = Strict.Nothing
13 mappend (Strict.Just x) (Strict.Just y) = Strict.Just (x `mappend` y)
14 mappend x Strict.Nothing = x
15 mappend Strict.Nothing y = y
16 instance NFData x => NFData (Strict.Maybe x) where
17 rnf Strict.Nothing = ()
18 rnf (Strict.Just x) = rnf x