Compile hsc2hs with -O.
Remove INLINE pragmas - they actually degrade performance by 2%.
------------------------------------------------------------------------
------------------------------------------------------------------------
--- $Id: Main.hs,v 1.25 2001/03/05 00:07:23 qrczak Exp $
+-- $Id: Main.hs,v 1.26 2001/03/16 09:07:41 qrczak Exp $
--
-- Program for converting .hsc files to .hs files, by converting the
-- file into a C program which is run to generate the Haskell source.
--
-- Program for converting .hsc files to .hs files, by converting the
-- file into a C program which is run to generate the Haskell source.
Success pos' _ s' a -> Success pos' out s' a
Failure pos' msg -> Failure pos' msg
Success pos' _ s' a -> Success pos' out s' a
Failure pos' msg -> Failure pos' msg
-{-# INLINE lookAhead #-}
lookAhead :: Parser String
lookAhead = Parser $ \pos s -> Success pos [] s s
lookAhead :: Parser String
lookAhead = Parser $ \pos s -> Success pos [] s s
satisfy :: (Char -> Bool) -> Parser Char
satisfy p =
Parser $ \pos s -> case s of
satisfy :: (Char -> Bool) -> Parser Char
satisfy p =
Parser $ \pos s -> case s of
unescapeHashes ('#':'#':s) = '#' : unescapeHashes s
unescapeHashes (c:s) = c : unescapeHashes s
unescapeHashes ('#':'#':s) = '#' : unescapeHashes s
unescapeHashes (c:s) = c : unescapeHashes s
-{-# INLINE lookAheadC #-}
lookAheadC :: Parser String
lookAheadC = liftM joinLines lookAhead
where
lookAheadC :: Parser String
lookAheadC = liftM joinLines lookAhead
where
joinLines ('\\':'\n':s) = joinLines s
joinLines (c:s) = c : joinLines s
joinLines ('\\':'\n':s) = joinLines s
joinLines (c:s) = c : joinLines s
satisfyC :: (Char -> Bool) -> Parser Char
satisfyC p = do
s <- lookAhead
satisfyC :: (Char -> Bool) -> Parser Char
satisfyC p = do
s <- lookAhead
# -----------------------------------------------------------------------------
# -----------------------------------------------------------------------------
-# $Id: Makefile,v 1.11 2001/03/14 12:13:02 rrt Exp $
+# $Id: Makefile,v 1.12 2001/03/16 09:07:41 qrczak Exp $
TOP=../..
include $(TOP)/mk/boilerplate.mk
TOP=../..
include $(TOP)/mk/boilerplate.mk
INSTALLING=1
HS_PROG = hsc2hs-bin
INSTALLING=1
HS_PROG = hsc2hs-bin
-SRC_HC_OPTS += -package util
+SRC_HC_OPTS += -package util -O
INSTALLED_SCRIPT_PROG = hsc2hs
INPLACE_SCRIPT_PROG = hsc2hs-inplace
INSTALLED_SCRIPT_PROG = hsc2hs
INPLACE_SCRIPT_PROG = hsc2hs-inplace