[allow plain 'maxBound/minBound/umaxBound' primitives when the type is clear from context
John Meacham <john@repetae.net>**20100705072243
 Ignore-this: 2b199576d942f3d70d6b674943a8a724
] hunk ./src/E/PrimOpt.hs 1
-{-# LANGUAGE RecursiveDo #-}
+{-# LANGUAGE RecursiveDo,ViewPatterns #-}
hunk ./src/E/PrimOpt.hs 162
+    primBoundMap = [("maxBound",PrimMaxBound), ("minBound",PrimMinBound), ("umaxBound",PrimUMaxBound)]
hunk ./src/E/PrimOpt.hs 199
+    primopt pn@(flip lookup primBoundMap -> Just c) [] t  = return $ ans where
+        Just tt = Op.readTy $ show rtn
+        (ExtTypeBoxed cna rt _) = fromMaybe (error $ "lookupExtTypeInfo(box): " ++ show t) $ lookupExtTypeInfo dataTable t
+        ELit LitCons { litName = rtn } = rt
+        ee = (EPrim (APrim (PrimTypeInfo tt tt c) mempty) [] rt)
+        ans = ELit litCons { litName = cna, litArgs = [ee], litType = orig_t }