From 63f3bd8fe38cb377e31993ecee7362717b6894de Mon Sep 17 00:00:00 2001 From: Ian Lynagh Date: Mon, 8 Apr 2013 16:12:08 +0100 Subject: [PATCH] Generalise the type of fieldSz and use it more --- compiler/ghci/ByteCodeItbls.lhs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/compiler/ghci/ByteCodeItbls.lhs b/compiler/ghci/ByteCodeItbls.lhs index f1524730b67f..c79e08dbb837 100644 --- a/compiler/ghci/ByteCodeItbls.lhs +++ b/compiler/ghci/ByteCodeItbls.lhs @@ -285,8 +285,8 @@ data StgConInfoTable = StgConInfoTable { sizeOfConItbl :: StgConInfoTable -> Int sizeOfConItbl conInfoTable - = sum [ sizeOf (conDesc conInfoTable) - , sizeOf (infoTable conInfoTable) ] + = sum [ fieldSz conDesc conInfoTable + , fieldSz infoTable conInfoTable ] pokeConItbl :: DynFlags -> Ptr StgConInfoTable -> Ptr StgConInfoTable -> StgConInfoTable -> IO () @@ -374,7 +374,7 @@ instance Storable StgInfoTable where #endif } -fieldSz :: (Storable a, Storable b) => (a -> b) -> a -> Int +fieldSz :: Storable b => (a -> b) -> a -> Int fieldSz sel x = sizeOf (sel x) newtype State s m a = State (s -> m (s, a))