darcs patch: more portabilization
Isaac Dupree
isaacdupree at charter.net
Sat Jan 5 19:38:34 EST 2008
okay, this is a bunch but not all of the work. I'd like to have another
set of eyes look over it before committing, is all. I'm starting to
feel burnt-out... not handling my personal life quite right :-)
(these patches aren't all in a logical order because I kept
amend-recording them, and some depend on others.)
Fri Dec 28 11:02:55 EST 2007 Isaac Dupree <id at isaac.cedarswampstudios.org>
* document BreakArray better
Fri Dec 28 11:39:22 EST 2007 Isaac Dupree <id at isaac.cedarswampstudios.org>
* properly ifdef BreakArray for GHCI
Fri Jan 4 13:50:41 EST 2008 Isaac Dupree <id at isaac.cedarswampstudios.org>
* change ifs on __GLASGOW_HASKELL__ to account for... (#1405)
for it not being defined. I assume it being undefined implies
a compiler with relatively modern libraries but without most
unportable glasgow extensions.
Fri Jan 4 14:21:21 EST 2008 Isaac Dupree <id at isaac.cedarswampstudios.org>
* MyEither-->EitherString to allow Haskell98 instance
Fri Jan 4 16:13:29 EST 2008 Isaac Dupree <id at isaac.cedarswampstudios.org>
* re-portabilize Pretty, and corresponding changes
Fri Jan 4 17:19:55 EST 2008 Isaac Dupree <id at isaac.cedarswampstudios.org>
* Augment FastTypes to be much more complete
Fri Jan 4 20:14:19 EST 2008 Isaac Dupree <id at isaac.cedarswampstudios.org>
* use FastFunctions, cleanup FastString slightly
Fri Jan 4 21:00:22 EST 2008 Isaac Dupree <id at isaac.cedarswampstudios.org>
* Massive de-"#", mostly Int# --> FastInt (#1405)
Fri Jan 4 21:02:49 EST 2008 Isaac Dupree <id at isaac.cedarswampstudios.org>
* miscellaneous unnecessary-extension-removal
Sat Jan 5 19:30:13 EST 2008 Isaac Dupree <id at isaac.cedarswampstudios.org>
* add FastFunctions
-------------- next part --------------
New patches:
[document BreakArray better
Isaac Dupree <id at isaac.cedarswampstudios.org>**20071228160255] {
hunk ./compiler/main/BreakArray.hs 6
+-- Conceptually, a zero-indexed IOArray of Bools, initially False.
+-- They're represented as Words with 0==False, 1==True.
+-- They're used to determine whether GHCI breakpoints are on or off.
+--
}
[properly ifdef BreakArray for GHCI
Isaac Dupree <id at isaac.cedarswampstudios.org>**20071228163922] {
hunk ./compiler/main/BreakArray.hs 22
- ( BreakArray (BA)
- -- constructor is exported only for ByteCodeGen
+ ( BreakArray
+#ifdef GHCI
+ (BA) -- constructor is exported only for ByteCodeGen
+#endif
hunk ./compiler/main/BreakArray.hs 27
+#ifdef GHCI
hunk ./compiler/main/BreakArray.hs 32
+#endif
hunk ./compiler/main/BreakArray.hs 34
-
+#ifdef GHCI
hunk ./compiler/main/BreakArray.hs 117
+#else /* GHCI */
+--stub implementation to make main/, etc., code happier.
+--IOArray and IOUArray are increasingly non-portable,
+--still don't have quite the same interface, and (for GHCI)
+--presumably have a different representation.
+data BreakArray = Unspecified
+newBreakArray :: Int -> IO BreakArray
+newBreakArray _ = return Unspecified
+#endif /* GHCI */
+
+
}
[change ifs on __GLASGOW_HASKELL__ to account for... (#1405)
Isaac Dupree <id at isaac.cedarswampstudios.org>**20080104185041
for it not being defined. I assume it being undefined implies
a compiler with relatively modern libraries but without most
unportable glasgow extensions.
] {
hunk ./compiler/HsVersions.h 25
-#if __GLASGOW_HASKELL__ >= 602
+#if !defined(__GLASGOW_HASKELL__) || __GLASGOW_HASKELL__ >= 602
hunk ./compiler/HsVersions.h 31
-#ifdef __GLASGOW_HASKELL__
+/* Global variables may not work in other Haskell implementations,
+ * but we need them currently! so the conditional on GLASGOW won't do. */
+#if defined(__GLASGOW_HASKELL__) || !defined(__GLASGOW_HASKELL__)
hunk ./compiler/basicTypes/Literal.lhs 65
-#if __GLASGOW_HASKELL__
+#ifdef __GLASGOW_HASKELL__
hunk ./compiler/basicTypes/OccName.lhs 92
-#if __GLASGOW_HASKELL__ > 604
+#if !defined(__GLASGOW_HASKELL__) || __GLASGOW_HASKELL__ > 604
hunk ./compiler/cbits/rawSystem.c 4
-#if __GLASGOW_HASKELL__ < 601
+#if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ < 601
hunk ./compiler/deSugar/Coverage.lhs 32
-#if __GLASGOW_HASKELL__ < 603
+#if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ < 603
hunk ./compiler/main/ErrUtils.lhs 94
-#if __GLASGOW_HASKELL__ < 603
+#if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ < 603
hunk ./compiler/main/HeaderInfo.hs 49
-#if __GLASGOW_HASKELL__ >= 601
+#if !defined(__GLASGOW_HASKELL__) || __GLASGOW_HASKELL__ >= 601
hunk ./compiler/main/HeaderInfo.hs 55
-#if __GLASGOW_HASKELL__ < 601
+#if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ < 601
hunk ./compiler/main/Packages.lhs 57
-#if __GLASGOW_HASKELL__ < 603
+#if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ < 603
hunk ./compiler/main/SysTools.lhs 75
-#if __GLASGOW_HASKELL__ < 603
+#if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ < 603
hunk ./compiler/main/SysTools.lhs 484
-#if __GLASGOW_HASKELL__ < 603
+#if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ < 603
hunk ./compiler/main/SysTools.lhs 751
-#if __GLASGOW_HASKELL__ < 603
+#if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ < 603
hunk ./compiler/utils/Binary.hs 48
+#ifdef __GLASGOW_HASKELL__
hunk ./compiler/utils/Binary.hs 53
+#endif
hunk ./compiler/utils/Binary.hs 89
-#if __GLASGOW_HASKELL__ < 601
+#if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ < 601
hunk ./compiler/utils/Binary.hs 97
-#if __GLASGOW_HASKELL__ < 601
+#if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ < 601
hunk ./compiler/utils/Binary.hs 462
-#ifdef __GLASGOW_HASKELL__
+#if defined(__GLASGOW_HASKELL__) || 1
+--to quote binary-0.3 on this code idea,
+--
+-- TODO This instance is not architecture portable. GMP stores numbers as
+-- arrays of machine sized words, so the byte format is not portable across
+-- architectures with different endianess and word size.
+--
+-- This makes it hard (impossible) to make an equivalent instance
+-- with code that is compilable with non-GHC. Do we need any instance
+-- Binary Integer, and if so, does it have to be blazing fast? Or can
+-- we just change this instance to be portable like the rest of the
+-- instances? (binary package has code to steal for that)
+--
+-- yes, we need Binary Integer and Binary Rational in basicTypes/Literal.lhs
+
hunk ./compiler/utils/Binary.hs 496
+-- As for the rest of this code, even though this module
+-- exports it, it doesn't seem to be used anywhere else
+-- in GHC!
+
hunk ./compiler/utils/Digraph.lhs 57
-#if __GLASGOW_HASKELL__ > 604
+#if !defined(__GLASGOW_HASKELL__) || __GLASGOW_HASKELL__ > 604
hunk ./compiler/utils/FastString.lhs 503
-#if __GLASGOW_HASKELL__ <= 602
+#if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ <= 602
hunk ./compiler/utils/FiniteMap.lhs 682
-#if __GLASGOW_HASKELL__
+#ifdef __GLASGOW_HASKELL__
hunk ./compiler/utils/Panic.lhs 122
-#if __GLASGOW_HASKELL__ < 603
+#if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ < 603
hunk ./compiler/utils/StringBuffer.lhs 59
-#if __GLASGOW_HASKELL__ >= 601
+#if !defined(__GLASGOW_HASKELL__) || __GLASGOW_HASKELL__ >= 601
hunk ./compiler/utils/StringBuffer.lhs 65
-#if __GLASGOW_HASKELL__ < 601
+#if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ < 601
hunk ./compiler/utils/UniqSet.lhs 127
-#if __GLASGOW_HASKELL__
+#ifdef __GLASGOW_HASKELL__
hunk ./compiler/utils/Util.lhs 92
-#if defined(DEBUG) || __GLASGOW_HASKELL__ < 604
+#if defined(DEBUG) || (defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ < 604)
hunk ./compiler/utils/Util.lhs 369
-#if __GLASGOW_HASKELL__ < 604
+#if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ < 604
}
[MyEither-->EitherString to allow Haskell98 instance
Isaac Dupree <id at isaac.cedarswampstudios.org>**20080104192121] {
hunk ./compiler/parser/HaddockParse.y 12
- MyEither(..)
+ EitherString(..)
hunk ./compiler/parser/HaddockParse.y 38
-%monad { MyEither String }
+%monad { EitherString }
hunk ./compiler/parser/HaddockParse.y 101
-happyError :: [Token] -> MyEither String a
+happyError :: [Token] -> EitherString a
hunk ./compiler/parser/HaddockParse.y 107
-data MyEither a b = MyLeft a | MyRight b
+-- But why use non-Haskell98 instances when MyEither String
+-- is the only MyEither we're intending to use anyway? --Isaac Dupree
+--data MyEither a b = MyLeft a | MyRight b
+data EitherString b = MyLeft String | MyRight b
hunk ./compiler/parser/HaddockParse.y 112
-instance Monad (MyEither String) where
+instance Monad EitherString where
}
[re-portabilize Pretty, and corresponding changes
Isaac Dupree <id at isaac.cedarswampstudios.org>**20080104211329] {
hunk ./compiler/utils/BufWrite.hs 33
+import FastTypes
hunk ./compiler/utils/BufWrite.hs 41
-import GHC.IOBase ( IO(..) )
-import GHC.Ptr ( Ptr(..) )
-
-import GHC.Exts ( Int(..), Int#, Addr# )
-
hunk ./compiler/utils/BufWrite.hs 99
-bPutLitString :: BufHandle -> Addr# -> Int# -> IO ()
-bPutLitString b@(BufHandle buf r hdl) a# len# = do
- let len = I# len#
+bPutLitString :: BufHandle -> LitString -> FastInt -> IO ()
+bPutLitString b@(BufHandle buf r hdl) a len_ = a `seq` do
+ let len = iBox len_
hunk ./compiler/utils/BufWrite.hs 107
- then hPutBuf hdl (Ptr a#) len
- else bPutLitString b a# len#
+ then hPutBuf hdl a len
+ else bPutLitString b a len_
hunk ./compiler/utils/BufWrite.hs 110
- copyBytes (buf `plusPtr` i) (Ptr a#) len
+ copyBytes (buf `plusPtr` i) a len
hunk ./compiler/utils/FastString.lhs 69
+ unpackLitString,
hunk ./compiler/utils/FastString.lhs 88
+#if !defined(__GLASGOW_HASKELL__)
+import Data.Char ( chr, ord )
+#endif
hunk ./compiler/utils/FastString.lhs 490
+unpackLitString :: LitString -> String
+#if defined(__GLASGOW_HASKELL__)
+unpackLitString (Ptr addr) =
+ unpack 0#
+ where
+ unpack nh
+ | ch `eqChar#` '\0'# = []
+ | otherwise = C# ch : unpack (nh +# 1#)
+ where
+ ch = indexCharOffAddr# addr nh
+#else
+unpackLitString p =
+ unpack 0
+ where
+ unpack n
+ | ch == '\0' = []
+ | otherwise = ch : unpack (n + 1)
+ where
+ ch = chr (fromIntegral io) --inefficient checked chr?
+ io :: Word8
+ io = inlinePerformIO (peekByteOff p n)
+#endif
+
hunk ./compiler/utils/Outputable.lhs 339
-ptext :: Ptr t -> SDoc
+ptext :: Ptr () -> SDoc
hunk ./compiler/utils/Pretty.lhs 189
-
-import GHC.Exts
+import FastTypes
hunk ./compiler/utils/Pretty.lhs 193
+--import Foreign.Ptr (castPtr)
hunk ./compiler/utils/Pretty.lhs 195
+#if defined(__GLASGOW_HASKELL__)
+--for a RULES
hunk ./compiler/utils/Pretty.lhs 199
+#endif
hunk ./compiler/utils/Pretty.lhs 209
-
-*********************************************************
-* *
-\subsection{CPP magic so that we can compile with both GHC and Hugs}
-* *
-*********************************************************
-
-The library uses unboxed types to get a bit more speed, but these CPP macros
-allow you to use either GHC or Hugs. To get GHC, just set the CPP variable
- __GLASGOW_HASKELL__
-
hunk ./compiler/utils/Pretty.lhs 211
-#if defined(__GLASGOW_HASKELL__)
-
--- Glasgow Haskell
-
hunk ./compiler/utils/Pretty.lhs 214
-#define ILIT(x) (x#)
-#define IBOX(x) (I# (x))
-#define INT Int#
-#define MINUS -#
-#define NEGATE negateInt#
-#define PLUS +#
-#define GR >#
-#define GREQ >=#
-#define LT <#
-#define LTEQ <=#
-#define DIV `quotInt#`
-
-
-#define SHOW Show
-#define MAXINT maxBound
-
-#else
-
--- Standard Haskell
-
-#define LOCAL_ASSERT(x)
-
-#define INT Int
-#define IBOX(x) x
-#define MINUS -
-#define NEGATE negate
-#define PLUS +
-#define GR >
-#define GREQ >=
-#define LT <
-#define DIV `quot`
-#define ILIT(x) x
-
-#define SHOW Show
-#define MAXINT maxBound
-
-#endif
-
hunk ./compiler/utils/Pretty.lhs 274
-instance SHOW Doc where
+instance Show Doc where
hunk ./compiler/utils/Pretty.lhs 444
- | TextBeside !TextDetails INT Doc -- text s <> x
- | Nest INT Doc -- nest k x
+ | TextBeside !TextDetails FastInt Doc -- text s <> x
+ | Nest FastInt Doc -- nest k x
hunk ./compiler/utils/Pretty.lhs 463
- | LStr Addr# Int# -- a '\0'-terminated array of bytes
+ | LStr {-#UNPACK#-}!LitString FastInt -- a '\0'-terminated array of bytes
hunk ./compiler/utils/Pretty.lhs 550
-char c = textBeside_ (Chr c) 1# Empty
-text s = case length s of {IBOX(sl) -> textBeside_ (Str s) sl Empty}
-ftext s = case lengthFS s of {IBOX(sl) -> textBeside_ (PStr s) sl Empty}
-ptext (Ptr s) = case strLength (Ptr s) of {IBOX(sl) -> textBeside_ (LStr s sl) sl Empty}
+char c = textBeside_ (Chr c) (_ILIT(1)) Empty
+text s = case iUnbox (length s) of {sl -> textBeside_ (Str s) sl Empty}
+ftext s = case iUnbox (lengthFS s) of {sl -> textBeside_ (PStr s) sl Empty}
+ptext s_= case iUnbox (strLength s) of {sl -> textBeside_ (LStr s sl) sl Empty}
+ where s = {-castPtr-} s_
hunk ./compiler/utils/Pretty.lhs 556
+#if defined(__GLASGOW_HASKELL__)
hunk ./compiler/utils/Pretty.lhs 562
+#endif
hunk ./compiler/utils/Pretty.lhs 564
-nest IBOX(k) p = mkNest k (reduceDoc p) -- Externally callable version
+nest k p = mkNest (iUnbox k) (reduceDoc p) -- Externally callable version
hunk ./compiler/utils/Pretty.lhs 567
-mkNest k (Nest k1 p) = mkNest (k PLUS k1) p
+mkNest k (Nest k1 p) = mkNest (k +# k1) p
hunk ./compiler/utils/Pretty.lhs 570
-mkNest ILIT(0) p = p -- Worth a try!
+mkNest k p | k ==# _ILIT(0) = p -- Worth a try!
hunk ./compiler/utils/Pretty.lhs 591
-above p@(Beside _ _ _) g q = aboveNest (reduceDoc p) g ILIT(0) (reduceDoc q)
-above p g q = aboveNest p g ILIT(0) (reduceDoc q)
+above p@(Beside _ _ _) g q = aboveNest (reduceDoc p) g (_ILIT(0)) (reduceDoc q)
+above p g q = aboveNest p g (_ILIT(0)) (reduceDoc q)
hunk ./compiler/utils/Pretty.lhs 594
-aboveNest :: RDoc -> Bool -> INT -> RDoc -> RDoc
+aboveNest :: RDoc -> Bool -> FastInt -> RDoc -> RDoc
hunk ./compiler/utils/Pretty.lhs 602
-aboveNest (Nest k1 p) g k q = nest_ k1 (aboveNest p g (k MINUS k1) q)
+aboveNest (Nest k1 p) g k q = nest_ k1 (aboveNest p g (k -# k1) q)
hunk ./compiler/utils/Pretty.lhs 608
- k1 = k MINUS sl
+ k1 = k -# sl
hunk ./compiler/utils/Pretty.lhs 615
-nilAboveNest :: Bool -> INT -> RDoc -> RDoc
+nilAboveNest :: Bool -> FastInt -> RDoc -> RDoc
hunk ./compiler/utils/Pretty.lhs 620
-nilAboveNest g k (Nest k1 q) = nilAboveNest g (k PLUS k1) q
+nilAboveNest g k (Nest k1 q) = nilAboveNest g (k +# k1) q
hunk ./compiler/utils/Pretty.lhs 622
-nilAboveNest g k q | (not g) && (k GR ILIT(0)) -- No newline if no overlap
+nilAboveNest g k q | (not g) && (k ># _ILIT(0)) -- No newline if no overlap
hunk ./compiler/utils/Pretty.lhs 667
-nilBeside g p | g = textBeside_ space_text ILIT(1) p
+nilBeside g p | g = textBeside_ space_text (_ILIT(1)) p
hunk ./compiler/utils/Pretty.lhs 686
-sepX x (p:ps) = sep1 x (reduceDoc p) ILIT(0) ps
+sepX x (p:ps) = sep1 x (reduceDoc p) (_ILIT(0)) ps
hunk ./compiler/utils/Pretty.lhs 693
-sep1 :: Bool -> RDoc -> INT -> [Doc] -> RDoc
+sep1 :: Bool -> RDoc -> FastInt -> [Doc] -> RDoc
hunk ./compiler/utils/Pretty.lhs 700
-sep1 g (Nest n p) k ys = nest_ n (sep1 g p (k MINUS n) ys)
+sep1 g (Nest n p) k ys = nest_ n (sep1 g p (k -# n) ys)
hunk ./compiler/utils/Pretty.lhs 703
-sep1 g (TextBeside s sl p) k ys = textBeside_ s sl (sepNB g p (k MINUS sl) ys)
+sep1 g (TextBeside s sl p) k ys = textBeside_ s sl (sepNB g p (k -# sl) ys)
hunk ./compiler/utils/Pretty.lhs 740
-fill g (p:ps) = fill1 g (reduceDoc p) ILIT(0) ps
+fill g (p:ps) = fill1 g (reduceDoc p) (_ILIT(0)) ps
hunk ./compiler/utils/Pretty.lhs 743
-fill1 :: Bool -> RDoc -> INT -> [Doc] -> Doc
+fill1 :: Bool -> RDoc -> FastInt -> [Doc] -> Doc
hunk ./compiler/utils/Pretty.lhs 750
-fill1 g (Nest n p) k ys = nest_ n (fill1 g p (k MINUS n) ys)
+fill1 g (Nest n p) k ys = nest_ n (fill1 g p (k -# n) ys)
hunk ./compiler/utils/Pretty.lhs 753
-fill1 g (TextBeside s sl p) k ys = textBeside_ s sl (fillNB g p (k MINUS sl) ys)
+fill1 g (TextBeside s sl p) k ys = textBeside_ s sl (fillNB g p (k -# sl) ys)
hunk ./compiler/utils/Pretty.lhs 761
- k1 | g = k MINUS ILIT(1)
+ k1 | g = k -# _ILIT(1)
hunk ./compiler/utils/Pretty.lhs 780
-best IBOX(w) IBOX(r) p
- = get w p
+best w_ r_ p
+ = get (iUnbox w_) p
hunk ./compiler/utils/Pretty.lhs 783
- get :: INT -- (Remaining) width of line
+ r = iUnbox r_
+ get :: FastInt -- (Remaining) width of line
hunk ./compiler/utils/Pretty.lhs 790
- get w (Nest k p) = nest_ k (get (w MINUS k) p)
+ get w (Nest k p) = nest_ k (get (w -# k) p)
hunk ./compiler/utils/Pretty.lhs 793
- get1 :: INT -- (Remaining) width of line
- -> INT -- Amount of first line already eaten up
+ get1 :: FastInt -- (Remaining) width of line
+ -> FastInt -- Amount of first line already eaten up
hunk ./compiler/utils/Pretty.lhs 800
- get1 w sl (NilAbove p) = nilAbove_ (get (w MINUS sl) p)
- get1 w sl (TextBeside t tl p) = textBeside_ t tl (get1 w (sl PLUS tl) p)
+ get1 w sl (NilAbove p) = nilAbove_ (get (w -# sl) p)
+ get1 w sl (TextBeside t tl p) = textBeside_ t tl (get1 w (sl +# tl) p)
hunk ./compiler/utils/Pretty.lhs 806
-nicest w r p q = nicest1 w r ILIT(0) p q
-nicest1 w r sl p q | fits ((w `minn` r) MINUS sl) p = p
+nicest w r p q = nicest1 w r (_ILIT(0)) p q
+nicest1 w r sl p q | fits ((w `minFastInt` r) -# sl) p = p
hunk ./compiler/utils/Pretty.lhs 810
-fits :: INT -- Space available
+fits :: FastInt -- Space available
hunk ./compiler/utils/Pretty.lhs 814
-fits n p | n LT ILIT(0) = False
+fits n p | n <# _ILIT(0) = False
hunk ./compiler/utils/Pretty.lhs 818
-fits n (TextBeside _ sl p) = fits (n MINUS sl) p
-
-minn x y | x LT y = x
- | otherwise = y
+fits n (TextBeside _ sl p) = fits (n -# sl) p
hunk ./compiler/utils/Pretty.lhs 876
-
-unpackLitString addr =
- unpack 0#
- where
- unpack nh
- | ch `eqChar#` '\0'# = []
- | otherwise = C# ch : unpack (nh +# 1#)
- where
- ch = indexCharOffAddr# addr nh
hunk ./compiler/utils/Pretty.lhs 907
- hacked_line_length = case mode of { ZigZagMode -> MAXINT; other -> line_length }
+ hacked_line_length = case mode of { ZigZagMode -> maxBound; other -> line_length }
hunk ./compiler/utils/Pretty.lhs 909
-display mode IBOX(page_width) IBOX(ribbon_width) txt end doc
- = case page_width MINUS ribbon_width of { gap_width ->
- case gap_width DIV ILIT(2) of { shift ->
+display mode page_width ribbon_width txt end doc
+ = case (iUnbox page_width) -# (iUnbox ribbon_width) of { gap_width ->
+ case gap_width `quotFastInt` _ILIT(2) of { shift ->
hunk ./compiler/utils/Pretty.lhs 913
- lay k (Nest k1 p) = lay (k PLUS k1) p
+ lay k (Nest k1 p) = lay (k +# k1) p
hunk ./compiler/utils/Pretty.lhs 920
- ZigZagMode | k GREQ gap_width
+ ZigZagMode | k >=# gap_width
hunk ./compiler/utils/Pretty.lhs 924
- lay1 (k MINUS shift) s sl p)))
+ lay1 (k -# shift) s sl p)))
hunk ./compiler/utils/Pretty.lhs 926
- | k LT ILIT(0)
+ | k <# _ILIT(0)
hunk ./compiler/utils/Pretty.lhs 930
- lay1 (k PLUS shift) s sl p )))
+ lay1 (k +# shift) s sl p )))
hunk ./compiler/utils/Pretty.lhs 934
- lay1 k s sl p = indent k (s `txt` lay2 (k PLUS sl) p)
+ lay1 k s sl p = indent k (s `txt` lay2 (k +# sl) p)
hunk ./compiler/utils/Pretty.lhs 937
- lay2 k (TextBeside s sl p) = s `txt` (lay2 (k PLUS sl) p)
+ lay2 k (TextBeside s sl p) = s `txt` (lay2 (k +# sl) p)
hunk ./compiler/utils/Pretty.lhs 942
- indent n r | n GREQ ILIT(8) = LStr " "# 8# `txt`
- indent (n MINUS ILIT(8)) r
+ indent n r | n >=# _ILIT(8) = LStr SLIT(" ") (_ILIT(8)) `txt`
+ indent (n -# _ILIT(8)) r
hunk ./compiler/utils/Pretty.lhs 946
- lay ILIT(0) doc
+ lay (_ILIT(0)) doc
hunk ./compiler/utils/Pretty.lhs 951
-multi_ch n ch | n LTEQ ILIT(0) = ""
- | otherwise = ch : multi_ch (n MINUS ILIT(1)) ch
+multi_ch n ch | n <=# _ILIT(0) = ""
+ | otherwise = ch : multi_ch (n -# _ILIT(1)) ch
hunk ./compiler/utils/Pretty.lhs 954
-spaces n | n LTEQ ILIT(0) = ""
- | otherwise = ' ' : spaces (n MINUS ILIT(1))
+spaces n | n <=# _ILIT(0) = ""
+ | otherwise = ' ' : spaces (n -# _ILIT(1))
hunk ./compiler/utils/Pretty.lhs 977
-hPutLitString handle a# 0# = return ()
-hPutLitString handle a# l#
- = hPutBuf handle (Ptr a#) (I# l#)
+hPutLitString handle a l = if l ==# _ILIT(0)
+ then return ()
+ else hPutBuf handle a (iBox l)
}
[Augment FastTypes to be much more complete
Isaac Dupree <id at isaac.cedarswampstudios.org>**20080104221955] {
hunk ./compiler/utils/FastTypes.lhs 4
-\section{Fast integers and booleans}
+\section{Fast integers, booleans, etc}
hunk ./compiler/utils/FastTypes.lhs 7
-{-# OPTIONS -w #-}
--- The above warning supression flag is a temporary kludge.
--- While working on this module you are encouraged to remove it and fix
--- any warnings in the module. See
--- http://hackage.haskell.org/trac/ghc/wiki/Commentary/CodingStyle#Warnings
--- for details
hunk ./compiler/utils/FastTypes.lhs 8
+--Even if the optimizer could handle boxed arithmetic equally well,
+--this helps automatically check the sources to make sure that
+--it's only used in an appropriate pattern of efficiency.
+--(it also makes `let`s and `case`s stricter...)
+
hunk ./compiler/utils/FastTypes.lhs 16
- (==#), (<#), (<=#), (>=#), (>#),
+ --quotRemFastInt is difficult because unboxed values can't
+ --be tupled, but unboxed tuples aren't portable. Just use
+ -- nuisance boxed quotRem and rely on optimization.
+ (==#), (/=#), (<#), (<=#), (>=#), (>#),
+ minFastInt, maxFastInt,
+ --prefer to distinguish operations, not types, between
+ --signed and unsigned.
+ --left-shift is the same for 'signed' and 'unsigned' numbers
+ shiftLFastInt,
+ --right-shift isn't the same for negative numbers (ones with
+ --the highest-order bit '1'). If you don't care because the
+ --number you're shifting is always nonnegative, use the '_' version
+ --which should just be the fastest one.
+ shiftR_FastInt,
+ --"L' = logical or unsigned shift; 'A' = arithmetic or signed shift
+ shiftRLFastInt, shiftRAFastInt,
+ bitAndFastInt, bitOrFastInt,
+ --add more operations to this file as you need them
+
+ --fastBool could be called bBox; isFastTrue, bUnbox; but they're not
+ FastBool, fastBool, isFastTrue, fastOr, fastAnd,
hunk ./compiler/utils/FastTypes.lhs 38
- FastBool, fastBool, isFastTrue, fastOr, fastAnd
+ --note, fastChr is "unsafe"Chr: it doesn't check for
+ --character values above the range of Unicode
+ FastChar, _CLIT, cBox, cUnbox, fastOrd, fastChr, eqFastChar,
+
+ FastPtr, pBox, pUnbox, castFastPtr
hunk ./compiler/utils/FastTypes.lhs 45
+#define COMPILING_FAST_STRING
hunk ./compiler/utils/FastTypes.lhs 52
- ( Int(..), Int#, (+#), (-#), (*#),
- quotInt#, negateInt#, (==#), (<#), (<=#), (>=#), (>#)
- )
hunk ./compiler/utils/FastTypes.lhs 54
-_ILIT (I# x) = x
+
+--in case it's a macro, don't lexically feed an argument!
+--e.g. #define _ILIT(x) (x#) , #define _ILIT(x) (x :: FastInt)
+_ILIT = \(I# x) -> x
+--perhaps for accomodating caseless-leading-underscore treatment,
+--something like _iLIT or iLIT would be better?
+
hunk ./compiler/utils/FastTypes.lhs 66
+--I think uncheckedIShiftL# and uncheckedIShiftRL# are the same
+--as uncheckedShiftL# and uncheckedShiftRL# ...
+--should they be used? How new are they?
+--They existed as far back as GHC 6.0 at least...
+shiftLFastInt x y = uncheckedIShiftL# x y
+shiftR_FastInt x y = uncheckedIShiftRL# x y
+shiftRLFastInt x y = uncheckedIShiftRL# x y
+shiftRAFastInt x y = uncheckedIShiftRA# x y
+--{-# INLINE shiftLNonnegativeFastInt #-}
+--{-# INLINE shiftRNonnegativeFastInt #-}
+--shiftLNonnegativeFastInt n p = word2Int#((int2Word# n) `uncheckedShiftL#` p)
+--shiftRNonnegativeFastInt n p = word2Int#((int2Word# n) `uncheckedShiftRL#` p)
+bitAndFastInt x y = word2Int# (and# (int2Word# x) (int2Word# y))
+bitOrFastInt x y = word2Int# (or# (int2Word# x) (int2Word# y))
+
hunk ./compiler/utils/FastTypes.lhs 84
-isFastTrue x = x ==# 1#
+--isFastTrue x = x ==# 1#
+--Isn't comparison to zero sometimes faster? (since using Int# as
+-- _synonym_ fails to guarantee that it will only take on values of 0 and 1)
+isFastTrue x = x /=# 0#
hunk ./compiler/utils/FastTypes.lhs 91
-fastOr 1# _ = 1#
+-- Also, to avoid incomplete-pattern warning
+-- (and avoid wasting time with redundant runtime checks),
+-- we don't pattern-match on both 0# and 1# .
hunk ./compiler/utils/FastTypes.lhs 95
+fastOr _ _ = 1#
hunk ./compiler/utils/FastTypes.lhs 97
-fastAnd 0# x = 0#
-fastAnd 1# x = x
+fastAnd 0# _ = 0#
+fastAnd _ x = x
hunk ./compiler/utils/FastTypes.lhs 100
+type FastChar = Char#
+_CLIT = \(C# c) -> c
+cBox c = C# c
+cUnbox (C# c) = c
+fastOrd c = ord# c
+fastChr x = chr# x
+eqFastChar a b = eqChar# a b
+
+--note that the type-parameter doesn't provide any safety
+--when it's a synonym, but as long as we keep it compiling
+--with and without __GLASGOW_HASKELL__ defined, it's fine.
+type FastPtr a = Addr#
+pBox p = Ptr p
+pUnbox (Ptr p) = p
+castFastPtr p = p
+
hunk ./compiler/utils/FastTypes.lhs 118
+import Data.Char (ord, chr)
+
+import Data.Bits
+import Data.Word (Word) --is it a good idea to assume this exists too?
+--does anyone need shiftRLFastInt? (apparently yes.)
+
+import Foreign.Ptr
+
hunk ./compiler/utils/FastTypes.lhs 134
+--quotRemFastInt = quotRem
hunk ./compiler/utils/FastTypes.lhs 137
+(/=#) = (/=)
hunk ./compiler/utils/FastTypes.lhs 142
+shiftLFastInt = shiftL
+shiftR_FastInt = shiftR
+shiftRAFastInt = shiftR
+shiftRLFastInt n p = fromIntegral (shiftR (fromIntegral n :: Word) p)
+--shiftLFastInt n p = n * (2 ^ p)
+--assuming quot-Int is faster and the
+--same for nonnegative arguments than div-Int
+--shiftR_FastInt n p = n `quot` (2 ^ p)
+--shiftRAFastInt n p = n `div` (2 ^ p)
+--I couldn't figure out how to implement without Word nor Bits
+--shiftRLFastInt n p = fromIntegral ((fromIntegral n :: Word) `quot` (2 ^ (fromIntegral p :: Word)))
+
+bitAndFastInt = (.&.)
+bitOrFastInt = (.|.)
hunk ./compiler/utils/FastTypes.lhs 167
+type FastChar = Char
+_CLIT c = c
+cBox c = c
+cUnbox c = c
+fastOrd = ord
+fastChr = chr --or unsafeChr if there was a standard location for it
+eqFastChar = (==)
+
+type FastPtr a = Ptr a
+pBox p = p
+pUnbox p = p
+castFastPtr = castPtr
+
hunk ./compiler/utils/FastTypes.lhs 183
-(+#) :: FastInt -> FastInt -> FastInt
-(-#) :: FastInt -> FastInt -> FastInt
-(*#) :: FastInt -> FastInt -> FastInt
-(==#) :: FastInt -> FastInt -> Bool
-(<#) :: FastInt -> FastInt -> Bool
-(<=#) :: FastInt -> FastInt -> Bool
-(>=#) :: FastInt -> FastInt -> Bool
-(>#) :: FastInt -> FastInt -> Bool
+(+#), (-#), (*#) :: FastInt -> FastInt -> FastInt
+(==#), (/=#), (<#), (<=#), (>=#), (>#) :: FastInt -> FastInt -> Bool
hunk ./compiler/utils/FastTypes.lhs 188
+minFastInt, maxFastInt :: FastInt -> FastInt -> FastInt
+minFastInt x y = if x <# y then x else y
+maxFastInt x y = if x <# y then y else x
+
hunk ./compiler/utils/FastTypes.lhs 200
+shiftLFastInt, shiftR_FastInt, shiftRAFastInt, shiftRLFastInt
+ :: FastInt -> FastInt -> FastInt
+bitAndFastInt, bitOrFastInt :: FastInt -> FastInt -> FastInt
hunk ./compiler/utils/FastTypes.lhs 209
+_CLIT :: Char -> FastChar
+cBox :: FastChar -> Char
+cUnbox :: Char -> FastChar
+fastOrd :: FastChar -> FastInt
+fastChr :: FastInt -> FastChar
+eqFastChar :: FastChar -> FastChar -> Bool
+
+pBox :: FastPtr a -> Ptr a
+pUnbox :: Ptr a -> FastPtr a
+castFastPtr :: FastPtr a -> FastPtr b
+
}
[use FastFunctions, cleanup FastString slightly
Isaac Dupree <id at isaac.cedarswampstudios.org>**20080105011419] {
hunk ./compiler/HsVersions.h 67
+#if defined(__GLASGOW_HASKELL__)
hunk ./compiler/HsVersions.h 70
+#else
+#define SLIT(x) (FS.mkLitString (x))
+#define FSLIT(x) (FS.mkFastString (x))
+#endif
hunk ./compiler/utils/FastString.lhs 36
+#if defined(__GLASGOW_HASKELL__)
hunk ./compiler/utils/FastString.lhs 38
+#endif
hunk ./compiler/utils/FastString.lhs 70
+#if defined(__GLASGOW_HASKELL__)
hunk ./compiler/utils/FastString.lhs 72
+#else
+ mkLitString,
+#endif
hunk ./compiler/utils/FastString.lhs 76
- strLength
+ strLength,
+
+ ptrStrLength
hunk ./compiler/utils/FastString.lhs 87
+import FastTypes
+import FastFunctions
hunk ./compiler/utils/FastString.lhs 98
-#if !defined(__GLASGOW_HASKELL__)
-import Data.Char ( chr, ord )
-#endif
+import Data.Char ( ord )
hunk ./compiler/utils/FastString.lhs 203
-mkFastString# a# = mkFastStringBytes ptr (strLength ptr)
+mkFastString# a# = mkFastStringBytes ptr (ptrStrLength ptr)
hunk ./compiler/utils/FastString.lhs 367
- loop h n | n ==# len# = I# h
- | otherwise = loop h2 (n +# 1#)
+ loop h n | n GHC.Exts.==# len# = I# h
+ | otherwise = loop h2 (n GHC.Exts.+# 1#)
hunk ./compiler/utils/FastString.lhs 370
- h2 = (c +# (h *# 128#)) `remInt#` hASH_TBL_SIZE#
+ h2 = (c GHC.Exts.+# (h GHC.Exts.*# 128#)) `remInt#` hASH_TBL_SIZE#
hunk ./compiler/utils/FastString.lhs 461
-uniqueOfFS :: FastString -> Int#
-uniqueOfFS (FastString (I# u#) _ _ _ _) = u#
+uniqueOfFS :: FastString -> FastInt
+uniqueOfFS (FastString u _ _ _ _) = iUnbox u
hunk ./compiler/utils/FastString.lhs 490
-type LitString = Ptr ()
+-- hmm, not unboxed (or rather FastPtr), interesting
+--a.k.a. Ptr CChar, Ptr Word8, Ptr (), hmph. We don't
+--really care about C types in naming, where we can help it.
+type LitString = Ptr Word8
+--Why do we recalculate length every time it's requested?
+--If it's commonly needed, we should perhaps have
+--data LitString = LitString {-#UNPACK#-}!(FastPtr Word8) {-#UNPACK#-}!FastInt
hunk ./compiler/utils/FastString.lhs 498
+#if defined(__GLASGOW_HASKELL__)
hunk ./compiler/utils/FastString.lhs 501
+#endif
hunk ./compiler/utils/FastString.lhs 503
-foreign import ccall unsafe "ghc_strlen"
- strLength :: Ptr () -> Int
+--can/should we use FastTypes here?
+--Is this likely to be memory-preserving if only used on constant strings?
+--should we inline it? If lucky, that would make a CAF that wouldn't
+--be computationally repeated... although admittedly we're not
+--really intending to use mkLitString when __GLASGOW_HASKELL__...
+--(I wonder, is unicode / multi-byte characters allowed in LitStrings
+-- at all?)
+{-# INLINE mkLitString #-}
+mkLitString :: String -> LitString
+mkLitString s =
+ unsafePerformIO (do
+ p <- mallocBytes (length s + 1)
+ let
+ loop :: Int -> String -> IO ()
+ loop n cs | n `seq` null cs = pokeByteOff p n (0 :: Word8)
+ loop n (c:cs) = do
+ pokeByteOff p n (fromIntegral (ord c) :: Word8)
+ loop (1+n) cs
+ loop 0 s
+ return p
+ )
hunk ./compiler/utils/FastString.lhs 526
-#if defined(__GLASGOW_HASKELL__)
-unpackLitString (Ptr addr) =
- unpack 0#
- where
- unpack nh
- | ch `eqChar#` '\0'# = []
- | otherwise = C# ch : unpack (nh +# 1#)
- where
- ch = indexCharOffAddr# addr nh
-#else
-unpackLitString p =
- unpack 0
+unpackLitString p_ = case pUnbox p_ of
+ p -> unpack (_ILIT(0))
hunk ./compiler/utils/FastString.lhs 529
- unpack n
- | ch == '\0' = []
- | otherwise = ch : unpack (n + 1)
- where
- ch = chr (fromIntegral io) --inefficient checked chr?
- io :: Word8
- io = inlinePerformIO (peekByteOff p n)
+ unpack n = case indexWord8OffFastPtrAsFastChar p n of
+ ch -> if ch `eqFastChar` _CLIT('\0')
+ then [] else cBox ch : unpack (n +# _ILIT(1))
+
+strLength :: LitString -> Int
+strLength = ptrStrLength
+
+-- for now, use a simple String representation
+--no, let's not do that right now - it's work in other places
+#if 0
+type LitString = String
+
+mkLitString :: String -> LitString
+mkLitString = id
+
+unpackLitString :: LitString -> String
+unpackLitString = id
+
+strLength :: LitString -> Int
+strLength = length
+
hunk ./compiler/utils/FastString.lhs 555
--- Just like unsafePerformIO, but we inline it.
-{-# INLINE inlinePerformIO #-}
-inlinePerformIO :: IO a -> a
-inlinePerformIO (IO m) = case m realWorld# of (# _, r #) -> r
+foreign import ccall unsafe "ghc_strlen"
+ ptrStrLength :: Ptr Word8 -> Int
hunk ./compiler/utils/FastString.lhs 559
+-- We only use CChar here to be parallel to the imported
+-- peekC(A)StringLen.
hunk ./compiler/utils/Outputable.lhs 62
-import GHC.Ptr
hunk ./compiler/utils/Outputable.lhs 338
-ptext :: Ptr () -> SDoc
+ptext :: LitString -> SDoc
hunk ./compiler/utils/StringBuffer.lhs 50
+import FastTypes
+import FastFunctions
hunk ./compiler/utils/StringBuffer.lhs 58
-import GHC.IOBase ( IO(..) )
-import GHC.Base ( unsafeChr )
hunk ./compiler/utils/StringBuffer.lhs 219
-
+{-
hunk ./compiler/utils/StringBuffer.lhs 223
- w <- peek (ptr `plusPtr` (cur+i))
- return (unsafeChr (fromIntegral (w::Word8)))
-
+-- return $! cBox (indexWord8OffFastPtrAsFastChar
+-- (pUnbox ptr) (iUnbox (cur+i)))
+--or
+-- w <- peek (ptr `plusPtr` (cur+i))
+-- return (unsafeChr (fromIntegral (w::Word8)))
+-}
hunk ./compiler/utils/StringBuffer.lhs 231
-parseUnsignedInteger buf len radix char_to_int
- = go 0 0
- where
+parseUnsignedInteger (StringBuffer buf _ cur) len radix char_to_int
+ = inlinePerformIO $ withForeignPtr buf $ \ptr -> return $! let
+ --LOL, in implementations where the indexing needs slow unsafePerformIO,
+ --this is less (not more) efficient than using the IO monad explicitly
+ --here.
+ byteOff p i = cBox (indexWord8OffFastPtrAsFastChar
+ (pUnbox ptr) (iUnbox (cur+i)))
hunk ./compiler/utils/StringBuffer.lhs 239
- | otherwise = go (i+1)
- (x * radix + toInteger (char_to_int (byteOff buf i)))
-
--- -----------------------------------------------------------------------------
--- under the carpet
-
--- Just like unsafePerformIO, but we inline it.
-{-# INLINE inlinePerformIO #-}
-inlinePerformIO :: IO a -> a
-inlinePerformIO (IO m) = case m realWorld# of (# _, r #) -> r
+ | otherwise = case byteOff ptr i of
+ char -> go (i+1) (x * radix + toInteger (char_to_int char))
+ in go 0 0
}
[Massive de-"#", mostly Int# --> FastInt (#1405)
Isaac Dupree <id at isaac.cedarswampstudios.org>**20080105020022] {
hunk ./compiler/basicTypes/Name.lhs 57
+import FastTypes
hunk ./compiler/basicTypes/Name.lhs 62
-import GHC.Exts
hunk ./compiler/basicTypes/Name.lhs 75
- n_uniq :: Int#, -- UNPACK doesn't work, recursive type
+ n_uniq :: FastInt, -- UNPACK doesn't work, recursive type
+--(note later when changing Int# -> FastInt: is that still true about UNPACK?)
hunk ./compiler/basicTypes/Name.lhs 140
-nameUnique name = mkUniqueGrimily (I# (n_uniq name))
+nameUnique name = mkUniqueGrimily (iBox (n_uniq name))
hunk ./compiler/basicTypes/Name.lhs 197
-mkInternalName uniq occ loc = Name { n_uniq = getKey# uniq, n_sort = Internal, n_occ = occ, n_loc = loc }
+mkInternalName uniq occ loc = Name { n_uniq = getKeyFastInt uniq, n_sort = Internal, n_occ = occ, n_loc = loc }
hunk ./compiler/basicTypes/Name.lhs 209
- = Name { n_uniq = getKey# uniq, n_sort = External mod,
+ = Name { n_uniq = getKeyFastInt uniq, n_sort = External mod,
hunk ./compiler/basicTypes/Name.lhs 215
- = Name { n_uniq = getKey# uniq,
+ = Name { n_uniq = getKeyFastInt uniq,
hunk ./compiler/basicTypes/Name.lhs 220
-mkSystemName uniq occ = Name { n_uniq = getKey# uniq, n_sort = System,
+mkSystemName uniq occ = Name { n_uniq = getKeyFastInt uniq, n_sort = System,
hunk ./compiler/basicTypes/Name.lhs 231
-mkFCallName uniq str = Name { n_uniq = getKey# uniq, n_sort = Internal,
+mkFCallName uniq str = Name { n_uniq = getKeyFastInt uniq, n_sort = Internal,
hunk ./compiler/basicTypes/Name.lhs 236
- = Name { n_uniq = getKey# uniq, n_sort = Internal,
+ = Name { n_uniq = getKeyFastInt uniq, n_sort = Internal,
hunk ./compiler/basicTypes/Name.lhs 241
- = Name { n_uniq = getKey# uniq,
+ = Name { n_uniq = getKeyFastInt uniq,
hunk ./compiler/basicTypes/Name.lhs 252
-setNameUnique name uniq = name {n_uniq = getKey# uniq}
+setNameUnique name uniq = name {n_uniq = getKeyFastInt uniq}
hunk ./compiler/basicTypes/Name.lhs 288
-cmpName n1 n2 = I# (n_uniq n1) `compare` I# (n_uniq n2)
+cmpName n1 n2 = iBox (n_uniq n1) `compare` iBox (n_uniq n2)
hunk ./compiler/basicTypes/Name.lhs 351
-pprName name@(Name {n_sort = sort, n_uniq = u#, n_occ = occ})
+pprName name@(Name {n_sort = sort, n_uniq = u, n_occ = occ})
hunk ./compiler/basicTypes/Name.lhs 358
- where uniq = mkUniqueGrimily (I# u#)
+ where uniq = mkUniqueGrimily (iBox u)
hunk ./compiler/basicTypes/OccName.lhs 85
+import FastTypes
hunk ./compiler/basicTypes/OccName.lhs 259
- = mkUnique char (I# (uniqueOfFS fs))
+ = mkUnique char (iBox (uniqueOfFS fs))
hunk ./compiler/basicTypes/UniqSupply.lhs 34
-
-import GHC.Exts
-import System.IO.Unsafe ( unsafeInterleaveIO )
+import FastTypes
hunk ./compiler/basicTypes/UniqSupply.lhs 39
+import System.IO.Unsafe ( unsafeInterleaveIO )
hunk ./compiler/basicTypes/UniqSupply.lhs 44
-w2i x = word2Int# x
-i2w x = int2Word# x
-i2w_s x = (x :: Int#)
hunk ./compiler/basicTypes/UniqSupply.lhs 60
- = MkSplitUniqSupply Int# -- make the Unique with this
+ = MkSplitUniqSupply FastInt -- make the Unique with this
hunk ./compiler/basicTypes/UniqSupply.lhs 75
-mkSplitUniqSupply (C# c#)
- = let
- mask# = (i2w (ord# c#)) `uncheckedShiftL#` (i2w_s 24#)
+mkSplitUniqSupply c
+ = case fastOrd (cUnbox c) `shiftLFastInt` _ILIT(24) of
+ mask -> let
hunk ./compiler/basicTypes/UniqSupply.lhs 81
- mk_supply#
+ mk_supply
hunk ./compiler/basicTypes/UniqSupply.lhs 83
- genSymZh >>= \ (I# u#) ->
- mk_supply# >>= \ s1 ->
- mk_supply# >>= \ s2 ->
- return (MkSplitUniqSupply (w2i (mask# `or#` (i2w u#))) s1 s2)
- )
- in
- mk_supply#
+ genSymZh >>= \ u_ -> case iUnbox u_ of { u -> (
+ mk_supply >>= \ s1 ->
+ mk_supply >>= \ s2 ->
+ return (MkSplitUniqSupply (mask `bitOrFastInt` u) s1 s2)
+ )})
+ in
+ mk_supply
hunk ./compiler/basicTypes/UniqSupply.lhs 98
-uniqFromSupply (MkSplitUniqSupply n _ _) = mkUniqueGrimily (I# n)
-uniqsFromSupply (MkSplitUniqSupply n _ s2) = mkUniqueGrimily (I# n) : uniqsFromSupply s2
+uniqFromSupply (MkSplitUniqSupply n _ _) = mkUniqueGrimily (iBox n)
+uniqsFromSupply (MkSplitUniqSupply n _ s2) = mkUniqueGrimily (iBox n) : uniqsFromSupply s2
hunk ./compiler/basicTypes/Unique.lhs 33
- getKey, getKey#, -- Used in Var, UniqFM, Name only!
+ getKey, getKeyFastInt, -- Used in Var, UniqFM, Name only!
hunk ./compiler/basicTypes/Unique.lhs 62
+import FastTypes
hunk ./compiler/basicTypes/Unique.lhs 66
-import GHC.Exts
+#if defined(__GLASGOW_HASKELL__)
+--just for implementing a fast [0,61) -> Char function
+import GHC.Exts (indexCharOffAddr#, Char(..))
+#else
+import Data.Array
+#endif
hunk ./compiler/basicTypes/Unique.lhs 85
-data Unique = MkUnique Int#
+--why not newtype Int?
+data Unique = MkUnique FastInt
hunk ./compiler/basicTypes/Unique.lhs 98
-getKey# :: Unique -> Int# -- for Var
+getKeyFastInt :: Unique -> FastInt -- for Var
hunk ./compiler/basicTypes/Unique.lhs 109
-mkUniqueGrimily (I# x) = MkUnique x
+mkUniqueGrimily x = MkUnique (iUnbox x)
hunk ./compiler/basicTypes/Unique.lhs 112
-getKey (MkUnique x) = I# x
-{-# INLINE getKey# #-}
-getKey# (MkUnique x) = x
+getKey (MkUnique x) = iBox x
+{-# INLINE getKeyFastInt #-}
+getKeyFastInt (MkUnique x) = x
hunk ./compiler/basicTypes/Unique.lhs 116
-incrUnique (MkUnique i) = MkUnique (i +# 1#)
+incrUnique (MkUnique i) = MkUnique (i +# _ILIT(1))
hunk ./compiler/basicTypes/Unique.lhs 120
-deriveUnique (MkUnique i) delta = mkUnique 'X' (I# i + delta)
+deriveUnique (MkUnique i) delta = mkUnique 'X' (iBox i + delta)
hunk ./compiler/basicTypes/Unique.lhs 129
-w2i x = word2Int# x
-i2w x = int2Word# x
-i2w_s x = (x::Int#)
+-- and as long as the Char fits in 8 bits, which we assume anyway!
hunk ./compiler/basicTypes/Unique.lhs 131
-mkUnique (C# c) (I# i)
- = MkUnique (w2i (tag `or#` bits))
+mkUnique c i
+ = MkUnique (tag `bitOrFastInt` bits)
hunk ./compiler/basicTypes/Unique.lhs 134
- tag = i2w (ord# c) `uncheckedShiftL#` i2w_s 24#
- bits = i2w i `and#` (i2w 16777215#){-``0x00ffffff''-}
+ tag = fastOrd (cUnbox c) `shiftLFastInt` _ILIT(24)
+ bits = iUnbox i `bitAndFastInt` _ILIT(16777215){-``0x00ffffff''-}
hunk ./compiler/basicTypes/Unique.lhs 139
- tag = C# (chr# (w2i ((i2w u) `uncheckedShiftRL#` (i2w_s 24#))))
- i = I# (w2i ((i2w u) `and#` (i2w 16777215#){-``0x00ffffff''-}))
+ -- as long as the Char may have its eighth bit set, we
+ -- really do need the logical right-shift here!
+ tag = cBox (fastChr (u `shiftRLFastInt` _ILIT(24)))
+ i = iBox (u `bitAndFastInt` _ILIT(16777215){-``0x00ffffff''-})
hunk ./compiler/basicTypes/Unique.lhs 163
- getUnique fs = mkUniqueGrimily (I# (uniqueOfFS fs))
+ getUnique fs = mkUniqueGrimily (iBox (uniqueOfFS fs))
hunk ./compiler/basicTypes/Unique.lhs 248
-iToBase62 n@(I# n#)
- = ASSERT(n >= 0) go n# ""
+iToBase62 n_
+ = ASSERT(n_ >= 0) go (iUnbox n_) ""
hunk ./compiler/basicTypes/Unique.lhs 251
- go n# cs | n# <# 62#
- = case (indexCharOffAddr# chars62# n#) of { c# -> C# c# : cs }
+ go n cs | n <# _ILIT(62)
+ = case chooseChar62 n of { c -> c `seq` (c : cs) }
hunk ./compiler/basicTypes/Unique.lhs 254
- = case (quotRem (I# n#) 62) of { (I# q#, I# r#) ->
- case (indexCharOffAddr# chars62# r#) of { c# ->
- go q# (C# c# : cs) }}
+ = case (quotRem (iBox n) 62) of { (q_, r_) ->
+ case iUnbox q_ of { q -> case iUnbox r_ of { r ->
+ case (chooseChar62 r) of { c -> c `seq`
+ (go q (c : cs)) }}}}
hunk ./compiler/basicTypes/Unique.lhs 259
- chars62# = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"#
+ chooseChar62 :: FastInt -> Char
+ {-# INLINE chooseChar62 #-}
+#if defined(__GLASGOW_HASKELL__)
+ --then FastInt == Int#
+ chooseChar62 n = C# (indexCharOffAddr# chars62 n)
+ chars62 = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"#
+#else
+ --Haskell98 arrays are portable
+ chooseChar62 n = (!) chars62 n
+ chars62 = listArray (0,61) "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
+#endif
hunk ./compiler/basicTypes/Var.lhs 169
- = var { realUnique = getKey# uniq,
+ = var { realUnique = getKeyFastInt uniq,
hunk ./compiler/basicTypes/Var.lhs 174
- = var { realUnique = getKey# (getUnique new_name),
+ = var { realUnique = getKeyFastInt (getUnique new_name),
hunk ./compiler/basicTypes/Var.lhs 202
- , realUnique = getKey# (nameUnique name)
+ , realUnique = getKeyFastInt (nameUnique name)
hunk ./compiler/basicTypes/Var.lhs 212
- realUnique = getKey# (nameUnique name),
+ realUnique = getKeyFastInt (nameUnique name),
hunk ./compiler/basicTypes/Var.lhs 235
- , realUnique = getKey# (nameUnique name)
+ , realUnique = getKeyFastInt (nameUnique name)
hunk ./compiler/basicTypes/Var.lhs 333
- realUnique = getKey# (nameUnique name), -- Cache the unique
+ realUnique = getKeyFastInt (nameUnique name), -- Cache the unique
hunk ./compiler/basicTypes/Var.lhs 341
- realUnique = getKey# (nameUnique name), -- Cache the unique
+ realUnique = getKeyFastInt (nameUnique name), -- Cache the unique
hunk ./compiler/basicTypes/VarEnv.lhs 75
-emptyInScopeSet = InScope emptyVarSet 1#
+emptyInScopeSet = InScope emptyVarSet (_ILIT(1))
hunk ./compiler/basicTypes/VarEnv.lhs 81
-mkInScopeSet in_scope = InScope in_scope 1#
+mkInScopeSet in_scope = InScope in_scope (_ILIT(1))
hunk ./compiler/basicTypes/VarEnv.lhs 84
-extendInScopeSet (InScope in_scope n) v = InScope (extendVarEnv in_scope v v) (n +# 1#)
+extendInScopeSet (InScope in_scope n) v = InScope (extendVarEnv in_scope v v) (n +# _ILIT(1))
hunk ./compiler/basicTypes/VarEnv.lhs 98
-modifyInScopeSet (InScope in_scope n) old_v new_v = InScope (extendVarEnv in_scope old_v new_v) (n +# 1#)
+modifyInScopeSet (InScope in_scope n) old_v new_v = InScope (extendVarEnv in_scope old_v new_v) (n +# _ILIT(1))
hunk ./compiler/basicTypes/VarEnv.lhs 137
- = try 1#
+ = try (_ILIT(1))
hunk ./compiler/basicTypes/VarEnv.lhs 142
- | k ># 1000#
+ | k ># _ILIT(1000)
hunk ./compiler/basicTypes/VarEnv.lhs 145
- | uniq `elemVarSetByKey` set = try (k +# 1#)
+ | uniq `elemVarSetByKey` set = try (k +# _ILIT(1))
hunk ./compiler/basicTypes/VarEnv.lhs 147
- | opt_PprStyle_Debug && k ># 3#
+ | opt_PprStyle_Debug && k ># _ILIT(3)
hunk ./compiler/cmm/CmmOpt.hs 33
-
+import FastTypes
hunk ./compiler/cmm/CmmOpt.hs 39
-import GHC.Exts
hunk ./compiler/cmm/CmmOpt.hs 465
-w2i x = word2Int# x
-i2w x = int2Word# x
+-- Unboxery removed in favor of FastInt; but is the function supposed to fail
+-- on inputs >= 2147483648, or was that just an implementation artifact?
+-- And is this speed-critical, or can we just use Integer operations
+-- (including Data.Bits)?
+-- --Isaac Dupree
hunk ./compiler/cmm/CmmOpt.hs 472
-exactLog2 x
- = if (x <= 0 || x >= 2147483648) then
+exactLog2 x_
+ = if (x_ <= 0 || x_ >= 2147483648) then
hunk ./compiler/cmm/CmmOpt.hs 476
- case fromInteger x of { I# x# ->
- if (w2i ((i2w x#) `and#` (i2w (0# -# x#))) /=# x#) then
+ case iUnbox (fromInteger x_) of { x ->
+ if (x `bitAndFastInt` negateFastInt x) /=# x then
hunk ./compiler/cmm/CmmOpt.hs 480
- Just (toInteger (I# (pow2 x#)))
+ Just (toInteger (iBox (pow2 x)))
hunk ./compiler/cmm/CmmOpt.hs 483
- pow2 x# | x# ==# 1# = 0#
- | otherwise = 1# +# pow2 (w2i (i2w x# `shiftRL#` 1#))
+ pow2 x | x ==# _ILIT(1) = _ILIT(0)
+ | otherwise = _ILIT(1) +# pow2 (x `shiftR_FastInt` _ILIT(1))
hunk ./compiler/cmm/OptimizationFuel.hs 14
-import GHC.Exts (State#)
+--import GHC.Exts (State#)
hunk ./compiler/cmm/OptimizationFuel.hs 52
-_unused :: State# () -> FS.FastString
+_unused :: {-State#-} () -> FS.FastString
hunk ./compiler/coreSyn/CoreUnfold.lhs 60
-import GHC.Exts ( Int# )
hunk ./compiler/coreSyn/CoreUnfold.lhs 184
-sizeExpr :: Int# -- Bomb out if it gets bigger than this
+sizeExpr :: FastInt -- Bomb out if it gets bigger than this
hunk ./compiler/coreSyn/CoreUnfold.lhs 244
- [alt] -> size_up_alt alt `addSize` SizeIs 0# (unitBag (v, 1)) 0#
+ [alt] -> size_up_alt alt `addSize` SizeIs (_ILIT(0)) (unitBag (v, 1)) (_ILIT(0))
hunk ./compiler/coreSyn/CoreUnfold.lhs 272
- = SizeIs tot (unitBag (v, iBox (_ILIT 1 +# tot -# max)) `unionBags` max_disc) max_scrut
+ = SizeIs tot (unitBag (v, iBox (_ILIT(1) +# tot -# max)) `unionBags` max_disc) max_scrut
hunk ./compiler/coreSyn/CoreUnfold.lhs 337
- fun_discount v | v `elem` top_args = SizeIs 0# (unitBag (v, opt_UF_FunAppDiscount)) 0#
+ fun_discount v | v `elem` top_args = SizeIs (_ILIT(0)) (unitBag (v, opt_UF_FunAppDiscount)) (_ILIT(0))
hunk ./compiler/coreSyn/CoreUnfold.lhs 375
-sizeZero = SizeIs (_ILIT 0) emptyBag (_ILIT 0)
-sizeOne = SizeIs (_ILIT 1) emptyBag (_ILIT 0)
-sizeN n = SizeIs (iUnbox n) emptyBag (_ILIT 0)
+sizeZero = SizeIs (_ILIT(0)) emptyBag (_ILIT(0))
+sizeOne = SizeIs (_ILIT(1)) emptyBag (_ILIT(0))
+sizeN n = SizeIs (iUnbox n) emptyBag (_ILIT(0))
hunk ./compiler/coreSyn/CoreUnfold.lhs 379
- | isUnboxedTupleCon dc = SizeIs (_ILIT 0) emptyBag (iUnbox n +# _ILIT 1)
- | otherwise = SizeIs (_ILIT 1) emptyBag (iUnbox n +# _ILIT 1)
+ | isUnboxedTupleCon dc = SizeIs (_ILIT(0)) emptyBag (iUnbox n +# _ILIT(1))
+ | otherwise = SizeIs (_ILIT(1)) emptyBag (iUnbox n +# _ILIT(1))
hunk ./compiler/coreSyn/CoreUnfold.lhs 406
-buildSize = SizeIs (-2#) emptyBag 4#
+buildSize = SizeIs (_ILIT(-2)) emptyBag (_ILIT(4))
hunk ./compiler/coreSyn/CoreUnfold.lhs 414
-augmentSize = SizeIs (-2#) emptyBag 4#
+augmentSize = SizeIs (_ILIT(-2)) emptyBag (_ILIT(4))
hunk ./compiler/coreSyn/CoreUnfold.lhs 418
-nukeScrutDiscount (SizeIs n vs d) = SizeIs n vs 0#
+nukeScrutDiscount (SizeIs n vs d) = SizeIs n vs (_ILIT(0))
hunk ./compiler/nativeGen/MachRegs.lhs 109
-import GHC.Exts
-
hunk ./compiler/nativeGen/MachRegs.lhs 504
-#define ALLOCATABLE_REGS_INTEGER 3#
-#define ALLOCATABLE_REGS_DOUBLE 6#
+#define ALLOCATABLE_REGS_INTEGER (_ILIT(3))
+#define ALLOCATABLE_REGS_DOUBLE (_ILIT(6))
hunk ./compiler/nativeGen/MachRegs.lhs 509
-#define ALLOCATABLE_REGS_INTEGER 5#
-#define ALLOCATABLE_REGS_DOUBLE 2#
+#define ALLOCATABLE_REGS_INTEGER (_ILIT(5))
+#define ALLOCATABLE_REGS_DOUBLE (_ILIT(2))
hunk ./compiler/nativeGen/MachRegs.lhs 514
-#define ALLOCATABLE_REGS_INTEGER 16#
-#define ALLOCATABLE_REGS_DOUBLE 26#
+#define ALLOCATABLE_REGS_INTEGER (_ILIT(16))
+#define ALLOCATABLE_REGS_DOUBLE (_ILIT(26))
hunk ./compiler/nativeGen/MachRegs.lhs 536
- -> case cI +# 1# of
+ -> case cI +# _ILIT(1) of
hunk ./compiler/nativeGen/MachRegs.lhs 540
- -> case cF +# 1# of
+ -> case cF +# _ILIT(1) of
hunk ./compiler/nativeGen/MachRegs.lhs 546
- in case isSqueesed 0# 0# conflicts of
+ in case isSqueesed (_ILIT(0)) (_ILIT(0)) conflicts of
hunk ./compiler/profiling/CostCentre.lhs 295
- tag_CC (NormalCC {}) = (_ILIT 1 :: FastInt)
- tag_CC (AllCafsCC {}) = _ILIT 2
+ tag_CC (NormalCC {}) = _ILIT(1)
+ tag_CC (AllCafsCC {}) = _ILIT(2)
hunk ./compiler/simplCore/SimplMonad.lhs 52
-
-import GHC.Exts ( indexArray# )
hunk ./compiler/stranal/StrictAnal.lhs 412
-nullSaStats = SaStats (_ILIT 0) (_ILIT 0) (_ILIT 0) (_ILIT 0) (_ILIT 0) (_ILIT 0)
+nullSaStats = SaStats
+ (_ILIT(0)) (_ILIT(0))
+ (_ILIT(0)) (_ILIT(0))
+ (_ILIT(0)) (_ILIT(0))
hunk ./compiler/utils/Outputable.lhs 48
- pprPanic, assertPprPanic, pprPanic#, pprPgmError,
+ pprPanic, assertPprPanic, pprPanicFastInt, pprPgmError,
hunk ./compiler/utils/Outputable.lhs 50
- trace, pgmError, panic, panic#, assertPanic
+ trace, pgmError, panic, panicFastInt, assertPanic
hunk ./compiler/utils/Outputable.lhs 618
-pprPanic# :: String -> SDoc -> FastInt
-pprPanic# heading pretty_msg = panic# (show (doc PprDebug))
+pprPanicFastInt :: String -> SDoc -> FastInt
+pprPanicFastInt heading pretty_msg = panicFastInt (show (doc PprDebug))
hunk ./compiler/utils/Panic.lhs 24
- panic, panic#, assertPanic, trace,
+ panic, panicFastInt, assertPanic, trace,
hunk ./compiler/utils/Panic.lhs 145
-panic# :: String -> FastInt
-panic# s = case (panic s) of () -> _ILIT 0
+panicFastInt :: String -> FastInt
+panicFastInt s = case (panic s) of () -> _ILIT(0)
hunk ./compiler/utils/UniqFM.lhs 54
-import Unique ( Uniquable(..), Unique, getKey#, mkUniqueGrimily )
+import Unique ( Uniquable(..), Unique, getKeyFastInt, mkUniqueGrimily )
hunk ./compiler/utils/UniqFM.lhs 58
-
-import GHC.Exts -- Lots of Int# operations
hunk ./compiler/utils/UniqFM.lhs 238
-unitUFM key elt = mkLeafUFM (getKey# (getUnique key)) elt
-unitDirectlyUFM key elt = mkLeafUFM (getKey# key) elt
+unitUFM key elt = mkLeafUFM (getKeyFastInt (getUnique key)) elt
+unitDirectlyUFM key elt = mkLeafUFM (getKeyFastInt key) elt
hunk ./compiler/utils/UniqFM.lhs 258
-addToUFM_Directly fm u elt = insert_ele use_snd fm (getKey# u) elt
+addToUFM_Directly fm u elt = insert_ele use_snd fm (getKeyFastInt u) elt
hunk ./compiler/utils/UniqFM.lhs 261
- = insert_ele combiner fm (getKey# (getUnique key)) elt
+ = insert_ele combiner fm (getKeyFastInt (getUnique key)) elt
hunk ./compiler/utils/UniqFM.lhs 264
- = insert_ele combiner fm (getKey# (getUnique key)) (unit item)
+ = insert_ele combiner fm (getKeyFastInt (getUnique key)) (unit item)
hunk ./compiler/utils/UniqFM.lhs 272
- = foldl (\ fm (k, e) -> insert_ele combiner fm (getKey# (getUnique k)) e)
+ = foldl (\ fm (k, e) -> insert_ele combiner fm (getKeyFastInt (getUnique k)) e)
hunk ./compiler/utils/UniqFM.lhs 277
- = foldl (\ fm (k, e) -> insert_ele combiner fm (getKey# k) e)
+ = foldl (\ fm (k, e) -> insert_ele combiner fm (getKeyFastInt k) e)
hunk ./compiler/utils/UniqFM.lhs 286
-delFromUFM fm key = delete fm (getKey# (getUnique key))
-delFromUFM_Directly fm u = delete fm (getKey# u)
+delFromUFM fm key = delete fm (getKeyFastInt (getUnique key))
+delFromUFM_Directly fm u = delete fm (getKeyFastInt u)
hunk ./compiler/utils/UniqFM.lhs 289
-delete :: UniqFM a -> Int# -> UniqFM a
+delete :: UniqFM a -> FastInt -> UniqFM a
hunk ./compiler/utils/UniqFM.lhs 577
-lookupUFM fm key = lookUp fm (getKey# (getUnique key))
-lookupUFM_Directly fm key = lookUp fm (getKey# key)
+lookupUFM fm key = lookUp fm (getKeyFastInt (getUnique key))
+lookupUFM_Directly fm key = lookUp fm (getKeyFastInt key)
hunk ./compiler/utils/UniqFM.lhs 581
- = case lookUp fm (getKey# (getUnique key)) of
+ = case lookUp fm (getKeyFastInt (getUnique key)) of
hunk ./compiler/utils/UniqFM.lhs 586
- = case lookUp fm (getKey# key) of
+ = case lookUp fm (getKeyFastInt key) of
hunk ./compiler/utils/UniqFM.lhs 590
-lookUp :: UniqFM a -> Int# -> Maybe a
+lookUp :: UniqFM a -> FastInt -> Maybe a
hunk ./compiler/utils/UniqFM.lhs 788
- = let
- l = (_ILIT(1) :: FastInt)
- in
- NodeUFMData (((i `shiftR_` l) `shiftL_` l) +# _ILIT(1)) l
+ = NodeUFMData ((shiftL1 (shiftR1 i)) +# _ILIT(1)) (_ILIT(1))
hunk ./compiler/utils/UniqFM.lhs 797
- l = (_ILIT(1) :: FastInt)
- j = i `quotFastInt` (p `shiftL_` l)
- j2 = i2 `quotFastInt` (p2 `shiftL_` l)
+ j = i `quotFastInt` (shiftL1 p)
+ j2 = i2 `quotFastInt` (shiftL1 p2)
hunk ./compiler/utils/UniqFM.lhs 804
- = NodeUFMData (((j `shiftL_` l) +# l) *# p) p
+ = NodeUFMData (((shiftL1 j) +# _ILIT(1)) *# p) p
hunk ./compiler/utils/UniqFM.lhs 806
- = getCommonNodeUFMData_ (p `shiftL_` l) (j `shiftR_` l) (j_ `shiftR_` l)
+ = getCommonNodeUFMData_ (shiftL1 p) (shiftR1 j) (shiftR1 j_)
hunk ./compiler/utils/UniqFM.lhs 829
-shiftL_ :: FastInt -> FastInt -> FastInt
-shiftR_ :: FastInt -> FastInt -> FastInt
-
-#if __GLASGOW_HASKELL__
-{-# INLINE shiftL_ #-}
-{-# INLINE shiftR_ #-}
-shiftL_ n p = word2Int#((int2Word# n) `uncheckedShiftL#` p)
-shiftR_ n p = word2Int#((int2Word# n) `uncheckedShiftRL#` p)
+shiftL1 :: FastInt -> FastInt
+shiftR1 :: FastInt -> FastInt
hunk ./compiler/utils/UniqFM.lhs 832
-#else /* not GHC */
-shiftL_ n p = n * (2 ^ p)
-shiftR_ n p = n `quot` (2 ^ p)
+{-# INLINE shiftL1 #-}
+{-# INLINE shiftR1 #-}
hunk ./compiler/utils/UniqFM.lhs 835
-#endif /* not GHC */
+shiftL1 n = n `shiftLFastInt` _ILIT(1)
+shiftR1 n = n `shiftR_FastInt` _ILIT(1)
hunk ./compiler/utils/Util.lhs 347
- = elem (_ILIT 0) x ys
+ = elem (_ILIT(0)) x ys
hunk ./compiler/utils/Util.lhs 351
- | i ># _ILIT 100 = trace ("Over-long elem in " ++ msg) $
- x `List.elem` (y:ys)
- | otherwise = x == y || elem (i +# _ILIT(1)) x ys
+ | i ># _ILIT(100) = trace ("Over-long elem in " ++ msg) $
+ x `List.elem` (y:ys)
+ | otherwise = x == y || elem (i +# _ILIT(1)) x ys
hunk ./compiler/utils/Util.lhs 356
- = notElem (_ILIT 0) x ys
+ = notElem (_ILIT(0)) x ys
hunk ./compiler/utils/Util.lhs 360
- | i ># _ILIT 100 = trace ("Over-long notElem in " ++ msg) $
+ | i ># _ILIT(100) = trace ("Over-long notElem in " ++ msg) $
}
[miscellaneous unnecessary-extension-removal
Isaac Dupree <id at isaac.cedarswampstudios.org>**20080105020249] {
hunk ./compiler/hsSyn/HsDecls.lhs 688
-conDeclsNames :: forall name. Eq name => [ConDecl name] -> [Located name]
+conDeclsNames :: (Eq name) => [ConDecl name] -> [Located name]
hunk ./compiler/hsSyn/HsExpr.lhs 375
-ppr_expr (HsLam matches :: HsExpr id)
- = pprMatches (LambdaExpr :: HsMatchContext id) matches
+--avoid using PatternSignatures for stage1 code portability
+ppr_expr exprType@(HsLam matches)
+ = pprMatches (LambdaExpr `asTypeOf` idType exprType) matches
+ where idType :: HsExpr id -> HsMatchContext id; idType = undefined
hunk ./compiler/hsSyn/HsExpr.lhs 380
-ppr_expr (HsCase expr matches :: HsExpr id)
+ppr_expr exprType@(HsCase expr matches)
hunk ./compiler/hsSyn/HsExpr.lhs 382
- nest 2 (pprMatches (CaseAlt :: HsMatchContext id) matches) ]
+ nest 2 (pprMatches (CaseAlt `asTypeOf` idType exprType) matches) ]
+ where idType :: HsExpr id -> HsMatchContext id; idType = undefined
hunk ./compiler/hsSyn/HsExpr.lhs 698
-pprPatBind pat (grhss :: GRHSs id) = sep [ppr pat, nest 4 (pprGRHSs (PatBindRhs :: HsMatchContext id) grhss)]
+pprPatBind pat ty@(grhss) = sep [ppr pat, nest 4 (pprGRHSs (PatBindRhs `asTypeOf` idType ty) grhss)]
+--avoid using PatternSignatures for stage1 code portability
+ where idType :: GRHSs id -> HsMatchContext id; idType = undefined
hunk ./compiler/main/HscTypes.lhs 1487
-data CompiledByteCode
+data CompiledByteCode = CompiledByteCodeUndefined
+_unused :: CompiledByteCode
+_unused = CompiledByteCodeUndefined
hunk ./compiler/nativeGen/RegAllocColor.hs 63
-regAlloc_spin dflags (spinCount :: Int) triv regsFree slotsFree debug_codeGraphs code
+regAlloc_spin dflags spinCount triv regsFree slotsFree debug_codeGraphs code
hunk ./compiler/rename/RnEnv.lhs 556
- nowAndLater (ls :: [Either (Name, FixItem) (FastString, Located Fixity)]) =
+ nowAndLater :: [Either (Name, FixItem) (FastString, Located Fixity)]
+ -> ([(Name,FixItem)], UniqFM (Located Fixity))
+ nowAndLater ls =
hunk ./compiler/rename/RnExpr.lhs-boot 12
-rnStmts :: forall thing.
+rnStmts :: --forall thing.
hunk ./compiler/rename/RnPat.lhs 387
- (_, dup_fields :: [[RdrName]]) = removeDups compare
+ dup_fields :: [[RdrName]]
+ (_, dup_fields) = removeDups compare
hunk ./compiler/typecheck/TcHsSyn.lhs 863
-zonkRule env (HsRule name act (vars::[RuleBndr TcId]) lhs fv_lhs rhs fv_rhs)
+zonkRule env (HsRule name act (vars{-::[RuleBndr TcId]-}) lhs fv_lhs rhs fv_rhs)
hunk ./compiler/utils/UniqFM.lhs 540
-filterUFM fn fm = filter_tree pred fm
- where
- pred (_::FastInt) e = fn e
+filterUFM fn fm = filter_tree (\_ e -> fn e) fm
}
[add FastFunctions
Isaac Dupree <id at isaac.cedarswampstudios.org>**20080106003013] {
addfile ./compiler/utils/FastFunctions.lhs
hunk ./compiler/utils/FastFunctions.lhs 1
+Z%
+% (c) The University of Glasgow, 2000-2006
+%
+\section{Fast functions}
+
+\begin{code}
+
+module FastFunctions (
+ unsafeChr, inlinePerformIO, unsafeDupableInterleaveIO,
+ indexWord8OffFastPtr,
+ indexWord8OffFastPtrAsFastChar, indexWord8OffFastPtrAsFastInt,
+ global, Global
+ ) where
+
+#define COMPILING_FAST_STRING
+#include "HsVersions.h"
+
+import FastTypes
+import Data.IORef
+import System.IO.Unsafe
+
+#if defined(__GLASGOW_HASKELL__)
+
+import GHC.Exts
+import GHC.Word
+import GHC.IOBase (IO(..))
+--why not import it at __GLASGOW_HASKELL__==606 ?
+#if __GLASGOW_HASKELL__ >= 607
+import GHC.IOBase (unsafeDupableInterleaveIO)
+#endif
+import GHC.Base (unsafeChr)
+
+#if __GLASGOW_HASKELL__ < 607
+unsafeDupableInterleaveIO :: IO a -> IO a
+unsafeDupableInterleaveIO = unsafeInterleaveIO
+#endif
+
+-- Just like unsafePerformIO, but we inline it.
+{-# INLINE inlinePerformIO #-}
+inlinePerformIO :: IO a -> a
+inlinePerformIO (IO m) = case m realWorld# of (# _, r #) -> r
+
+indexWord8OffFastPtr p i = W8# (indexWord8OffAddr# p i)
+indexWord8OffFastPtrAsFastChar p i = indexCharOffAddr# p i
+indexWord8OffFastPtrAsFastInt p i = word2Int# (indexWord8OffAddr# p i)
+-- or ord# (indexCharOffAddr# p i)
+
+#else /* ! __GLASGOW_HASKELL__ */
+
+import Foreign.Ptr
+import Data.Word
+
+-- hey, no harm inlining it, :-P
+{-# INLINE inlinePerformIO #-}
+inlinePerformIO :: IO a -> a
+inlinePerformIO = unsafePerformIO
+
+unsafeDupableInterleaveIO :: IO a -> IO a
+unsafeDupableInterleaveIO = unsafeInterleaveIO
+
+-- truly, these functions are unsafe: they assume
+-- a certain immutability of the pointer's target area.
+indexWord8OffFastPtr p i = inlinePerformIO (peekByteOff p n) :: Word8
+indexWord8OffFastPtrAsFastInt p i =
+ iUnbox (fromIntegral (inlinePerformIO (peekByteOff p n) :: Word8))
+indexWord8OffFastPtrAsFastChar p i =
+ fastChr (iUnbox (fromIntegral (inlinePerformIO (peekByteOff p n) :: Word8)))
+
+#endif /* ! __GLASGOW_HASKELL__ */
+
+--just so we can refer to the type clearly in a macro
+type Global a = IORef a
+global :: a -> Global a
+global a = unsafePerformIO (newIORef a)
+
+indexWord8OffFastPtr :: FastPtr Word8 -> FastInt -> Word8
+indexWord8OffFastPtrAsFastChar :: FastPtr Word8 -> FastInt -> FastChar
+indexWord8OffFastPtrAsFastInt :: FastPtr Word8 -> FastInt -> FastInt
+
+\end{code}
}
Context:
[A little refactoring of GenIfaceEq to make the Outputable instance into H98
simonpj at microsoft.com**20080104105450]
[Make the instance of DebugNodes more H98-like
simonpj at microsoft.com**20080104105409]
[change CmmActual, CmmFormal to use a data CmmHinted rather than tuple (#1405)
Isaac Dupree <id at isaac.cedarswampstudios.org>**20080104105339
This allows the instance of UserOfLocalRegs to be within Haskell98, and IMHO
makes the code a little cleaner generally.
This is one small (though tedious) step towards making GHC's code more
portable...
]
[generalize instance Outputable GenCmm to H98 (#1405)
Isaac Dupree <id at isaac.cedarswampstudios.org>**20071226175915]
[move and generalize another instance (#1405)
Isaac Dupree <id at isaac.cedarswampstudios.org>**20071226174904
was instance Outputable CmmGraph
type CmmGraph = LGraph Middle Last
now instance (ctx) => Outputable (LGraph m l),
in module with LGraph where it belongs
This also let us reduce the context of DebugNodes to Haskell98,
leaving that class's only extension being multi-parameter.
(also Outputable (LGraph M Last) with M = ExtendWithSpills Middle
was another redundant instance that was then removed)
]
[move and generalize an instance (#1405)
Isaac Dupree <id at isaac.cedarswampstudios.org>**20071226171913
UserOfLocalRegs (ZLast Last) isn't Haskell98, but it was just as
good an instance to be UserOfLocalRegs a => UserOfLocalRegs (ZLast a)
]
[Do not consult -XGADTs flag when pattern matching on GADTs
simonpj at microsoft.com**20080104125814
See Trac #2004, and Note [Flags and equational constraints] in TcPat.
]
[Add a note about primop wrappers (cf Trac #1509)
simonpj at microsoft.com**20080104125305]
[Document SOURCE pragma; clarify TH behavior for mutually-recurive modules (Trac #1012)
simonpj at microsoft.com**20080104121939]
[White space and comments only
simonpj at microsoft.com**20080104102236]
[Optionally use libffi to implement 'foreign import "wrapper"' (#793)
Simon Marlow <simonmar at microsoft.com>**20080103170236
To enable this, set UseLibFFI=YES in mk/build.mk.
The main advantage here is that this reduces the porting effort for
new platforms: libffi works on more architectures than our current
adjustor code, and it is probably more heavily tested. We could
potentially replace our existing code, but since it is probably faster
than libffi (just a guess, I'll measure later) and is already working,
it doesn't seem worthwhile.
Right now, you must have libffi installed on your system. I used the
one supplied by Debian/Ubuntu.
]
[remove trace apparently left in by accident
Simon Marlow <simonmar at microsoft.com>**20080103163805]
[Remove -funfolding-update-in-place flag documentation
simonpj at microsoft.com**20080103160036
This flag does nothing, and should have been removed ages ago. (GHC
no longer does update-in-place.)
MERGE to 6.8 branch
]
[Fix warnings with newer gcc versions (I hope)
Simon Marlow <simonmar at microsoft.com>**20080103140338]
[FIX #1898: add a missing UNTAG_CLOSURE() in checkBlackHoles
Simon Marlow <simonmar at microsoft.com>**20080103112717]
[fix validation failure on non-i386
Simon Marlow <simonmar at microsoft.com>**20080102151740]
[expand "out of stack slots" panic to suggest using -fregs-graph, see #1993
Simon Marlow <simonmar at microsoft.com>**20080102150737]
[Warning clean, and fix compilation with GHC 6.2.x
Simon Marlow <simonmar at microsoft.com>**20080102114529]
[Add dead code elimination in cmmMiniInline
Simon Marlow <simonmar at microsoft.com>**20071220151734
cmmMiniInline counts the uses of local variables, so it can easily
eliminate assigments to unused locals. This almost never gets
triggered, as we don't generate any dead assignments, but it will be
needed by a forthcoming cleanup in CgUtils.emitSwitch.
]
[implement prefix unboxed tuples (part of #1509)
Isaac Dupree <id at isaac.cedarswampstudios.org>**20080102124001]
[Link libgmp.a statically into libHSrts.dll on Windows
Clemens Fruhwirth <clemens at endorphin.org>**20080101154017]
[Embedd DLL name into its import library, so client libs reference them properly in .idata
Clemens Fruhwirth <clemens at endorphin.org>**20080101152157]
[Add package dependencies to link pass when building ghc package (required for windows DLL build)
Clemens Fruhwirth <clemens at endorphin.org>**20080101152101]
[Fix building libHSrts.dll by using ghc-pkg instead of grepping in base.cabal
Clemens Fruhwirth <clemens at endorphin.org>**20071230193952]
[Add installPackage to dependencies of make.library.* as it's used by the rule
Clemens Fruhwirth <clemens at endorphin.org>**20071229162707]
[Install dynlibs correctly
Clemens Fruhwirth <clemens at endorphin.org>**20071228184024
Add dynlibdir target to config.mk.in, setting it to @libdir at .
Invoke installPackage with dynlibdir at libraries/Makefile
Make installPackage.hs hand dynlibdir to Cabal.
]
[import ord that alex secretly imported
Isaac Dupree <id at isaac.cedarswampstudios.org>**20071228175727]
[add missing import that happy -agc secretly provided
Isaac Dupree <id at isaac.cedarswampstudios.org>**20071227171335]
[correct type mistake, hidden by happy -agc coercions!
Isaac Dupree <id at isaac.cedarswampstudios.org>**20071226140743]
[API changes for cabal-HEAD
Clemens Fruhwirth <clemens at endorphin.org>**20071227143114
Rename interfacedir to haddockdir
Change empty(Copy|Register)Flags to default(Copy|Register)Flags
Wrap content of RegisterFlags with toFlag (the Flag type is actually just Maybe)
]
[Extend API for compiling to and from Core
Tim Chevalier <chevalier at alum.wellesley.edu>**20071225200411
Added API support for compiling Haskell to simplified Core, and for
compiling Core to machine code. The latter, especially, should be
considered experimental and has only been given cursory testing. Also
fixed warnings in DriverPipeline. Merry Christmas.
]
[When complaining about non-rigid context, give suggestion of adding a signature
simonpj at microsoft.com**20071224122217]
[Improve handling of newtypes (fixes Trac 1495)
simonpj at microsoft.com**20071221090406
In a few places we want to "look through" newtypes to get to the
representation type. But we need to be careful that we don't fall
into an ininite loop with e.g.
newtype T = MkT T
The old mechansim for doing this was to have a field nt_rep, inside
a newtype TyCon, that gave the "ultimate representation" of the type.
But that failed for Trac 1495, which looked like this:
newtype Fix a = Fix (a (Fix a))
data I a = I a
Then, expanding the type (Fix I) went on for ever.
The right thing to do seems to be to check for loops when epxanding
the *type*, rather than in the *tycon*. This patch does that,
- Removes nt_rep from TyCon
- Make Type.repType check for loops
See Note [Expanding newtypes] in Type.lhs.
At the same time I also fixed a bug for Roman, where newtypes were not
being expanded properly in FamInstEnv.topNormaliseType. This function
and Type.repType share a common structure.
Ian, see if this merges easily to the branch
If not, I don't think it's essential to fix 6.8
]
[Fix Trac #1981: seq on a type-family-typed expression
simonpj at microsoft.com**20071221085542
We were crashing when we saw
case x of DEFAULT -> rhs
where x had a type-family type. This patch fixes it.
MERGE to the 6.8 branch.
]
[Comment only
simonpj at microsoft.com**20071220164621]
[Fix nasty recompilation bug in MkIface.computeChangedOccs
simonpj at microsoft.com**20071220164307
MERGE to 6.8 branch
In computeChangedOccs we look up the old version of a Name.
But a WiredIn Name doesn't have an old version, because WiredIn things
don't appear in interface files at all.
Result: ghc-6.9: panic! (the 'impossible' happened)
(GHC version 6.9 for x86_64-unknown-linux):
lookupVers1 base:GHC.Prim chr#{v}
This fixes the problem. The patch should merge easily onto the branch.
]
[Fix Trac #1988; keep the ru_fn field of a RULE up to date
simonpj at microsoft.com**20071220131912
The ru_fn field was wrong when we moved RULES from one Id to another.
The fix is simple enough.
However, looking at this makes me realise that the worker/wrapper stuff
for recursive newtypes isn't very clever: we generate demand info but
then don't properly exploit it.
This patch fixes the crash though.
]
[Add better panic message in getSRTInfo (Trac #1973)
simonpj at microsoft.com**20071220180335]
[Remove obselete code for update-in-place (which we no longer do)
simonpj at microsoft.com**20071220173432]
[Implement generalised list comprehensions
simonpj at microsoft.com**20071220111300
This patch implements generalised list comprehensions, as described in
the paper "Comprehensive comprehensions" (Peyton Jones & Wadler, Haskell
Workshop 2007). If you don't use the new comprehensions, nothing
should change.
The syntax is not exactly as in the paper; see the user manual entry
for details.
You need an accompanying patch to the base library for this stuff
to work.
The patch is the work of Max Bolingbroke [batterseapower at hotmail.com],
with some advice from Simon PJ.
The related GHC Wiki page is
http://hackage.haskell.org/trac/ghc/wiki/SQLLikeComprehensions
]
[More bindist-publishing fixes and refactoring
Ian Lynagh <igloo at earth.li>**20071218144505]
[Fix publishing the docs
Ian Lynagh <igloo at earth.li>**20071216122544]
[FIX #1980: must check for ThreadRelocated in killThread#
Simon Marlow <simonmar at microsoft.com>**20071217164610]
[Eliminate external GMP dependencies
Manuel M T Chakravarty <chak at cse.unsw.edu.au>**20071217093839
- Ensure the stage1 compiler uses ghc's own GMP library on Mac OS
- Need to rebuild installPackage and ifBuildable with stage1 compiler as they
go into bindists
]
[Include ~/Library/Frameworks in the framework searchpath
Ian Lynagh <igloo at earth.li>**20071217233457
Patch from Christian Maeder
]
[Make ghcii.sh executable
Ian Lynagh <igloo at earth.li>**20071217195734]
[Don't rely on distrib/prep-bin-dist-mingw being executable
Ian Lynagh <igloo at earth.li>**20071217195554]
[always try to remove the new file before restoring the old one (#1963)
Simon Marlow <simonmar at microsoft.com>**20071214123345]
[Fix a bug in gen_contents_index
Ian Lynagh <igloo at earth.li>**20071212121154
The library doc index thought that the docs were in $module.html, rather
than $package/$module.html.
]
[Fix lifting of case expressions
Roman Leshchinskiy <rl at cse.unsw.edu.au>**20071215000837
We have to explicity check for empty arrays in each alternative as recursive
algorithms wouldn't terminate otherwise.
]
[Use (UArr Int) instead of PArray_Int# in vectorisation
Roman Leshchinskiy <rl at cse.unsw.edu.au>**20071215000739]
[Fix bug in VectInfo loading
Roman Leshchinskiy <rl at cse.unsw.edu.au>**20071214230914]
[Remove unused vectorisation built-in
Roman Leshchinskiy <rl at cse.unsw.edu.au>**20071214011015]
[Treat some standard data cons specially during vectorisation
Roman Leshchinskiy <rl at cse.unsw.edu.au>**20071213034855
This is a temporary hack which allows us to vectorise literals.
]
[More vectorisation-related built ins
Roman Leshchinskiy <rl at cse.unsw.edu.au>**20071213034839]
[Track changes to package ndp
Roman Leshchinskiy <rl at cse.unsw.edu.au>**20071212062714]
[Add vectorisation built-ins
Roman Leshchinskiy <rl at cse.unsw.edu.au>**20071212040521]
[FIX #1963: catch Ctrl-C and clean up properly
Simon Marlow <simonmar at microsoft.com>**20071213154056]
[Document the new threshold flags
Roman Leshchinskiy <rl at cse.unsw.edu.au>**20071214003003]
[Separate and optional size thresholds for SpecConstr and LiberateCase
Roman Leshchinskiy <rl at cse.unsw.edu.au>**20071214002719
This patch replaces -fspec-threshold by -fspec-constr-threshold and
-fliberate-case-threshold. The thresholds can be disabled by
-fno-spec-constr-threshold and -fno-liberate-case-threshold.
]
[Make HscTypes.tyThingId respond not panic on ADataCon
simonpj at microsoft.com**20071204152903]
[Use Unix format for RnPat (no other change)
simonpj at microsoft.com**20071213140532]
[Improve free-variable handling for rnPat and friends (fixes Trac #1972)
simonpj at microsoft.com**20071213140213
As well as fixing the immediate problem (Trac #1972) this patch does
a signficant simplification and refactoring of pattern renaming.
Fewer functions, fewer parameters passed....it's all good. But it
took much longer than I expected to figure out.
The most significant change is that the NameMaker type does *binding*
as well as *making* and, in the matchNameMaker case, checks for unused
bindings as well. This is much tider.
(No need to merge to the 6.8 branch, but no harm either.)
]
[Allow more than 3 simplifier iterations to be run in phase 0
Roman Leshchinskiy <rl at cse.unsw.edu.au>**20071213040835
The number of iterations during the first run of phase 0 was erroneously
hardcoded to 3. It should be *at least* 3 (see comments in code) but can be
more.
]
[Document -ddump-simpl-phases
Roman Leshchinskiy <rl at cse.unsw.edu.au>**20071213040822]
[New flag: -ddump-simpl-phases
Roman Leshchinskiy <rl at cse.unsw.edu.au>**20071213040644
This outputs the core after each simplifier phase (i.e., it produces less
information that -ddump-simpl-iterations).
]
[Don't dump simplifier iterations with -dverbose-core2core
Roman Leshchinskiy <rl at cse.unsw.edu.au>**20071213034635
SimonPJ says this is the correct behaviour. We still have
-ddump-simpl-iterations.
]
["list --simple-output" should be quiet when there are no packages to list
Simon Marlow <simonmar at microsoft.com>**20071212102230
Previously:
$ ghc-pkg list --user --simple-output
ghc-pkg: no matches
$
Now:
$ ghc-pkg list --user --simple-output
$
]
[Fix vectorisation bug
Roman Leshchinskiy <rl at cse.unsw.edu.au>**20071206233015]
[Vectorisation-related built ins
Roman Leshchinskiy <rl at cse.unsw.edu.au>**20071206040829]
[Teach vectorisation about some temporary conversion functions
Roman Leshchinskiy <rl at cse.unsw.edu.au>**20071206032547]
[Vectorise case of unit correctly
Roman Leshchinskiy <rl at cse.unsw.edu.au>**20071205221305]
[Teach vectorisation about singletonP
Roman Leshchinskiy <rl at cse.unsw.edu.au>**20071205221240]
[Optimise desugaring of parallel array comprehensions
Roman Leshchinskiy <rl at cse.unsw.edu.au>**20071205221213]
[Teach vectorisation about tuple datacons
Roman Leshchinskiy <rl at cse.unsw.edu.au>**20071205050221]
[Track additions to package ndp
Roman Leshchinskiy <rl at cse.unsw.edu.au>**20071205042649]
[Track changes to package ndp
Roman Leshchinskiy <rl at cse.unsw.edu.au>**20071205033859]
[Improve pretty-printing of InstDecl
simonpj at microsoft.com**20071210083053
Fixes Trac #1966.
]
[Comments only
Pepe Iborra <mnislaih at gmail.com>**20071208204815]
[Refactoring only
Pepe Iborra <mnislaih at gmail.com>**20071208195222
Suspensions in the Term datatype used for RTTI
always get assigned a Type, so there is no reason
to juggle around with a (Maybe Type) anymore.
]
[Change the format used by :print to show the content of references
Pepe Iborra <mnislaih at gmail.com>**20071208193013
This comes as result of the short discussion linked below.
http://www.haskell.org/pipermail/cvs-ghc/2007-December/040049.html
]
[Help the user when she tries to do :history without :trace
Pepe Iborra <mnislaih at gmail.com>**20071208180918
Teach GHCi to show a "perhaps you forgot to use :trace?" when
it finds that the user is trying to retrieve an empty :history
]
[Prevent the binding of unboxed things by :print
Pepe Iborra <mnislaih at gmail.com>**20071208181830]
[Coercions from boxy splitters must be sym'ed in pattern matches
Manuel M T Chakravarty <chak at cse.unsw.edu.au>**20071208105018]
[Properly keep track of whether normalising given or wanted dicts
Manuel M T Chakravarty <chak at cse.unsw.edu.au>**20071207071302
- The information of whether given or wanted class dictionaries where
normalised by rewriting wasn't always correctly propagated in TcTyFuns,
which lead to malformed dictionary bindings.
- Also fixes a bug in TcPat.tcConPat where GADT equalities where emitted in
the wrong position in case bindings (which led to CoreLint failures).
]
[TcPat.tcConPat uses equalities instead of GADT refinement
Manuel M T Chakravarty <chak at cse.unsw.edu.au>**20071120071208
* This patch implements the use of equality constraints instead of GADT
refinements that we have been discussing for a while.
* It just changes TcPat.tcConPat. It doesn't have any of the simplification
and dead code removal that is possible due to this change.
* At the moment, this patch breaks a fair number of GADT regression tests.
]
[Use installPackage for register --inplace as well as installing
Ian Lynagh <igloo at earth.li>**20071207234652
We also need to do the GHC.Prim hack when registering inplace or the
tests that use it fail.
]
[Fix the libraries Makefile
Ian Lynagh <igloo at earth.li>**20071205125015
x && y
is not the same as
if x; then y; fi
as the latter doesn't fail when x fails
]
[Copy hscolour.css into dist/... so it gets installed with the library docs
Ian Lynagh <igloo at earth.li>**20071205013703]
[Add the hscolour.css from hscolour 1.8
Ian Lynagh <igloo at earth.li>**20071205011733]
[BIN_DIST_INST_SUBDIR Needs to be defined in config.mk so ./Makefile can see it
Ian Lynagh <igloo at earth.li>**20071207121317]
[#include ../includes/MachRegs.h rather than just MachRegs.h
Ian Lynagh <igloo at earth.li>**20071205170335
This fixes building on NixOS. I'm not sure why it worked everywhere else,
but not on NixOS, before.
]
[Fix bindist creation: readline/config.mk is gone
Ian Lynagh <igloo at earth.li>**20071203123031]
[FIX #1843: Generate different instructions on PPC
Ian Lynagh <igloo at earth.li>**20071203123237
The old ones caused lots of
unknown scattered relocation type 4
errors. Patch from Chris Kuklewicz.
]
[Refactor gen_contents_index
Ian Lynagh <igloo at earth.li>**20071207183538
Also fixes it with Solaris's sh, spotted by Christian Maeder
]
[Use GHC.Exts rather than GHC.Prim
Ian Lynagh <igloo at earth.li>**20071202234222]
[Alter the base:GHC.Prim hack in installPackage, following changes in base
Ian Lynagh <igloo at earth.li>**20071202215719]
[Remove debug warning, and explain why
simonpj at microsoft.com**20071207170507]
[comment only
Simon Marlow <simonmar at microsoft.com>**20071206092422]
[comment typo
Simon Marlow <simonmar at microsoft.com>**20071206092412]
[add Outputable instance for OccIfaceEq
Simon Marlow <simonmar at microsoft.com>**20071206092403]
[Workaround for #1959: assume untracked names have changed
Simon Marlow <simonmar at microsoft.com>**20071206092349
This fixes the 1959 test, but will do more recompilation than is
strictly necessary (but only when -O is on). Still, more
recompilation is better than segfaults, link errors or other random
breakage.
]
[FIX part of #1959: declaration versions were not being incremented correctly
Simon Marlow <simonmar at microsoft.com>**20071206084556
We were building a mapping from ModuleName to [Occ] from the usage
list, using the usg_mod field as the key. Unfortunately, due to a
very poor naming decision, usg_mod is actually the module version, not
the ModuleName. usg_name is the ModuleName. Since Version is also an
instance of Uniquable, there was no type error: all that happened was
lookups in the map never succeeded. I shall rename the fields of
Usage in a separate patch.
This doesn't completely fix #1959, but it gets part of the way there.
I have to take partial blame as the person who wrote this fragment of
code in late 2006 (patch "Interface file optimisation and removal of
nameParent").
]
[move FP_FIND_ROOT after the "GHC is required" check
Simon Marlow <simonmar at microsoft.com>**20071205101814]
[FIX #1110: hackery also needed when running gcc for CPP
Simon Marlow <simonmar at microsoft.com>**20071205150230]
[Teach :print to follow references (STRefs and IORefs)
Pepe Iborra <mnislaih at gmail.com>**20071204105511
Prelude Data.IORef> :p l
l = (_t4::Maybe Integer) : (_t5::[Maybe Integer])
Prelude Data.IORef> p <- newIORef l
Prelude Data.IORef> :p p
p = GHC.IOBase.IORef (GHC.STRef.STRef {((_t6::Maybe Integer) :
(_t7::[Maybe Integer]))})
Prelude Data.IORef> :sp p
p = GHC.IOBase.IORef (GHC.STRef.STRef {(_ : _)})
I used braces to denote the contents of a reference.
Perhaps there is a more appropriate notation?
]
[refactoring only
Pepe Iborra <mnislaih at gmail.com>**20071202125400]
[Change --shared to -shared in Win32 DLL docs
simonpj at microsoft.com**20071204154023]
[protect console handler against concurrent access (#1922)
Simon Marlow <simonmar at microsoft.com>**20071204153918]
[Make eta reduction check more carefully for bottoms (fix Trac #1947)
simonpj at microsoft.com**20071204145803
Eta reduction was wrongly transforming
f = \x. f x
to
f = f
Solution: don't trust f's arity information; instead look at its
unfolding. See Note [Eta reduction conditions]
Almost all the new lines are comments!
]
[Improve inlining for INLINE non-functions
simonpj at microsoft.com**20071204114955
(No need to merge to 6.8, but no harm if a subsequent patch needs it.)
The proximate cause for this patch is to improve the inlining for INLINE
things that are not functions; this came up in the NDP project. See
Note [Lone variables] in CoreUnfold.
This caused some refactoring that actually made things simpler. In
particular, more of the inlining logic has moved from SimplUtils to
CoreUnfold, where it belongs.
]
[fix race conditions in sandboxIO (#1583, #1922, #1946)
Simon Marlow <simonmar at microsoft.com>**20071204114444
using the new block-inheriting forkIO (#1048)
]
[:cd with no argument goes to the user's home directory
Simon Marlow <simonmar at microsoft.com>**20071204113945
Seems better than getting a confusing 'cannot find directory' exception.
]
[forkIO starts the new thread blocked if the parent is blocked (#1048)
Simon Marlow <simonmar at microsoft.com>**20071204110947]
[Improve eta reduction, to reduce Simplifier iterations
simonpj at microsoft.com**20071203150039
I finally got around to investigating why the Simplifier was sometimes
iterating so often. There's a nice example in Text.ParserCombinators.ReadPrec,
which produced:
NOTE: Simplifier still going after 3 iterations; bailing out. Size = 339
NOTE: Simplifier still going after 3 iterations; bailing out. Size = 339
NOTE: Simplifier still going after 3 iterations; bailing out. Size = 339
No progress is being made. It turned out that an interaction between
eta-expansion, casts, and eta reduction was responsible. The change is
small and simple, in SimplUtils.mkLam: do not require the body to be
a Lam when floating the cast outwards.
I also discovered a missing side condition in the same equation, so fixing
that is good too. Now there is no loop when compiling ReadPrec.
Should do a full nofib run though.
]
[Don't default to stripping binaries when installing
Ian Lynagh <igloo at earth.li>**20071202195817]
[Improve pretty-printing for Insts
simonpj at microsoft.com**20071128173125]
[Reorganise TcSimplify (again); FIX Trac #1919
simonpj at microsoft.com**20071128173146
This was a bit tricky. We had a "given" dict like (d7:Eq a); then it got
supplied to reduceImplication, which did some zonking, and emerged with
a "needed given" (d7:Eq Int). That got everything confused.
I found a way to simplify matters significantly. Now reduceContext
- first deals with methods/literals/dictionaries
- then deals with implications
Separating things in this way not only made the bug go away, but
eliminated the need for the recently-added "needed-givens" results returned
by checkLoop. Hurrah.
It's still a swamp. But it's a bit better.
]
[FIX #1914: GHCi forgot all the modules that were loaded before an error
Simon Marlow <simonmar at microsoft.com>**20071130130734]
[FIX #1744: ignore the byte-order mark at the beginning of a file
Simon Marlow <simonmar at microsoft.com>**20071130101100]
[FIX Trac #1935: generate superclass constraints for derived classes
simonpj at microsoft.com**20071128150541
This bug only reports a problem with phantom types, but actually
there was quite a long-standing and significant omission in the
constraint generation for derived classes. See
Note [Superclasses of derived instance] in TcDeriv.
The test deriving-1935 tests both cases.
]
[Print a bit more info in VarBinds (no need to merge)
simonpj at microsoft.com**20071128150354]
[Check for duplicate bindings in CoreLint
simonpj at microsoft.com**20071128150214]
[add comment
Simon Marlow <simonmar at microsoft.com>**20071128111417]
[FIX #1916: don't try to convert float constants to int in CMM optimizer
Bertram Felgenhauer <int-e at gmx.de>**20071122095513]
[give a more useful message when the static flags have not been initialised (#1938)
Simon Marlow <simonmar at microsoft.com>**20071127135435]
[Rebuild utils with the stage1 compiler when making a bindist; fixes trac #1860
Ian Lynagh <igloo at earth.li>**20071127203959
This is a bit unpleasant, as "make binary-dist" really shouldn't actually
build anything, but it works.
]
[Remove the --print-docdir flag
Ian Lynagh <igloo at earth.li>**20071127195605
It wasn't doing the right thing for bindists. Let's rethink...
]
[FIX #1925: the interpreter was not maintaining tag bits correctly
Simon Marlow <simonmar at microsoft.com>**20071127122614
See comment for details
]
[add missing instruction: ALLOC_AP_NOUPD
Simon Marlow <simonmar at microsoft.com>**20071127122604]
[Check tag bits on the fun pointer of a PAP
Simon Marlow <simonmar at microsoft.com>**20071126160420]
[canonicalise the path to HsColour
Simon Marlow <simonmar at microsoft.com>**20071126141614]
[Consistently put www. on the front of haskell.org in URLs
Ian Lynagh <igloo at earth.li>**20071126215256]
[Fix some more URLs
Ian Lynagh <igloo at earth.li>**20071126214147]
[Tweak some URLs
Ian Lynagh <igloo at earth.li>**20071126194148]
[Fix some links
Ian Lynagh <igloo at earth.li>**20071126184406]
[Copy gmp stamps into bindists, so we don't try and rebuild gmp
Ian Lynagh <igloo at earth.li>**20071125211919]
[On Windows, Delete the CriticalSection's we Initialize
Ian Lynagh <igloo at earth.li>**20071125125845]
[On Windows, add a start menu link to the flag reference
Ian Lynagh <igloo at earth.li>**20071125124429]
[Remove html/ from the paths we put in the start menu on Windows
Ian Lynagh <igloo at earth.li>**20071125124150]
[MERGED: Make ":" in GHCi repeat the last command
Ian Lynagh <igloo at earth.li>**20071125122020
Ian Lynagh <igloo at earth.li>**20071124231857
It used to be a synonym for ":r" in 6.6.1, but this wasn't documented or
known about by the developers. In 6.8.1 it was accidentally broken.
This patch brings it back, but as "repeat the last command", similar to
pressing enter in gdb. This is almost as good for people who want it to
reload, and means that it can also be used to repeat commands like :step.
]
[MERGED: Put library docs in a $pkg, rather than $pkgid, directory; fixes trac #1864
Ian Lynagh <igloo at earth.li>**20071124212305
Ian Lynagh <igloo at earth.li>**20071124171220
]
[Don't make a library documentation prologue
Ian Lynagh <igloo at earth.li>**20071124211943
It's far too large now, and no-one complained when 6.8.1 didn't have one.
]
[Don't put package version numbers in links in index.html
Ian Lynagh <igloo at earth.li>**20071124211629]
[Define install-strip in Makefile
Ian Lynagh <igloo at earth.li>**20071124205037]
[Define install-strip in distrib/Makefile
Ian Lynagh <igloo at earth.li>**20071124204803]
[Install gmp from bindists; fixes trac #1848
Ian Lynagh <igloo at earth.li>**20071124185240]
[(native gen) fix code generated for GDTOI on x86_32
Bertram Felgenhauer <int-e at gmx.de>**20071121063942
See trac #1910.
]
[Copy the INSTALL hack from mk/config.mk.in into distrib/Makefile-bin-vars.in
Ian Lynagh <igloo at earth.li>**20071124163028
configure will set INSTALL to ./install-sh if it can't find it in the path,
so we need to replace the . with the path to our root.
]
[Make install-sh executable /before/ we try to find it
Ian Lynagh <igloo at earth.li>**20071124162450]
[Document --info in the +RTS -? help
Ian Lynagh <igloo at earth.li>**20071123204352]
[MERGED: If we have hscolour then make source code links in teh haddock docs
Ian Lynagh <igloo at earth.li>**20071123233113
Fri Nov 23 13:15:59 PST 2007 Ian Lynagh <igloo at earth.li>
]
[Tidy and trim the type environment in mkBootModDetails
simonpj at microsoft.com**20071123153519
Should fix Trac #1833
We were failing to trim the type envt in mkBootModDetails, so several
functions all called (*), for example, were getting into the interface.
Result chaos. It only actually bites when we do the retyping-loop thing,
which is why it's gone so long without a fix.
]
[refactor: HscNothing and boot modules do not need desugaring
Simon Marlow <simonmar at microsoft.com>**20071123135237]
[FIX #1910: fix code generated for GDTOI on x86_32
Bertram Felgenhauer <int-e at gmx.de>*-20071121102627]
[Properly ppr InstEqs in wanteds of implication constraints
Manuel M T Chakravarty <chak at cse.unsw.edu.au>**20071122093002]
[FIX #1910: fix code generated for GDTOI on x86_32
Bertram Felgenhauer <int-e at gmx.de>**20071121102627]
[Add built-in Double operations to vectorisation
Roman Leshchinskiy <rl at cse.unsw.edu.au>**20071122002517]
[Teach vectorisation about Double
Roman Leshchinskiy <rl at cse.unsw.edu.au>**20071121054932]
[Vectorise polyexprs with notes
Roman Leshchinskiy <rl at cse.unsw.edu.au>**20071121053102]
[Make rebindable do-notation behave as advertised
simonpj at microsoft.com**20071121174914
Adopt Trac #1537. The patch ended up a bit bigger than I expected,
so I suggest we do not merge this into the 6.8 branch. But there
is no funadamental reason why not.
With this patch, rebindable do-notation really does type as if you
had written the original (>>) and (>>=) operations in desguared form.
I ended up refactoring some of the (rather complicated) error-context
stuff in TcUnify, by pushing an InstOrigin into tcSubExp and its
various calls. That means we could get rid of tcFunResTy, and the
SubCtxt type. This should improve error messages slightly
in complicated situations, because we have an Origin to hand
to instCall (in the (isSigmaTy actual_ty) case of tc_sub1).
Thanks to Pepe for the first draft of the patch.
]
[Add DEBUG-only flag -dsuppress-uniques to suppress printing of uniques
simonpj at microsoft.com**20071116152446
This is intended only for debugging use: it makes it easier to
compare two variants without the variations between uniques mattering.
(Of course, you can't actually feed the output to the C compiler
or assembler and expect anything sensible to happen!)
]
[Add -dcore-lint when validating libraries
simonpj at microsoft.com**20071105164733]
[Fix Trac #1913: check data const for derived types are in scope
simonpj at microsoft.com**20071121151428
When deriving an instance, the data constructors should all be in scope.
This patch checks the condition.
]
[Fix Trac #1909: type of map in docs
simonpj at microsoft.com**20071120160152]
[Move file locking into the RTS, fixing #629, #1109
Simon Marlow <simonmar at microsoft.com>**20071120140859
File locking (of the Haskell 98 variety) was previously done using a
static table with linear search, which had two problems: the array had
a fixed size and was sometimes too small (#1109), and performance of
lockFile/unlockFile was suboptimal due to the linear search.
Also the algorithm failed to count readers as required by Haskell 98
(#629).
Now it's done using a hash table (provided by the RTS). Furthermore I
avoided the extra fstat() for every open file by passing the dev_t and
ino_t into lockFile. This and the improvements to the locking
algorithm result in a healthy 20% or so performance increase for
opening/closing files (see openFile008 test).
]
[FIX Trac #1825: standalone deriving Typeable
simonpj at microsoft.com**20071120125732
Standalone deriving of typeable now requires you to say
instance Typeable1 Maybe
which is exactly the shape of instance decl that is generated
by a 'deriving( Typeable )' clause on the data type decl.
This is a bit horrid, but it's the only consistent way, at least
for now. If you say something else, the error messages are helpful.
MERGE to 6.8 branch
]
[FIX #1715: egregious bug in ifaceDeclSubBndrs
simonpj at microsoft.com**20071120111723
ifaceDeclSubBndrs didn't have an IfaceSyn case; but with type
families an IfaceSyn can introduce subordinate binders. Result:
chaos.
The fix is easy though. Merge to 6.8 branch.
]
[Always do 'setup makefile' before building each library
Simon Marlow <simonmar at microsoft.com>**20071120103329
This forces preprocessing to happen, which is necessary if any of the
.hsc files have been modified. Without this change, a 'setup
makefile' would be required by hand after a .hsc file changed.
Fortunately 'setup makefile' isn't much extra work, and I've made it
not overwrite GNUmakefile if it hasn't changed, which avoids
recalculating the dependencies each time.
]
[FIX #1847 (improve :browse! docs, fix unqual)
claus.reinke at talk21.com**20071108013147
- add example to docs, explain how to interpret
output of `:browse! Data.Maybe`
- print unqualified names according to current
context, not the context of the target module
]
[Track changes to package ndp
Roman Leshchinskiy <rl at cse.unsw.edu.au>**20071120033716]
[Temporary hack for passing PArrays from unvectorised to vectorised code
Roman Leshchinskiy <rl at cse.unsw.edu.au>**20071120024545]
[Bind NDP stuff to [:.:] arrays
Roman Leshchinskiy <rl at cse.unsw.edu.au>**20071119020302]
[Don't treat enumerations specially during vectorisation for the moment
Roman Leshchinskiy <rl at cse.unsw.edu.au>**20071119013729]
[Fix bugs in vectorisation of case expressions
Roman Leshchinskiy <rl at cse.unsw.edu.au>**20071119013714]
[More built-in NDP combinators
Roman Leshchinskiy <rl at cse.unsw.edu.au>**20071119012205]
[New vectorisation built-ins
Roman Leshchinskiy <rl at cse.unsw.edu.au>**20071118051940]
[Fix bug in conversion unvect/vect
Roman Leshchinskiy <rl at cse.unsw.edu.au>**20071118051926]
[Extend built-in vectorisation environments
Roman Leshchinskiy <rl at cse.unsw.edu.au>**20071118045219]
[Fix bug in generation of environments for vectorisation
Roman Leshchinskiy <rl at cse.unsw.edu.au>**20071118045203]
[Add builtin var->var mapping to vectorisation
Roman Leshchinskiy <rl at cse.unsw.edu.au>**20071118042605]
[Extend vectorisation built-in mappings with datacons
Roman Leshchinskiy <rl at cse.unsw.edu.au>**20071118034351]
[Change representation of parallel arrays of enumerations
Roman Leshchinskiy <rl at cse.unsw.edu.au>**20071118033355]
[Add vectorisation-related builtin
Roman Leshchinskiy <rl at cse.unsw.edu.au>**20071118031513]
[Teach vectorisation about Bool
Roman Leshchinskiy <rl at cse.unsw.edu.au>**20071117042714]
[Incomplete support for boxing during vectorisation
Roman Leshchinskiy <rl at cse.unsw.edu.au>**20071117040739]
[Make sure some TyCons always vectorise to themselves
Roman Leshchinskiy <rl at cse.unsw.edu.au>**20071117040537]
[Simple conversion vectorised -> unvectorised
Roman Leshchinskiy <rl at cse.unsw.edu.au>**20071117023029]
[Fix bug in case vectorisation
Roman Leshchinskiy <rl at cse.unsw.edu.au>**20071117015014]
[Vectorisation of algebraic case expressions
Roman Leshchinskiy <rl at cse.unsw.edu.au>**20071116074814]
[More vectorisation-related built-ins
Roman Leshchinskiy <rl at cse.unsw.edu.au>**20071116061831]
[Vectorisation utilities
Roman Leshchinskiy <rl at cse.unsw.edu.au>**20071116051037]
[Add vectorisation built-ins
Roman Leshchinskiy <rl at cse.unsw.edu.au>**20071116050959]
[Fix vectorisation of binders in case expressions
Roman Leshchinskiy <rl at cse.unsw.edu.au>**20071116021833]
[Two small typos in the flags summary (merge to 6.8 branch)
simonpj at microsoft.com**20071119134639]
[Improve the situation for Trac #959: civilised warning instead of a trace msg
simonpj at microsoft.com**20071119122938
This doesn't fix the root cause of the bug, but it makes the report
more civilised, and points to further info.
]
[FIX Trac #1806: test for correct arity for datacon in infix pattern patch
simonpj at microsoft.com**20071119114301
Happily the fix is easy; pls merge
]
[Accept x86_64-*-freebsd* as well as amd64-*-freebsd* in configure.ac
Ian Lynagh <igloo at earth.li>**20071117154502
Patch from Brian P. O'Hanlon
]
[Attempt at fixing #1873, #1360
Simon Marlow <simonmar at microsoft.com>**20071116152148
I think I figured out a reasonable way to manage the GHCi context,
comments welcome.
Rule 1: external package modules in the context are persistent. That
is, when you say 'import Data.Maybe' it survives over :load, :add,
:reload and :cd.
Rule 2: :load and :add remove all home-package modules from the
context and add the rightmost target, as a *-module if possible. This
is as before, and makes sense for :load because we're starting a new
program; the old home-package modules don't make sense any more. For
:add, it usually does what you want, because the new target will
become the context.
Rule 3: any modules from the context that fail to load during a
:reload are remembered, and re-added to the context at the next
successful :reload.
Claus' suggestion about adding the "remembered" modules to the prompt
prefixed with a ! is implemented but commented out. I couldn't
decide whether it was useful or confusing.
One difference that people might notice is that after a :reload where
there were errors, GHCi would previously dump you in the most recent
module that it loaded. Now it dumps you in whatever subset of the
current context still makes sense, and in the common case that will
probably be {Prelude}.
]
[Wibble to fix Trac #1901 (shorten messsage slightly)
simonpj at microsoft.com**20071116150341]
[Improve links from flag reference to the relevant section; and improve doc of RankN flags
simonpj at microsoft.com**20071116145816]
[FIX Trac #1901: check no existential context in H98 mode
simonpj at microsoft.com**20071116145609]
[Improve documentation of data type declarations (Trac #1901)
simonpj at microsoft.com**20071116081841]
[Change the command-line semantics for query commands
Simon Marlow <simonmar at microsoft.com>**20071116132046
From the help text:
Commands that query the package database (list, latest, describe,
field) operate on the list of databases specified by the flags
--user, --global, and --package-conf. If none of these flags are
given, the default is --global --user.
This makes it possible to query just a single database (e.g. the
global one without the user one), which needed tricks to accomplish
before.
]
[use "ghc-pkg latest --global" instead of "ghc-pkg list --simple-output"
Simon Marlow <simonmar at microsoft.com>**20071116122018
The former now does the right thing: it uses the global database only,
and picks the most recent package with the given name.
]
[Disallow installing packages whose names differ in case only.
Simon Marlow <simonmar at microsoft.com>**20071116121153
--force overrides. Requested by Duncan Coutts, with a view to
treating package names as case-insensitive in the future.
]
[FIX BUILD (with GHC 6.2.x): update .hi-boot file
Simon Marlow <simonmar at microsoft.com>**20071116101227]
[FIX #1828: installing to a patch with spaces in
Simon Marlow <simonmar at microsoft.com>**20071115155747
We have to pass the path to gcc when calling windres, which itself
might have spaces in. Furthermore, we have to pass the path to gcc's
tools to gcc. This means getting the quoting right, and after much
experimentation and reading of the windres sources I found something
that works: passing --use-temp-files to windres makes it use its own
implementation of quoting instead of popen(), and this does what we
want. Sigh.
]
[on Windows, install to a directory with spaces (test for #1828)
Simon Marlow <simonmar at microsoft.com>**20071115155327]
[FIX #1679: crash on returning from a foreign call
Simon Marlow <simonmar at microsoft.com>**20071115131635
We forgot to save a pointer to the BCO over the foreign call. Doing
enough allocation and GC during the call could provoke a crash.
]
[Avoid the use of unversioned package dependencies
Simon Marlow <simonmar at microsoft.com>**20071115103249
Fortunately "ghc-pkg list $pkg --simple-output" is a good way to add
the version number.
]
[FIX #1596 (remove deprecated --define-name)
Simon Marlow <simonmar at microsoft.com>**20071114165323
Also remove the old command-line syntax for ghc-pkg, which was not
documented. Do not merge.
]
[FIX #1837: remove deprecated support for unversioned dependencies (do not merge)
Simon Marlow <simonmar at microsoft.com>**20071114161044
]
[wibble
Pepe Iborra <mnislaih at gmail.com>**20071114233356]
[Make pprNameLoc more robust in absence of loc information
Pepe Iborra <mnislaih at gmail.com>**20071114233343]
[Try to manage the size of the text rendered for ':show bindings'
Pepe Iborra <mnislaih at gmail.com>**20071114231601]
[Make the Term ppr depth aware
Pepe Iborra <mnislaih at gmail.com>**20071114183417]
[Use paragraph fill sep where possible
Pepe Iborra <mnislaih at gmail.com>**20071114181233]
[Make SpecConstr work again
simonpj at microsoft.com**20071115084242
In a typo I'd written env instead of env', and as a result RULES are
practically guaranteed not to work in a recursive group. This pretty
much kills SpecConstr in its tracks!
Well done Kenny Lu for spotting this. The fix is easy.
Merge into 6.8 please.
]
[Documentation only - fix typo in flags reference
Tim Chevalier <chevalier at alum.wellesley.edu>**20071115055748]
[Avoid making Either String an instance of Monad in the Haddock parser
David Waern <david.waern at gmail.com>**20071114204050]
[FIX 1463 (implement 'ghc-pkg find-module')
claus.reinke at talk21.com**20071109162652
- the ticket asks for a module2package lookup in ghc-pkg
(this would be useful to have in cabal, as well)
- we can now ask which packages expose a module we need,
eg, when preparing a cabal file or when getting errors
after package reorganisations:
$ ./ghc-pkg-inplace find-module Var
c:/fptools/ghc/driver/package.conf.inplace:
(ghc-6.9.20071106)
$ ./ghc-pkg-inplace find-module Data.Sequence
c:/fptools/ghc/driver/package.conf.inplace:
containers-0.1
- implemented as a minor variation on listPackages
(as usual, it would be useful if one could combine
multiple queries into one)
]
[remove --define-name from the --help usage message (#1596)
Simon Marlow <simonmar at microsoft.com>**20071114153417
]
[FIX #1837: emit deprecated message for unversioned dependencies
Simon Marlow <simonmar at microsoft.com>**20071114153010]
[Fix #782, #1483, #1649: Unicode GHCi input
Simon Marlow <simonmar at microsoft.com>**20071114151411
GHCi input is now treated universally as UTF-8, except for the Windows
console where we do the correct conversion from the current code
page (see System.Win32.stringToUnicode).
That leaves non-UTF-8 locales on Unix as unsupported, but (a) we only
accept source files in UTF-8 anyway, and (b) UTF-8 is quite ubiquitous
as the default locale.
]
[Fix build
David Waern <david.waern at gmail.com>**20071114125842
I had forgot to update HaddockLex.hi-boot-6, so the build with 6.2.2
failed. This fixes that.
]
[FIX Trac 1662: actually check for existentials in proc patterns
simonpj at microsoft.com**20071114112930
I'd fixed the bug for code that should be OK, but had forgotten to
make the test for code that should be rejected!
Test is arrowfail004
]
[FIX Trac 1888; duplicate INLINE pragmas
simonpj at microsoft.com**20071114104701
There are actually three things here
- INLINE pragmas weren't being pretty-printed properly
- They were being classified into too-narrow boxes by eqHsSig
- They were being printed in to much detail by hsSigDoc
All easy. Test is rnfail048.
]
[Run the -frule-check pass more often (when asked)
simonpj at microsoft.com**20071114104632]
[GHCi debugger: added a new flag, -fno-print-binding-contents
Pepe Iborra <mnislaih at gmail.com>**20071113174539
The contents of bindings show at breakpoints and by :show bindings
is rendered using the same printer that :print uses.
But sometimes the output it gives spans over too many lines and the
user may want to be able to disable it.
]
[Fix Trac 1865: GHCi debugger crashes with :print
Pepe Iborra <mnislaih at gmail.com>**20071113170113]
[Replaced two uses of head b explicit pattern matching
Pepe Iborra <mnislaih at gmail.com>**20071013113136]
[Print binding contents in :show bindings
Pepe Iborra <mnislaih at gmail.com>**20071006123952]
[ Leftovers from the 1st GHCi debugger prototype
Pepe Iborra <mnislaih at gmail.com>**20071004204718]
[Following an indirection doesn't count as a RTTI step
Pepe Iborra <mnislaih at gmail.com>**20070928091941]
[FIX #1653 (partially): add -X flags to completion for :set
Simon Marlow <simonmar at microsoft.com>**20071113153257]
[Merge from Haddock: Add <<url>> for images
David Waern <david.waern at gmail.com>**20071112220537
A merge of this patch:
Mon Aug 7 16:22:14 CEST 2006 Simon Marlow <simonmar at microsoft.com>
* Add <<url>> for images
Submitted by: Lennart Augustsson
Please merge to the 6.8.2 branch.
]
[Improve documentation of INLINE, esp its interactions with other transformations
simonpj at microsoft.com**20071112160240]
[Comment re Trac #1220
simonpj at microsoft.com**20071112154109]
[Merge from Haddock: Modify lexing of /../
David Waern <david.waern at gmail.com>**20071112023856
Tue Aug 28 11:19:54 CEST 2007 Simon Marlow <simonmar at microsoft.com>
* Modify lexing of /../
This makes /../ more like '..', so that a single / on a line doesn't
trigger a parse error. This should reduce the causes of accidental
parse errors in Haddock comments; apparently stray / characters are
a common source of failures.
Please merge this to the 6.8.2 branch.
]
[Merge from Haddock: allow blank lines inside code blocks
David Waern <david.waern at gmail.com>**20071112013439
Tue Jan 9 14:14:34 CET 2007 Simon Marlow <simonmar at microsoft.com>
* allow blank lines inside a @...@ code block
Please merge this to the 6.8.2 branch
]
[Merge of a patch from the old Haddock branch:
David Waern <david.waern at gmail.com>**20071112013143
Fri Jan 5 12:13:41 CET 2007 Simon Marlow <simonmar at microsoft.com>
* Fix up a case of extra vertical space after a code block
Please merge this to the 6.8.2 branch
]
[Remove ex-extralibs from libraries/Makefile
Ian Lynagh <igloo at earth.li>**20071111213618]
[Remove the X11 and HGL libraries from extralibs
Ian Lynagh <igloo at earth.li>**20071111213447
Don Stewart, X11 maintainer, requested we remove X11, and HGL depends on it
on Linux (and we don't try to build HGL on Windows).
]
[arrows is no longer an extralib
Ian Lynagh <igloo at earth.li>**20071027123656]
[Turn -fprint-bind-result off by default
Ian Lynagh <igloo at earth.li>**20071111001126]
[TAG 2007-11-11
Ian Lynagh <igloo at earth.li>**20071111161540]
Patch bundle hash:
8a21ece0a816567b38d5870f7f8967a3173d253d
More information about the Cvs-ghc
mailing list