[add ToCmmTy class and some utility routines
John Meacham <john@repetae.net>**20080322214015] hunk ./Cmm/Op.hs 188
+
+class ToCmmTy a where
+    toCmmTy :: a -> Maybe Ty
+
+instance ToCmmTy Ty where
+    toCmmTy a = Just a
+
+instance ToCmmTy String where
+    toCmmTy s = readTy s
+
+cmmTyBits :: ToCmmTy a => a -> Maybe Int
+cmmTyBits x = do TyBits (Bits b) _ <- toCmmTy x; return b
+cmmTyHint x = do TyBits _ hint <- toCmmTy x; return hint