[fix storable instances
John Meacham <john@repetae.net>**20120126123433
 Ignore-this: a443b85bf55b93333dc4ab865f81b46c
] hunk ./lib/jhc/Foreign/Storable.m4 12
-foreign import primitive "peek.$4" peek$2 :: Addr__ -> UIO $3
-foreign import primitive "poke.$4" poke$2 :: Addr__ -> $3 -> UIO_
+foreign import primitive "peek.$4" peek$2 :: Addr_ -> UIO $3
+foreign import primitive "poke.$4" poke$2 :: Addr_ -> $3 -> UIO_
hunk ./lib/jhc/Foreign/Storable.m4 19
+m4_define(INST_STORABLE_YY,{{
+instance Storable $1 where
+    peek (Ptr addr) = IO $ \w -> case peek$2 addr w of
+        (# w', r #) -> (# w', box$2 r #)
+    poke (Ptr addr) v = IO $ \w -> case poke$2 addr (unbox$2 v) w of
+        w' -> (# w', () #)
+    sizeOf _ = Int (sizeOf$2 0#)
+    alignment _ = Int (alignmentOf$2 0#)
+ONCE({{
+foreign import primitive "peek.$4" peek$2 :: Addr_ -> UIO $3
+foreign import primitive "poke.$4" poke$2 :: Addr_ -> $3 -> UIO_
+foreign import primitive "sizeOf.$4" sizeOf$2 :: Int__ -> Int__
+foreign import primitive "alignmentOf.$4" alignmentOf$2 :: Int__ -> Int__
+foreign import primitive "box" box$2 :: $3 -> $1
+foreign import primitive "unbox" unbox$2 :: $1 -> $3
+}})
+}})
+
hunk ./lib/jhc/Foreign/Storable.m4 38
+m4_define(INST_STORABLE_Y,{{INST_STORABLE_YY($1,$1,$2,$3)}})
hunk ./lib/jhc/Jhc/Inst/Storable.hs 39
-INST_STORABLE(CChar,Int8,bits8)
-INST_STORABLE(CSChar,Int8,bits8)
-INST_STORABLE(CUChar,Word8,bits8)
-INST_STORABLE(CInt,Int,bits<int>)
-INST_STORABLE(CUInt,Word,bits<int>)
-INST_STORABLE(CWchar,Word32,bits<wchar_t>)
-INST_STORABLE(CSize,WordPtr,bits<size_t>)
+INST_STORABLE_Y(CChar,Bits8_,bits8)
+INST_STORABLE_Y(CSChar,Bits8_,bits8)
+INST_STORABLE_Y(CUChar,Bits8_,bits8)
+INST_STORABLE_Y(CInt,Int_,bits<int>)
+INST_STORABLE_Y(CUInt,Word_,bits<int>)
+INST_STORABLE_Y(CWchar,Bits32_,bits<wchar_t>)
+INST_STORABLE_Y(CSize,BitsPtr_,bits<size_t>)
hunk ./lib/jhc/Jhc/Type/C.hs 16
+newtype CShort   = CShort Int16
+newtype CUShort  = CUShort Word16
hunk ./lib/jhc/Jhc/Type/C.hs 20
-newtype CLLong   = CLLong IntMax
-newtype CULLong  = CULLong WordMax
hunk ./lib/jhc/Jhc/Type/C.hs 22
-newtype CShort   = CShort Int16
-newtype CUShort  = CUShort Word16
-newtype CWchar   = CWchar Word32
-newtype CWint    = CWint Int32
+newtype CLLong   = CLLong IntMax
+newtype CULLong  = CULLong WordMax
+
hunk ./lib/jhc/Jhc/Type/C.hs 29
+
hunk ./lib/jhc/Jhc/Type/C.hs 33
-newtype CSize    = CSize WordPtr
+
+newtype CWchar   = CWchar Word32
+newtype CWint    = CWint Int32
+newtype CClock   = CClock IntMax
hunk ./lib/jhc/Jhc/Type/C.hs 38
+newtype CSize    = CSize WordPtr
hunk ./lib/jhc/Jhc/Type/C.hs 40
-newtype CClock   = CClock IntMax