[add primitive type for various static properties of built in types
John Meacham <john@repetae.net>**20060425064949] hunk ./C/FromGrin.hs 73
+    PrimTypeInfo { primArgType = arg, primTypeInfo = PrimSizeOf } -> return $ expressionRaw ("sizeof(" ++ arg ++ ")")
hunk ./C/Prims.hs 29
+    | PrimTypeInfo { primArgType :: ExtType,  primRetType :: ExtType, primTypeInfo :: PrimTypeInfo }   -- evaluates to sizeof its argument in bytes
+    deriving(Typeable, Data, Eq, Ord, Show)
+    {-! derive: GhcBinary !-}
+
+data PrimTypeInfo = PrimSizeOf | PrimMaxBound | PrimMinBound
hunk ./C/Prims.hs 46
+primIsCheap PrimTypeInfo {} = True
hunk ./C/Prims.hs 58
+primIsConstant PrimTypeInfo {} = True
hunk ./C/Prims.hs 94
+    pprint PrimTypeInfo { primArgType = at, primTypeInfo = PrimSizeOf } = text "sizeof" <> parens (text at)
+    pprint PrimTypeInfo { primArgType = at, primTypeInfo = PrimMaxBound } = text "max" <> parens (text at)
+    pprint PrimTypeInfo { primArgType = at, primTypeInfo = PrimMinBound } = text "min" <> parens (text at)
hunk ./Grin/Linear.hs 84
+    farg (_,ValPrim {}) = return ()
hunk ./data/PrimitiveOperators-in.hs 168
--- prim_const s t et = EPrim (APrim (CConst s t) mempty) [] et
hunk ./data/PrimitiveOperators-in.hs 169
+prim_sizeof s = (ELit (LitCons dc_Int [rp] tInt)) where
+    rp = (EPrim (APrim (PrimTypeInfo { primArgType = s, primRetType = "int", primTypeInfo = PrimSizeOf }) mempty) [] tIntzh)
hunk ./utils/op_process.prl 132
-    push @cmeth, "($foreign_storable, toInstName \"Foreign.Storable.sizeOf.$d->[0]\", ELam (v0 $t) \$ " . const("sizeof($d->[1])","tInt") . ")";
+    #push @cmeth, "($foreign_storable, toInstName \"Foreign.Storable.sizeOf.$d->[0]\", ELam (v0 $t) \$ " . const("sizeof($d->[1])","tInt") . ")";
+    push @cmeth, "($foreign_storable, toInstName \"Foreign.Storable.sizeOf.$d->[0]\", ELam (v0 $t) \$ prim_sizeof \"$d->[1]\")";