#define DO_TRACE 0
#define INCLUDE_SHOW_INSTANCES 0
module Control.DeepSeq.Bounded.NFDataP
(
deepseqp, forcep
, deepseqp_, forcep_
#if 0
, deepseqpM, forcepM
, deepseqpM_, forcepM_
#endif
, module Control.DeepSeq.Bounded.Pattern
, module Control.DeepSeq.Bounded.PatAlg
, NFDataP(..)
)
where
import Control.DeepSeq.Bounded.Pattern
import Control.DeepSeq.Bounded.PatAlg ( unionPats, liftPats )
import Control.DeepSeq.Bounded.NFDataN
#if USE_WW_DEEPSEQ
import Control.DeepSeq ( NFData )
import Control.DeepSeq ( rnf )
#endif
import Data.Typeable ( Typeable )
#if 1
import Data.Typeable ( typeOf )
#else
#if __GLASGOW_HASKELL__ >= 781
import Data.Typeable ( typeRep )
#else
import Data.Typeable ( typeOf )
#endif
#endif
import Data.Typeable ( mkTyCon3, mkTyConApp )
import Data.Typeable ( typeRepTyCon )
#if PARALLELISM_EXPERIMENT
import Control.Parallel ( par )
#endif
import Data.Int
import Data.Word
import Data.Ratio
import Data.Complex
import Data.Array
import Data.Fixed
import Data.Version
import Data.Maybe ( Maybe(..), isJust, fromJust )
import System.IO.Unsafe ( unsafePerformIO )
import Debug.Trace ( trace )
#if DO_TRACE
mytrace = trace
#else
mytrace _ = id
#endif
#if INCLUDE_SHOW_INSTANCES
deepseqp :: (Show a, NFDataP a) => String -> a -> b -> b
#else
deepseqp :: NFDataP a => String -> a -> b -> b
#endif
#if 0
#elif 0
deepseqp patstr a b = fromJust $ deepseqp_ (compilePat patstr) a b
#elif 1
deepseqp patstr = deepseqp_ (compilePat patstr)
#elif 0
deepseqp patstr a b = rnfp (compilePat patstr) a `seq` b
#endif
#if INCLUDE_SHOW_INSTANCES
deepseqp_ :: (Show a, NFDataP a) => Pattern -> a -> b -> b
#else
deepseqp_ :: NFDataP a => Pattern -> a -> b -> b
#endif
#if 0
#elif 0
deepseqp_ pat@(Node WI _) _ b = b
deepseqp_ pat@(Node (TR treps) chs) a b = if elem ta treps then doit `seq` b else b
where ta = show $ typeRepTyCon $ typeOf a
doit = rnfp pat a `seq` b
deepseqp_ pat@(Node (TI treps) chs) a b = if elem ta treps then b else doit `seq` b
where ta = show $ typeRepTyCon $ typeOf a
doit = rnfp pat a `seq` b
deepseqp_ pat a b = rnfp pat a `seq` b
#elif 1
deepseqp_ pat a b = rnfp pat a `seq` b
#endif
#if INCLUDE_SHOW_INSTANCES
deepseqpM :: (Show a, NFDataP a) => String -> a -> b -> Maybe b
#else
deepseqpM :: NFDataP a => String -> a -> b -> Maybe b
#endif
deepseqpM patstr a b = deepseqpM_ (compilePat patstr) a b
#if INCLUDE_SHOW_INSTANCES
deepseqpM_ :: (Show a, NFDataP a) => Pattern -> a -> b -> Maybe b
#else
deepseqpM_ :: NFDataP a => Pattern -> a -> b -> Maybe b
#endif
deepseqpM_ pat@(Node WI _) _ _ = Nothing
deepseqpM_ pat@(Node (TR treps) chs) a b = if elem ta treps then doit `seq` Just b else Nothing
where ta = show $ typeRepTyCon $ typeOf a
doit = rnfp pat a `seq` b
deepseqpM_ pat@(Node (TI treps) chs) a b = if elem ta treps then Nothing else doit `seq` Just b
where ta = show $ typeRepTyCon $ typeOf a
doit = rnfp pat a `seq` b
deepseqpM_ pat a b = rnfp pat a `seq` Just b
#if 0
($!!) :: (NFData a) => (a -> b) -> a -> b
f $!! x = x `deepseq` f x
#endif
#if INCLUDE_SHOW_INSTANCES
forcep :: (Show a, NFDataP a) => String -> a -> a
#else
forcep :: NFDataP a => String -> a -> a
#endif
#if 0
#elif 0
forcep patstr x
| p = fromJust ma
| otherwise = undefined::a
where ma = deepseqp_ (compilePat patstr) x x
p = isJust ma
#elif 0
forcep patstr x = fromJust $ deepseqp_ (compilePat patstr) x x
#elif 0
forcep patstr x
| b = x
| otherwise = fromJust y
where y = deepseqp_ (compilePat patstr) x (Just x)
pat@(Node p chs) = compilePat patstr
b | WI <- p = True
| TR _ <- p = True
| TN _ _ <- p = True
| TW _ <- p = True
| TI _ <- p = True
| otherwise = False
#elif 1
forcep patstr x = deepseqp_ (compilePat patstr) x x
#endif
#if INCLUDE_SHOW_INSTANCES
forcep_ :: (Show a, NFDataP a) => Pattern -> a -> a
#else
forcep_ :: NFDataP a => Pattern -> a -> a
#endif
#if 0
forcep_ pat x = fromJust $ deepseqp_ pat x x
#else
forcep_ pat x = deepseqp_ pat x x
#endif
#if INCLUDE_SHOW_INSTANCES
forcepM :: (Show a, NFDataP a) => String -> a -> Maybe a
#else
forcepM :: NFDataP a => String -> a -> Maybe a
#endif
forcepM patstr a = forcepM_ (compilePat patstr) a
#if INCLUDE_SHOW_INSTANCES
forcepM_ :: (Show a, NFDataP a) => Pattern -> a -> Maybe a
#else
forcepM_ :: NFDataP a => Pattern -> a -> Maybe a
#endif
forcepM_ pat x = deepseqpM_ pat x x
#if USE_WW_DEEPSEQ
class (Typeable a, NFDataN a, NFData a) => NFDataP a where
#else
class (Typeable a, NFDataN a) => NFDataP a where
#endif
#if INCLUDE_SHOW_INSTANCES
rnfp :: Show a => Pattern -> a -> ()
#else
rnfp :: Pattern -> a -> ()
#endif
rnfp (Node WI _) _ = ()
rnfp (Node (TR treps) chs) d = if elem td treps then d `seq` () else ()
where td = show $ typeRepTyCon $ typeOf d
rnfp (Node (TI treps) chs) d = if elem td treps then () else d `seq` ()
where td = show $ typeRepTyCon $ typeOf d
#if 1
rnfp _ d = d `seq` ()
#else
rnfp pat a | not $ patternShapeOK pat a = ()
| otherwise = rnf a
#endif
#if USE_WW_DEEPSEQ
rnfp' :: (Typeable a, NFDataN a, NFData a) => PatNode -> () -> a -> ()
#else
rnfp' :: (Typeable a, NFDataN a) => PatNode -> () -> a -> ()
#endif
rnfp' pat recurs d
=
let td = show $ typeRepTyCon $ typeOf d in
case pat of
WI -> error "rnfp: unexpected WI (please report this bug!)"
TR treps -> error "rnfp: unexpected TR (please report this bug!)"
TI treps -> error "rnfp: unexpected TI (please report this bug!)"
#if PARALLELISM_EXPERIMENT
PR -> recurs `par` ()
PN n -> rnfn n d `par` ()
#if USE_WW_DEEPSEQ
PW -> rnf d `par` ()
#endif
#endif
#ifdef SEQUENTIALISM_EXPERIMENT
#error Sorry, SEQUENTIALISM_EXPERIMENT is not done yet.
#endif
WR -> recurs
WS -> ()
WN n -> rnfn n d
#if USE_WW_DEEPSEQ
WW -> rnf d
#endif
TR treps -> if elem td treps then recurs else ()
#if 0
TS treps -> if elem td treps then () else ()
#endif
TN n treps -> if elem td treps then rnfn n d else ()
#if USE_WW_DEEPSEQ
TW treps -> if elem td treps then rnf d else ()
#endif
#if 0
NTR treps -> if not $ elem td treps then recurs else ()
NTN n treps -> if not $ elem td treps then rnfn n d else ()
#if USE_WW_DEEPSEQ
NTW treps -> if not $ elem td treps then rnf d else ()
#endif
#endif
_ -> error "rnfp: Unexpected constructor!"
#if 0
compose = (.)
#endif
instance NFDataP Int
instance NFDataP Word
instance NFDataP Integer
instance NFDataP Float
instance NFDataP Double
instance NFDataP Char
#if 0
instance NFDataP Bool
where
rnfp (Node WI _) _ = ()
rnfp _ d = d `seq` ()
#else
instance NFDataP Bool
#endif
instance NFDataP ()
instance NFDataP Int8
instance NFDataP Int16
instance NFDataP Int32
instance NFDataP Int64
instance NFDataP Word8
instance NFDataP Word16
instance NFDataP Word32
instance NFDataP Word64
instance Typeable a => NFDataP (Fixed a)
instance (Typeable a, Typeable b) => NFDataP (a -> b)
#if 0
#if USE_WW_DEEPSEQ
instance NFData a => NFData (IO a) where
rnf x = ()
#endif
instance NFDataP a => NFDataP (IO a) where
rnfp pat x = ()
#endif
#if INCLUDE_SHOW_INSTANCES
instance (Show a, Integral a, NFDataP a) => NFDataP (Ratio a) where
#else
instance (Integral a, NFDataP a) => NFDataP (Ratio a) where
#endif
rnfp (Node WI _) _ = ()
rnfp pat x = rnfp pat (numerator x, denominator x)
#if INCLUDE_SHOW_INSTANCES
instance (Show a, RealFloat a, NFDataP a) => NFDataP (Complex a) where
#else
instance (RealFloat a, NFDataP a) => NFDataP (Complex a) where
#endif
rnfp (Node WI _) _ = ()
rnfp (Node pat chs) d
| TR treps <- pat = if elem td treps then recurs else ()
| TI treps <- pat = if elem td treps then () else recurs
| otherwise = rnfp' pat recurs d
where
td = show $ typeRepTyCon $ typeOf d
recurs = case length chs of
0 -> case pat of
WS -> ()
_ -> pat_match_fail
2 -> let [px,py] = chs ; (x:+y) = d
in rnfp px x
`seq` rnfp py y
`seq` ()
_ -> pat_match_fail
pat_match_fail = patMatchFail' "(Complex a)" pat chs d
rnfp (Node pat chs) d = patMatchFail pat chs d
#if INCLUDE_SHOW_INSTANCES
instance (Show a, NFDataP a) => NFDataP (Maybe a) where
#else
instance NFDataP a => NFDataP (Maybe a) where
#endif
rnfp (Node WI _) _ = ()
rnfp (Node pat chs) Nothing
| not $ null chs = pat_match_fail
| otherwise = ()
where
pat_match_fail = patMatchFail' "Nothing" pat chs ()
rnfp (Node pat chs) (Just d)
| TR treps <- pat = if elem td treps then recurs else ()
| TI treps <- pat = if elem td treps then () else recurs
| otherwise = rnfp' pat recurs d
where
td = show $ typeRepTyCon $ typeOf d
recurs = case length chs of
0 -> case pat of
WS -> ()
_ -> pat_match_fail
1 -> let [p_J] = chs
in rnfp p_J d
`seq` ()
_ -> pat_match_fail
pat_match_fail = patMatchFail' "Just" pat chs d
rnfp (Node pat chs) d = patMatchFail pat chs d
#if INCLUDE_SHOW_INSTANCES
instance (Show a, Show b, NFDataP a, NFDataP b) => NFDataP (Either a b) where
#else
instance (NFDataP a, NFDataP b) => NFDataP (Either a b) where
#endif
rnfp (Node WI _) _ = ()
rnfp (Node pat chs) (Left d)
| TR treps <- pat = if elem td treps then recurs else ()
| TI treps <- pat = if elem td treps then () else recurs
| otherwise = rnfp' pat recurs d
where
td = show $ typeRepTyCon $ typeOf d
recurs = case length chs of
0 -> case pat of
WS -> ()
_ -> pat_match_fail
1 -> let [p_L] = chs ;
in rnfp p_L d
`seq` ()
_ -> pat_match_fail
pat_match_fail = patMatchFail' "Left" pat chs d
rnfp (Node pat chs) (Right d)
| TR treps <- pat = if elem td treps then recurs else ()
| TI treps <- pat = if elem td treps then () else recurs
| otherwise = rnfp' pat recurs d
where
td = show $ typeRepTyCon $ typeOf d
recurs = case length chs of
0 -> case pat of
WS -> ()
_ -> pat_match_fail
1 -> let [p_R] = chs
in rnfp p_R d
`seq` ()
_ -> pat_match_fail
pat_match_fail = patMatchFail' "Right" pat chs d
rnfp (Node pat chs) d = patMatchFail pat chs d
instance NFDataP Data.Version.Version where
rnfp (Node WI _) _ = ()
rnfp (Node pat chs) d
| TR treps <- pat = if elem td treps then recurs else ()
| TI treps <- pat = if elem td treps then () else recurs
| otherwise = rnfp' pat recurs d
where
td = show $ typeRepTyCon $ typeOf d
recurs = case length chs of
0 -> case pat of
WS -> ()
_ -> pat_match_fail
2 -> let [pbr,ptags] = chs ; Data.Version.Version branch tags = d
in rnfp pbr branch
`seq` rnfp ptags tags
`seq` ()
_ -> pat_match_fail
pat_match_fail = patMatchFail' "Data.Version.Version" pat chs d
rnfp (Node pat chs) d = patMatchFail pat chs d
#if INCLUDE_SHOW_INSTANCES
instance (Show a, NFDataP a) => NFDataP [a] where
#else
instance NFDataP a => NFDataP [a] where
#endif
rnfp (Node WI _) _ = ()
rnfp _ [] = ()
rnfp (Node pat chs) d
| TR treps <- pat = if elem td treps then recurs else ()
| TI treps <- pat = if elem td treps then () else recurs
| otherwise = rnfp' pat recurs d
where
td = show $ typeRepTyCon $ typeOf d
recurs = case length chs of
0 -> case pat of
WS -> ()
_ -> pat_match_fail
2 -> let [px,pxs] = chs ; (x:xs) = d
in rnfp px x
`seq` rnfp pxs xs
`seq` ()
_ -> pat_match_fail
pat_match_fail = patMatchFail' "[a]" pat chs d
rnfp (Node pat chs) d = patMatchFail pat chs d
#if INCLUDE_SHOW_INSTANCES
instance (Show a, Show b, Ix a, NFDataP a, NFDataP b) => NFDataP (Array a b) where
#else
instance (Ix a, NFDataP a, NFDataP b) => NFDataP (Array a b) where
#endif
rnfp (Node WI _) _ = ()
rnfp pat x = rnfp pat (bounds x, Data.Array.elems x)
`seq` ()
#if INCLUDE_SHOW_INSTANCES
instance (Show a,Typeable a,NFDataP a, Show b,Typeable b,NFDataP b) => NFDataP (a,b) where
#else
instance (Typeable a,NFDataP a, Typeable b,NFDataP b) => NFDataP (a,b) where
#endif
rnfp (Node WI _) _ = ()
rnfp (Node pat chs) d
| TR treps <- pat = if elem td treps then recurs else ()
| TI treps <- pat = if elem td treps then () else recurs
| otherwise = rnfp' pat recurs d
where
td = show $ typeRepTyCon $ typeOf d
recurs = case length chs of
0 -> case pat of
WS -> ()
_ -> pat_match_fail
2 -> let [px,py] = chs ; (x,y) = d
in rnfp px x
`seq` rnfp py y
`seq` ()
_ -> pat_match_fail
pat_match_fail = patMatchFail' "(,)" pat chs d
rnfp (Node pat chs) d = patMatchFail pat chs d
#if INCLUDE_SHOW_INSTANCES
instance (Show a, Typeable a, NFDataP a, Show b, Typeable b, NFDataP b, Show c, Typeable c, NFDataP c) => NFDataP (a,b,c) where
#else
instance (Typeable a, NFDataP a, Typeable b, NFDataP b, Typeable c, NFDataP c) => NFDataP (a,b,c) where
#endif
rnfp (Node WI _) _ = ()
rnfp (Node pat chs) d
| TR treps <- pat = if elem td treps then recurs else ()
| TI treps <- pat = if elem td treps then () else recurs
| otherwise = rnfp' pat recurs d
where
td = show $ typeRepTyCon $ typeOf d
recurs = case length chs of
0 -> case pat of
WS -> ()
_ -> pat_match_fail
3 -> let [px,py,pz] = chs ; (x,y,z) = d
in ( rnfp px x)
`seq` ( rnfp py y)
`seq` ( rnfp pz z)
`seq` ()
_ -> pat_match_fail
pat_match_fail = patMatchFail' "(,,)" pat chs d
rnfp (Node pat chs) d = patMatchFail pat chs d
#if INCLUDE_SHOW_INSTANCES
instance (Show a, Typeable a, NFDataP a, Show b, Typeable b, NFDataP b, Show c, Typeable c, NFDataP c, Show d, Typeable d, NFDataP d) => NFDataP (a,b,c,d) where
#else
instance (Typeable a, NFDataP a, Typeable b, NFDataP b, Typeable c, NFDataP c, Typeable d, NFDataP d) => NFDataP (a,b,c,d) where
#endif
rnfp (Node WI _) _ = ()
rnfp (Node pat chs) d
| TR treps <- pat = if elem td treps then recurs else ()
| TI treps <- pat = if elem td treps then () else recurs
| otherwise = rnfp' pat recurs d
where
td = show $ typeRepTyCon $ typeOf d
recurs = case length chs of
0 -> case pat of
WS -> ()
_ -> pat_match_fail
4 -> let [px1,px2,px3,px4] = chs ; (x1,x2,x3,x4) = d
in rnfp px1 x1
`seq` rnfp px2 x2
`seq` rnfp px3 x3
`seq` rnfp px4 x4
`seq` ()
_ -> pat_match_fail
pat_match_fail = patMatchFail' "(,,,)" pat chs d
rnfp (Node pat chs) d = patMatchFail pat chs d
#if INCLUDE_SHOW_INSTANCES
instance (Show a1, Typeable a1, NFDataP a1, Show a2, Typeable a2, NFDataP a2, Show a3, Typeable a3, NFDataP a3, Show a4, Typeable a4, NFDataP a4, Show a5, Typeable a5, NFDataP a5) =>
#else
instance (Typeable a1, NFDataP a1, Typeable a2, NFDataP a2, Typeable a3, NFDataP a3, Typeable a4, NFDataP a4, Typeable a5, NFDataP a5) =>
#endif
NFDataP (a1, a2, a3, a4, a5) where
rnfp (Node WI _) _ = ()
rnfp (Node pat chs) d
| TR treps <- pat = if elem td treps then recurs else ()
| TI treps <- pat = if elem td treps then () else recurs
| otherwise = rnfp' pat recurs d
where
td = show $ typeRepTyCon $ typeOf d
recurs = case length chs of
0 -> case pat of
WS -> ()
_ -> pat_match_fail
5 -> let [px1,px2,px3,px4,px5] = chs ; (x1,x2,x3,x4,x5) = d
in rnfp px1 x1
`seq` rnfp px2 x2
`seq` rnfp px3 x3
`seq` rnfp px4 x4
`seq` rnfp px5 x5
`seq` ()
_ -> pat_match_fail
pat_match_fail = patMatchFail' "(,,,,)" pat chs d
rnfp (Node pat chs) d = patMatchFail pat chs d
#if INCLUDE_SHOW_INSTANCES
instance (Show a1, Typeable a1, NFDataP a1, Show a2, Typeable a2, NFDataP a2, Show a3, Typeable a3, NFDataP a3, Show a4, Typeable a4, NFDataP a4, Show a5, Typeable a5, NFDataP a5, Show a6, Typeable a6, NFDataP a6) =>
#else
instance (Typeable a1, NFDataP a1, Typeable a2, NFDataP a2, Typeable a3, NFDataP a3, Typeable a4, NFDataP a4, Typeable a5, NFDataP a5, Typeable a6, NFDataP a6) =>
#endif
NFDataP (a1, a2, a3, a4, a5, a6) where
rnfp (Node WI _) _ = ()
rnfp (Node pat chs) d
| TR treps <- pat = if elem td treps then recurs else ()
| TI treps <- pat = if elem td treps then () else recurs
| otherwise = rnfp' pat recurs d
where
td = show $ typeRepTyCon $ typeOf d
recurs = case length chs of
0 -> case pat of
WS -> ()
_ -> pat_match_fail
6 -> let [px1,px2,px3,px4,px5,px6] = chs ; (x1,x2,x3,x4,x5,x6) = d
in rnfp px1 x1
`seq` rnfp px2 x2
`seq` rnfp px3 x3
`seq` rnfp px4 x4
`seq` rnfp px5 x5
`seq` rnfp px6 x6
`seq` ()
_ -> pat_match_fail
pat_match_fail = patMatchFail' "(,,,,,)" pat chs d
rnfp (Node pat chs) d = patMatchFail pat chs d
#if INCLUDE_SHOW_INSTANCES
instance (Show a1, Typeable a1, NFDataP a1, Show a2, Typeable a2, NFDataP a2, Show a3, Typeable a3, NFDataP a3, Show a4, Typeable a4, NFDataP a4, Show a5, Typeable a5, NFDataP a5, Show a6, Typeable a6, NFDataP a6, Show a7, Typeable a7, NFDataP a7) =>
#else
instance (Typeable a1, NFDataP a1, Typeable a2, NFDataP a2, Typeable a3, NFDataP a3, Typeable a4, NFDataP a4, Typeable a5, NFDataP a5, Typeable a6, NFDataP a6, Typeable a7, NFDataP a7) =>
#endif
NFDataP (a1, a2, a3, a4, a5, a6, a7) where
rnfp (Node WI _) _ = ()
rnfp (Node pat chs) d
| TR treps <- pat = if elem td treps then recurs else ()
| TI treps <- pat = if elem td treps then () else recurs
| otherwise = rnfp' pat recurs d
where
td = show $ typeRepTyCon $ typeOf d
recurs = case length chs of
0 -> case pat of
WS -> ()
_ -> pat_match_fail
7 -> let [px1,px2,px3,px4,px5,px6,px7] = chs ; (x1,x2,x3,x4,x5,x6,x7) = d
in rnfp px1 x1
`seq` rnfp px2 x2
`seq` rnfp px3 x3
`seq` rnfp px4 x4
`seq` rnfp px5 x5
`seq` rnfp px6 x6
`seq` rnfp px7 x7
`seq` ()
_ -> pat_match_fail
pat_match_fail = patMatchFail' "(,,,,,,)" pat chs d
rnfp (Node pat chs) d = patMatchFail pat chs d
#if 0
instance (Show a1, Typeable a1, NFDataP a1, Show a2, Typeable a2, NFDataP a2, Show a3, Typeable a3, NFDataP a3, Show a4, Typeable a4, NFDataP a4, Show a5, Typeable a5, NFDataP a5, Show a6, Typeable a6, NFDataP a6, Show a7, Typeable a7, NFDataP a7, Show a8, Typeable a8, NFDataP a8) =>
NFDataP (a1, a2, a3, a4, a5, a6, a7, a8) where
rnfp Nil _ = ()
rnfp (Node pat [px1,px2,px3,px4,px5,px6,px7,px8]) d@(x1,x2,x3,x4,x5,x6,x7,x8) = rnfp' pat recurs d
where recurs = rnfp px1 x1
`seq` rnfp px2 x2
`seq` rnfp px3 x3
`seq` rnfp px4 x4
`seq` rnfp px5 x5
`seq` rnfp px6 x6
`seq` rnfp px7 x7
`seq` rnfp px8 x8
rnfp (Node pat chs) d = patMatchFail pat chs d
instance (Show a1, Typeable a1, NFDataP a1, Show a2, Typeable a2, NFDataP a2, Show a3, Typeable a3, NFDataP a3, Show a4, Typeable a4, NFDataP a4, Show a5, Typeable a5, NFDataP a5, Show a6, Typeable a6, NFDataP a6, Show a7, Typeable a7, NFDataP a7, Show a8, Typeable a8, NFDataP a8, Show a9, Typeable a9, NFDataP a9) =>
NFDataP (a1, a2, a3, a4, a5, a6, a7, a8, a9) where
rnfp Nil _ = ()
rnfp (Node pat [px1,px2,px3,px4,px5,px6,px7,px8,px9]) d@(x1,x2,x3,x4,x5,x6,x7,x8,x9) = rnfp' pat recurs d
where recurs = rnfp px1 x1
`seq` rnfp px2 x2
`seq` rnfp px3 x3
`seq` rnfp px4 x4
`seq` rnfp px5 x5
`seq` rnfp px6 x6
`seq` rnfp px7 x7
`seq` rnfp px8 x8
`seq` rnfp px9 x9
rnfp (Node pat chs) d = patMatchFail pat chs d
#endif
patMatchFail :: (Show a, Show b) => a -> b -> c -> ()
patMatchFail pat chs d
#if WARN_PATTERN_MATCH_FAILURE
= ( unsafePerformIO $! putStrLn $! "NFDataP: warning: couldn't match " ++ show pat ++ " (having children " ++ show chs ++ ")" ) `seq` ()
#else
= ()
#endif
patMatchFail' :: (Show a, Show b) => String -> a -> b -> c -> ()
patMatchFail' inst pat chs d
#if WARN_PATTERN_MATCH_FAILURE
= ( unsafePerformIO $! putStrLn $! "NFDataP: warning: instance " ++ inst ++ ": bad PatNode child list" ) `seq` patMatchFail pat chs d
#else
= ()
#endif