From git at git.haskell.org Fri May 2 13:50:22 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 2 May 2014 13:50:22 +0000 (UTC) Subject: [commit: ghc] master: Per-thread allocation counters and limits (b0534f7) Message-ID: <20140502135022.821402416A@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/b0534f78a73f972e279eed4447a5687bd6a8308e/ghc >--------------------------------------------------------------- commit b0534f78a73f972e279eed4447a5687bd6a8308e Author: Simon Marlow Date: Mon Apr 28 16:55:47 2014 +0100 Per-thread allocation counters and limits This tracks the amount of memory allocation by each thread in a counter stored in the TSO. Optionally, when the counter drops below zero (it counts down), the thread can be sent an asynchronous exception: AllocationLimitExceeded. When this happens, given a small additional limit so that it can handle the exception. See documentation in GHC.Conc for more details. Allocation limits are similar to timeouts, but - timeouts use real time, not CPU time. Allocation limits do not count anything while the thread is blocked or in foreign code. - timeouts don't re-trigger if the thread catches the exception, allocation limits do. - timeouts can catch non-allocating loops, if you use -fno-omit-yields. This doesn't work for allocation limits. I couldn't measure any impact on benchmarks with these changes, even for nofib/smp. >--------------------------------------------------------------- b0534f78a73f972e279eed4447a5687bd6a8308e compiler/cmm/CmmLayoutStack.hs | 9 +- compiler/codeGen/StgCmmForeign.hs | 268 ++++++++++++++------ includes/CodeGen.Platform.hs | 4 +- includes/rts/Constants.h | 6 + includes/rts/Flags.h | 8 + includes/rts/Threads.h | 8 +- includes/rts/storage/TSO.h | 31 ++- libraries/base/Control/Exception.hs | 1 + libraries/base/Control/Exception/Base.hs | 1 + libraries/base/GHC/Conc.lhs | 6 + libraries/base/GHC/Conc/Sync.lhs | 92 ++++++- libraries/base/GHC/IO/Exception.hs | 21 +- rts/HeapStackCheck.cmm | 4 +- rts/Linker.c | 4 + rts/Prelude.h | 2 + rts/RaiseAsync.c | 54 ++++ rts/RaiseAsync.h | 4 + rts/RtsFlags.c | 10 + rts/RtsStartup.c | 1 + rts/Schedule.c | 19 ++ rts/Threads.c | 77 +++--- rts/package.conf.in | 2 + rts/sm/Storage.c | 6 + testsuite/tests/concurrent/should_run/all.T | 7 + .../tests/concurrent/should_run/allocLimit1.hs | 9 + .../tests/concurrent/should_run/allocLimit1.stderr | 1 + .../tests/concurrent/should_run/allocLimit2.hs | 17 ++ .../tests/concurrent/should_run/allocLimit3.hs | 15 ++ .../tests/concurrent/should_run/allocLimit3.stderr | 1 + .../should_run/allocLimit3.stdout} | 1 - .../tests/concurrent/should_run/allocLimit4.hs | 31 +++ utils/deriveConstants/DeriveConstants.hs | 1 + 32 files changed, 576 insertions(+), 145 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc b0534f78a73f972e279eed4447a5687bd6a8308e From git at git.haskell.org Sat May 3 13:28:15 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 3 May 2014 13:28:15 +0000 (UTC) Subject: [commit: haddock] ghc-7.8: Merge branch 'v2.14' into ghc-7.8 (288756b) Message-ID: <20140503132815.D234C2406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : ghc-7.8 Link : http://git.haskell.org/haddock.git/commitdiff/288756b6f306dc7565f91025f8d3cc4fd7e892d2 >--------------------------------------------------------------- commit 288756b6f306dc7565f91025f8d3cc4fd7e892d2 Merge: 42757dd 0fce760 Author: Herbert Valerio Riedel Date: Sat May 3 15:25:43 2014 +0200 Merge branch 'v2.14' into ghc-7.8 This merges the soon-to-be-tagged haddock-2.14.3 into ghc-7.8 to make sure the important bugfix release makes it into GHC 7.8.3 Signed-off-by: Herbert Valerio Riedel >--------------------------------------------------------------- 288756b6f306dc7565f91025f8d3cc4fd7e892d2 CHANGES | 4 ++ doc/haddock.xml | 2 +- haddock.cabal | 6 +- html-test/ref/{Bug201.html => Bug298.html} | 89 +++++++++++++++++++--------- html-test/run.lhs | 14 ++++- html-test/src/Bug298.hs | 22 +++++++ html-test/src/Bug85.hs | 1 - src/Haddock/Parser.hs | 10 +++- 8 files changed, 112 insertions(+), 36 deletions(-) From git at git.haskell.org Sat May 3 13:28:17 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 3 May 2014 13:28:17 +0000 (UTC) Subject: [commit: haddock] ghc-7.8's head updated: Merge branch 'v2.14' into ghc-7.8 (288756b) Message-ID: <20140503132817.B4EEB2406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock Branch 'ghc-7.8' now includes: c1e330f Version bump. 99e3705 We don't actually want unicode here 81c379d Parse identifiers with ^ and ? in them. 4e9aa92 Ignore version string during HTML tests. 0fce760 Enforce strict GHC version in cabal file 288756b Merge branch 'v2.14' into ghc-7.8 From git at git.haskell.org Sat May 3 13:41:30 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 3 May 2014 13:41:30 +0000 (UTC) Subject: [commit: haddock] master: Disambiguate ‘die’ in test runners. (dba02d6) Message-ID: <20140503134130.C12722406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/dba02d6df32534aac5d257f2d28596238d248942 >--------------------------------------------------------------- commit dba02d6df32534aac5d257f2d28596238d248942 Author: Mateusz Kowalczyk Date: Sat May 3 15:40:11 2014 +0200 Disambiguate ?die? in test runners. >--------------------------------------------------------------- dba02d6df32534aac5d257f2d28596238d248942 html-test/run.lhs | 2 +- latex-test/run.lhs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/html-test/run.lhs b/html-test/run.lhs index 153ab32..a866436 100755 --- a/html-test/run.lhs +++ b/html-test/run.lhs @@ -41,7 +41,7 @@ main = do test :: IO () test = do x <- doesFileExist haddockPath - unless x $ die "you need to run 'cabal build' successfully first" + unless x $ System.Exit.die "you need to run 'cabal build' successfully first" contents <- getDirectoryContents testDir args <- getArgs diff --git a/latex-test/run.lhs b/latex-test/run.lhs index 423dc6f..c1d48d9 100755 --- a/latex-test/run.lhs +++ b/latex-test/run.lhs @@ -41,7 +41,7 @@ main = do test :: IO () test = do x <- doesFileExist haddockPath - unless x $ die "you need to run 'cabal build' successfully first" + unless x $ System.Exit.die "you need to run 'cabal build' successfully first" contents <- getDirectoryContents testDir From git at git.haskell.org Sat May 3 13:51:13 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 3 May 2014 13:51:13 +0000 (UTC) Subject: [commit: ghc] master: Update Haddock submodule ref. Fixes `cabal test'. (a05f8dd) Message-ID: <20140503135113.4EEEB2406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/a05f8dd15b51db7e71ab783182548f1af6dd2ceb/ghc >--------------------------------------------------------------- commit a05f8dd15b51db7e71ab783182548f1af6dd2ceb Author: Mateusz Kowalczyk Date: Sat May 3 15:43:00 2014 +0200 Update Haddock submodule ref. Fixes `cabal test'. >--------------------------------------------------------------- a05f8dd15b51db7e71ab783182548f1af6dd2ceb utils/haddock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/haddock b/utils/haddock index 08aa509..dba02d6 160000 --- a/utils/haddock +++ b/utils/haddock @@ -1 +1 @@ -Subproject commit 08aa509ebac58bfb202ea79c7c41291ec280a1c5 +Subproject commit dba02d6df32534aac5d257f2d28596238d248942 From git at git.haskell.org Sat May 3 18:19:25 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 3 May 2014 18:19:25 +0000 (UTC) Subject: [commit: ghc] master: Remove external core (5bf22f0) Message-ID: <20140503181925.7BC1B2406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/5bf22f06ef71f61094de7564dee770f136d5481a/ghc >--------------------------------------------------------------- commit 5bf22f06ef71f61094de7564dee770f136d5481a Author: Austin Seipp Date: Sun Apr 27 21:11:23 2014 -0500 Remove external core Signed-off-by: Austin Seipp >--------------------------------------------------------------- 5bf22f06ef71f61094de7564dee770f136d5481a aclocal.m4 | 2 +- compiler/coreSyn/ExternalCore.lhs | 118 -- compiler/coreSyn/MkExternalCore.lhs | 360 ------ compiler/coreSyn/PprExternalCore.lhs | 260 ---- compiler/ghc.cabal.in | 6 - compiler/hsSyn/HsSyn.lhs | 12 +- compiler/iface/TcIface.lhs | 35 +- compiler/main/DriverPhases.hs | 16 +- compiler/main/DriverPipeline.hs | 26 +- compiler/main/DynFlags.hs | 3 +- compiler/main/GHC.hs | 40 +- compiler/main/Hooks.lhs | 2 +- compiler/main/HscMain.hs | 36 +- compiler/parser/LexCore.hs | 115 -- compiler/parser/ParserCore.y | 397 ------ compiler/parser/ParserCoreUtils.hs | 77 -- compiler/typecheck/TcRnDriver.lhs | 129 +- compiler/typecheck/TcRnMonad.lhs | 11 - docs/users_guide/external_core.xml | 1804 ---------------------------- docs/users_guide/flags.xml | 2 +- docs/users_guide/glasgow_exts.xml | 63 - docs/users_guide/ug-book.xml.in | 1 - docs/users_guide/ug-ent.xml.in | 1 - docs/users_guide/using.xml | 38 - ghc.mk | 1 - mk/config.mk.in | 19 - testsuite/config/ghc | 7 +- testsuite/driver/testlib.py | 95 -- testsuite/tests/codeGen/should_run/all.T | 4 +- testsuite/tests/ext-core/Makefile | 29 - testsuite/tests/ext-core/T7239.hs | 8 - testsuite/tests/ext-core/all.T | 3 - testsuite/tests/ffi/should_compile/all.T | 21 +- testsuite/tests/ffi/should_run/all.T | 30 +- testsuite/tests/typecheck/should_run/all.T | 7 +- utils/genprimopcode/Main.hs | 6 +- 36 files changed, 51 insertions(+), 3733 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 5bf22f06ef71f61094de7564dee770f136d5481a From git at git.haskell.org Sat May 3 18:19:47 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 3 May 2014 18:19:47 +0000 (UTC) Subject: [commit: ghc] branch 'wip/kill-extcore' deleted Message-ID: <20140503181948.12F652406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc Deleted branch: wip/kill-extcore From git at git.haskell.org Sat May 3 21:49:22 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 3 May 2014 21:49:22 +0000 (UTC) Subject: [commit: ghc] master: fix rts exported symbols base_GHCziIOziException_allocationLimitExceeded_closure (54b31f7) Message-ID: <20140503214922.CF1842406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/54b31f744848da872c7c6366dea840748e01b5cf/ghc >--------------------------------------------------------------- commit 54b31f744848da872c7c6366dea840748e01b5cf Author: Sergei Trofimovich Date: Sat May 3 22:29:14 2014 +0300 fix rts exported symbols base_GHCziIOziException_allocationLimitExceeded_closure Commit b0534f78a73f972e279eed4447a5687bd6a8308e added new exported rts symbols, but slightly misspelled them. Observer on first compiled program: > Linking dist/build/haskell-updater/haskell-updater ... > /usr/lib64/ghc-7.9.20140503/rts-1.0/libHSrts.a(Schedule.o): In function `scheduleWaitThread': > (.text+0xc4c): undefined reference to `base_GHCziIOziException_allocationLimitExceeded_closure' > /usr/lib64/ghc-7.9.20140503/rts-1.0/libHSrts.a(RtsStartup.o): In function `hs_init_ghc': > (.text+0x2fa): undefined reference to `base_GHCziIOziException_allocationLimitExceeded_closure' > collect2: error: ld returned 1 exit status CC: Simon Marlow Signed-off-by: Sergei Trofimovich >--------------------------------------------------------------- 54b31f744848da872c7c6366dea840748e01b5cf rts/package.conf.in | 4 ++-- rts/win32/libHSbase.def | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/rts/package.conf.in b/rts/package.conf.in index 25fb5eb..914dd9c 100644 --- a/rts/package.conf.in +++ b/rts/package.conf.in @@ -98,7 +98,7 @@ ld-options: , "-Wl,-u,_base_ControlziExceptionziBase_nonTermination_closure" , "-Wl,-u,_base_GHCziIOziException_blockedIndefinitelyOnMVar_closure" , "-Wl,-u,_base_GHCziIOziException_blockedIndefinitelyOnSTM_closure" - , "-Wl,-u,_base_GHCziIOziException_allocationQuotaExceeded_closure" + , "-Wl,-u,_base_GHCziIOziException_allocationLimitExceeded_closure" , "-Wl,-u,_base_ControlziExceptionziBase_nestedAtomically_closure" , "-Wl,-u,_base_GHCziWeak_runFinalizzerBatch_closure" , "-Wl,-u,_base_GHCziTopHandler_flushStdHandles_closure" @@ -139,7 +139,7 @@ ld-options: , "-Wl,-u,base_ControlziExceptionziBase_nonTermination_closure" , "-Wl,-u,base_GHCziIOziException_blockedIndefinitelyOnMVar_closure" , "-Wl,-u,base_GHCziIOziException_blockedIndefinitelyOnSTM_closure" - , "-Wl,-u,base_GHCziIOziException_allocationQuotaExceeded_closure" + , "-Wl,-u,base_GHCziIOziException_allocationLimitExceeded_closure" , "-Wl,-u,base_ControlziExceptionziBase_nestedAtomically_closure" , "-Wl,-u,base_GHCziWeak_runFinalizzerBatch_closure" , "-Wl,-u,base_GHCziTopHandler_flushStdHandles_closure" diff --git a/rts/win32/libHSbase.def b/rts/win32/libHSbase.def index 119237b..6bb19da 100644 --- a/rts/win32/libHSbase.def +++ b/rts/win32/libHSbase.def @@ -36,6 +36,7 @@ EXPORTS base_GHCziPack_unpackCString_closure base_GHCziIOziException_blockedIndefinitelyOnMVar_closure base_GHCziIOziException_blockedIndefinitelyOnSTM_closure + base_GHCziIOziException_allocationLimitExceeded_closure base_GHCziIOziException_stackOverflow_closure base_ControlziExceptionziBase_nonTermination_closure From git at git.haskell.org Sun May 4 01:17:43 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 4 May 2014 01:17:43 +0000 (UTC) Subject: [commit: ghc] wip/ext-solver: An operational version of SMT integration for solving linear constraints. (7879bcb) Message-ID: <20140504011744.06E1A2406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ext-solver Link : http://ghc.haskell.org/trac/ghc/changeset/7879bcb0311b4fa808f681121b9d5be23e290f01/ghc >--------------------------------------------------------------- commit 7879bcb0311b4fa808f681121b9d5be23e290f01 Author: Iavor S. Diatchki Date: Sat May 3 18:17:32 2014 -0700 An operational version of SMT integration for solving linear constraints. This commit implements the missing "improvement" stage. It also refactors the code in two ways: - Most of the work is now done in module TcTypeNats - It removes the intermediate `Expr` type: now we go from GHC's `Ct` directly to SmtLib2 s-expressions (represented by type `SExpr`). >--------------------------------------------------------------- 7879bcb0311b4fa808f681121b9d5be23e290f01 compiler/typecheck/TcInteract.lhs | 57 ++--- compiler/typecheck/TcSMonad.lhs | 12 +- compiler/typecheck/TcTypeNats.hs | 472 ++++++++++++++++++++++--------------- 3 files changed, 301 insertions(+), 240 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 7879bcb0311b4fa808f681121b9d5be23e290f01 From git at git.haskell.org Sun May 4 08:20:44 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 4 May 2014 08:20:44 +0000 (UTC) Subject: [commit: ghc] master: Update comment now that we have per-gen weak pointer lists. (2e03d86) Message-ID: <20140504082044.74DE62406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/2e03d8664bcf39c26537d6cdcb97c3bfe081bb94/ghc >--------------------------------------------------------------- commit 2e03d8664bcf39c26537d6cdcb97c3bfe081bb94 Author: Edward Z. Yang Date: Sun May 4 01:18:54 2014 -0700 Update comment now that we have per-gen weak pointer lists. Signed-off-by: Edward Z. Yang >--------------------------------------------------------------- 2e03d8664bcf39c26537d6cdcb97c3bfe081bb94 rts/sm/MarkWeak.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/rts/sm/MarkWeak.c b/rts/sm/MarkWeak.c index 4e0c136..af953cd 100644 --- a/rts/sm/MarkWeak.c +++ b/rts/sm/MarkWeak.c @@ -39,10 +39,8 @@ new live weak pointers, then all the currently unreachable ones are dead. - For generational GC: we just don't try to finalize weak pointers in - older generations than the one we're collecting. This could - probably be optimised by keeping per-generation lists of weak - pointers, but for a few weak pointers this scheme will work. + For generational GC: we don't try to finalize weak pointers in + older generations than the one we're collecting. There are three distinct stages to processing weak pointers: From git at git.haskell.org Sun May 4 09:33:47 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 4 May 2014 09:33:47 +0000 (UTC) Subject: [commit: ghc] master: Improve docs for array indexing primops (5141baf) Message-ID: <20140504093347.7895B2406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/5141baf76132fe0d8f88cfa0a62698cc3b37e48a/ghc >--------------------------------------------------------------- commit 5141baf76132fe0d8f88cfa0a62698cc3b37e48a Author: Johan Tibell Date: Sun May 4 11:32:15 2014 +0200 Improve docs for array indexing primops >--------------------------------------------------------------- 5141baf76132fe0d8f88cfa0a62698cc3b37e48a compiler/prelude/primops.txt.pp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/compiler/prelude/primops.txt.pp b/compiler/prelude/primops.txt.pp index 10dd19d..dfc1421 100644 --- a/compiler/prelude/primops.txt.pp +++ b/compiler/prelude/primops.txt.pp @@ -1082,34 +1082,42 @@ primop IndexByteArrayOp_StablePtr "indexStablePtrArray#" GenPrimOp primop IndexByteArrayOp_Int8 "indexInt8Array#" GenPrimOp ByteArray# -> Int# -> Int# + {Read 8-bit integer; offset in bytes.} with can_fail = True primop IndexByteArrayOp_Int16 "indexInt16Array#" GenPrimOp ByteArray# -> Int# -> Int# + {Read 16-bit integer; offset in 16-bit words.} with can_fail = True primop IndexByteArrayOp_Int32 "indexInt32Array#" GenPrimOp ByteArray# -> Int# -> INT32 + {Read 32-bit integer; offset in 32-bit words.} with can_fail = True primop IndexByteArrayOp_Int64 "indexInt64Array#" GenPrimOp ByteArray# -> Int# -> INT64 + {Read 64-bit integer; offset in 64-bit words.} with can_fail = True primop IndexByteArrayOp_Word8 "indexWord8Array#" GenPrimOp ByteArray# -> Int# -> Word# + {Read 8-bit word; offset in bytes.} with can_fail = True primop IndexByteArrayOp_Word16 "indexWord16Array#" GenPrimOp ByteArray# -> Int# -> Word# + {Read 16-bit word; offset in 16-bit words.} with can_fail = True primop IndexByteArrayOp_Word32 "indexWord32Array#" GenPrimOp ByteArray# -> Int# -> WORD32 + {Read 32-bit word; offset in 32-bit words.} with can_fail = True primop IndexByteArrayOp_Word64 "indexWord64Array#" GenPrimOp ByteArray# -> Int# -> WORD64 + {Read 64-bit word; offset in 64-bit words.} with can_fail = True primop ReadByteArrayOp_Char "readCharArray#" GenPrimOp @@ -1126,11 +1134,13 @@ primop ReadByteArrayOp_WideChar "readWideCharArray#" GenPrimOp primop ReadByteArrayOp_Int "readIntArray#" GenPrimOp MutableByteArray# s -> Int# -> State# s -> (# State# s, Int# #) + {Read intger; offset in words.} with has_side_effects = True can_fail = True primop ReadByteArrayOp_Word "readWordArray#" GenPrimOp MutableByteArray# s -> Int# -> State# s -> (# State# s, Word# #) + {Read word; offset in words.} with has_side_effects = True can_fail = True From git at git.haskell.org Sun May 4 21:45:29 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 4 May 2014 21:45:29 +0000 (UTC) Subject: [commit: ghc] master: Revert "Per-thread allocation counters and limits" (f0fcc41) Message-ID: <20140504214529.449EA2406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/f0fcc41d755876a1b02d1c7c79f57515059f6417/ghc >--------------------------------------------------------------- commit f0fcc41d755876a1b02d1c7c79f57515059f6417 Author: Simon Marlow Date: Sun May 4 20:27:42 2014 +0100 Revert "Per-thread allocation counters and limits" Problems were found on 32-bit platforms, I'll commit again when I have a fix. This reverts the following commits: 54b31f744848da872c7c6366dea840748e01b5cf b0534f78a73f972e279eed4447a5687bd6a8308e >--------------------------------------------------------------- f0fcc41d755876a1b02d1c7c79f57515059f6417 compiler/cmm/CmmLayoutStack.hs | 9 +- compiler/codeGen/StgCmmForeign.hs | 268 ++++++--------------- includes/CodeGen.Platform.hs | 4 +- includes/rts/Constants.h | 6 - includes/rts/Flags.h | 8 - includes/rts/Threads.h | 8 +- includes/rts/storage/TSO.h | 31 +-- libraries/base/Control/Exception.hs | 1 - libraries/base/Control/Exception/Base.hs | 1 - libraries/base/GHC/Conc.lhs | 6 - libraries/base/GHC/Conc/Sync.lhs | 92 +------ libraries/base/GHC/IO/Exception.hs | 21 +- rts/HeapStackCheck.cmm | 4 +- rts/Linker.c | 4 - rts/Prelude.h | 2 - rts/RaiseAsync.c | 54 ----- rts/RaiseAsync.h | 4 - rts/RtsFlags.c | 10 - rts/RtsStartup.c | 1 - rts/Schedule.c | 19 -- rts/Threads.c | 77 +++--- rts/package.conf.in | 2 - rts/sm/Storage.c | 6 - rts/win32/libHSbase.def | 1 - testsuite/tests/concurrent/should_run/all.T | 7 - .../tests/concurrent/should_run/allocLimit1.hs | 9 - .../tests/concurrent/should_run/allocLimit1.stderr | 1 - .../tests/concurrent/should_run/allocLimit2.hs | 17 -- .../tests/concurrent/should_run/allocLimit3.hs | 15 -- .../tests/concurrent/should_run/allocLimit3.stderr | 1 - .../tests/concurrent/should_run/allocLimit3.stdout | 1 - .../tests/concurrent/should_run/allocLimit4.hs | 31 --- utils/deriveConstants/DeriveConstants.hs | 1 - 33 files changed, 144 insertions(+), 578 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc f0fcc41d755876a1b02d1c7c79f57515059f6417 From git at git.haskell.org Mon May 5 05:35:56 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 5 May 2014 05:35:56 +0000 (UTC) Subject: [commit: ghc] wip/ext-solver: A comment describing a problem with the current approach. (1815f26) Message-ID: <20140505053556.E46792406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ext-solver Link : http://ghc.haskell.org/trac/ghc/changeset/1815f26946d625606ea49f49c5300124f6d6fd70/ghc >--------------------------------------------------------------- commit 1815f26946d625606ea49f49c5300124f6d6fd70 Author: Iavor S. Diatchki Date: Sun May 4 19:54:52 2014 -0700 A comment describing a problem with the current approach. >--------------------------------------------------------------- 1815f26946d625606ea49f49c5300124f6d6fd70 compiler/typecheck/TcInteract.lhs | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/compiler/typecheck/TcInteract.lhs b/compiler/typecheck/TcInteract.lhs index 9575038..6740d47 100644 --- a/compiler/typecheck/TcInteract.lhs +++ b/compiler/typecheck/TcInteract.lhs @@ -723,7 +723,40 @@ interactTyVarEq inerts workItem@(CTyEqCan { cc_tyvar = tv, cc_rhs = rhs , cc_ev ; return (Nothing, True) } | otherwise - = do { _ <- extSolAssume workItem -- XXX: Check result? + = do { _ <- extSolAssume workItem + {- XXX: This is not correct in two ways: + 1. The kicked-out constraints are not purged from the external + solver! Thus, when they go around the solver loop, they will + be "solved" in terms of themselves. Clearly wrong. + + 2. Even if we could remove them from the external solver, + we are not "kicking-out" enough constraints. Consider, + the following example: + + A: [W] 1 <=? x ~ True + B: [W] 1 + n ~ x + + If we process them in this order (A first, then B), then we + can't solve either constraint. + If we reverse their order (i.e., B first, then A), then + we can solve `A` because we have more information about `x`. + + In other words, in this case `B` should have kicked-out `A`. + + I think that both of these problems will be avoided, if + we moved the external solver outside of the pipeline, like this: + - Let GHC process constraints until they are "inert". + - Extract inert constraints relevant to the external solver, + and compute "improvements" (i.e., extra equalities). + - If there were additional equalities, add them to the work + queue and let GHC process things again until they are inert. + - This can be repeated a few times, but it will eventually + stop, as the external solver will run out of equalities to + find (this is bound by the number of variables in scope) + - Finally, the external solver can be run to solve + any inert wanted constraintsthat it knows about. + -} + ; mb_solved <- trySpontaneousSolve ev tv rhs ; case mb_solved of SPCantSolve -- Includes givens From git at git.haskell.org Mon May 5 05:35:59 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 5 May 2014 05:35:59 +0000 (UTC) Subject: [commit: ghc] wip/ext-solver: Factor out computing new work (in prep for new approach). (a1a93e5) Message-ID: <20140505053559.A33452406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ext-solver Link : http://ghc.haskell.org/trac/ghc/changeset/a1a93e59a1b7a82ecf3a7fedc4a505c4177871ae/ghc >--------------------------------------------------------------- commit a1a93e59a1b7a82ecf3a7fedc4a505c4177871ae Author: Iavor S. Diatchki Date: Sun May 4 19:55:17 2014 -0700 Factor out computing new work (in prep for new approach). >--------------------------------------------------------------- a1a93e59a1b7a82ecf3a7fedc4a505c4177871ae compiler/typecheck/TcTypeNats.hs | 53 +++++++++++++++++++++------------------- 1 file changed, 28 insertions(+), 25 deletions(-) diff --git a/compiler/typecheck/TcTypeNats.hs b/compiler/typecheck/TcTypeNats.hs index 0b50b7d..c7d2a25 100644 --- a/compiler/typecheck/TcTypeNats.hs +++ b/compiler/typecheck/TcTypeNats.hs @@ -11,8 +11,8 @@ import TcType ( TcType, tcEqType ) import TcEvidence ( mkTcAxiomRuleCo, EvTerm(..) ) import TyCon ( TyCon, SynTyConRhs(..), mkSynTyCon, TyConParent(..) ) import Coercion ( Role(..) ) -import TcRnTypes ( Xi, Ct(..), ctPred, CtEvidence(..), mkNonCanonical, - isGivenCt ) +import TcRnTypes ( Xi, Ct(..), ctPred, CtEvidence(..), mkNonCanonical + , isGivenCt, CtLoc, ctLoc ) import CoAxiom ( CoAxiomRule(..), BuiltInSynFamily(..) ) import Name ( Name, BuiltInSyntax(..), nameOccName, nameUnique ) import OccName ( occNameString ) @@ -767,20 +767,7 @@ newExternalSolver exe opts = debugStage proc ("assume: " ++ renderSExpr expr "") $ do mapM_ (solverDeclare proc viRef) (eltsUFM vars) solverAssume proc expr - status <- solverCheck proc - case status of - Unsat -> return ExtSolContradiction - Unknown -> return (ExtSolOk []) - Sat -> - do m <- solverGetModel proc =<< readIORef viRef - imps <- solverImproveModel proc viRef m - vi <- readIORef viRef - let toCt (x,e) = - do tv <- Map.lookup x (smtDeclaredVars vi) - ty <- sExprToType vi e - return $ mkNonCanonical - $ mkNewFact ct (mkTyVarTy tv, ty) - return $ ExtSolOk $ mapMaybe toCt imps + solverNewWork proc viRef (ctLoc ct) (isGivenCt ct) , extSolProve = \ct -> case knownCt ct of @@ -806,18 +793,18 @@ debugStage proc x m = solverDebugPrev proc return res -mkNewFact :: Ct -> (Type,Type) -> CtEvidence -mkNewFact ct (t1,t2) - | isGivenCt ct = CtGiven { ctev_pred = newPred - , ctev_evtm = evBySMT "SMT" (t1,t2) - , ctev_loc = newLoc - } + + +mkNewFact :: CtLoc -> Bool -> (Type,Type) -> CtEvidence +mkNewFact newLoc withEv (t1,t2) + | withEv = CtGiven { ctev_pred = newPred + , ctev_evtm = evBySMT "SMT" (t1,t2) + , ctev_loc = newLoc + } | otherwise = CtDerived { ctev_pred = newPred - , ctev_loc = ctev_loc origEv + , ctev_loc = newLoc } where - origEv = cc_ev ct - newLoc = ctev_loc origEv newPred = mkEqPred t1 t2 -- A command with no interesting result. @@ -946,6 +933,22 @@ solverImproveModel proc viRef imps = else varEq x imps (def : more) ys +solverNewWork :: SolverProcess -> IORef VarInfo -> CtLoc -> Bool -> IO ExtSolRes +solverNewWork proc viRef loc withEv = + do status <- solverCheck proc + case status of + Unsat -> return ExtSolContradiction + Unknown -> return (ExtSolOk []) + Sat -> + do m <- solverGetModel proc =<< readIORef viRef + imps <- solverImproveModel proc viRef m + vi <- readIORef viRef + let toCt (x,e) = do tv <- Map.lookup x (smtDeclaredVars vi) + ty <- sExprToType vi e + return $ mkNonCanonical + $ mkNewFact loc withEv (mkTyVarTy tv, ty) + return $ ExtSolOk $ mapMaybe toCt imps + smtTy :: Ty -> SExpr smtTy ty = From git at git.haskell.org Tue May 6 08:43:26 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 6 May 2014 08:43:26 +0000 (UTC) Subject: [commit: ghc] master: Changed profiling output is fine (according to Simon Marlow) (cdca791) Message-ID: <20140506084326.8C1082406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/cdca7915edd9aecf0b6ee30c3b349de77575dc2b/ghc >--------------------------------------------------------------- commit cdca7915edd9aecf0b6ee30c3b349de77575dc2b Author: Simon Peyton Jones Date: Fri May 2 12:10:42 2014 +0100 Changed profiling output is fine (according to Simon Marlow) >--------------------------------------------------------------- cdca7915edd9aecf0b6ee30c3b349de77575dc2b .../tests/profiling/should_run/ioprof.prof.sample | 56 +++++++++++----------- 1 file changed, 27 insertions(+), 29 deletions(-) diff --git a/testsuite/tests/profiling/should_run/ioprof.prof.sample b/testsuite/tests/profiling/should_run/ioprof.prof.sample index 0cdfa82..07257e2 100644 --- a/testsuite/tests/profiling/should_run/ioprof.prof.sample +++ b/testsuite/tests/profiling/should_run/ioprof.prof.sample @@ -1,39 +1,37 @@ - Mon Nov 14 13:28 2011 Time and Allocation Profiling Report (Final) + Mon Apr 28 15:29 2014 Time and Allocation Profiling Report (Final) ioprof +RTS -hc -p -RTS - total time = 0.00 secs (0 ticks @ 20 ms) - total alloc = 53,288 bytes (excludes profiling overheads) + total time = 0.00 secs (0 ticks @ 1000 us, 1 processor) + total alloc = 52,208 bytes (excludes profiling overheads) COST CENTRE MODULE %time %alloc -main Main 0.0 16.4 -errorM.\ Main 0.0 8.3 -CAF GHC.IO.Handle.FD 0.0 65.5 +MAIN MAIN 0.0 1.4 +CAF GHC.IO.Encoding 0.0 6.3 CAF GHC.Conc.Signal 0.0 1.3 -CAF GHC.IO.Encoding 0.0 5.9 +CAF GHC.IO.Handle.FD 0.0 66.2 +main Main 0.0 16.7 +errorM.\ Main 0.0 7.0 - individual inherited -COST CENTRE MODULE no. entries %time %alloc %time %alloc + individual inherited +COST CENTRE MODULE no. entries %time %alloc %time %alloc -MAIN MAIN 45 0 0.0 0.7 0.0 100.0 - CAF GHC.IO.Encoding.Iconv 76 0 0.0 0.5 0.0 0.5 - CAF GHC.Conc.Sync 74 0 0.0 0.5 0.0 0.5 - CAF GHC.IO.Encoding 65 0 0.0 5.9 0.0 5.9 - CAF GHC.Conc.Signal 62 0 0.0 1.3 0.0 1.3 - CAF GHC.IO.Handle.FD 56 0 0.0 65.5 0.0 65.5 - CAF GHC.Exception 55 0 0.0 0.2 0.0 0.2 - CAF Main 51 0 0.0 0.6 0.0 25.6 - main Main 90 1 0.0 16.4 0.0 24.9 - runM Main 93 1 0.0 0.0 0.0 8.3 - bar Main 94 0 0.0 0.0 0.0 8.3 - foo Main 99 0 0.0 0.0 0.0 8.3 - errorM Main 100 0 0.0 0.0 0.0 8.3 - errorM.\ Main 101 1 0.0 8.3 0.0 8.3 - >>= Main 95 0 0.0 0.0 0.0 0.0 - >>=.\ Main 96 1 0.0 0.0 0.0 0.0 - bar Main 91 1 0.0 0.2 0.0 0.2 - foo Main 97 1 0.0 0.0 0.0 0.0 - errorM Main 98 1 0.0 0.0 0.0 0.0 - >>= Main 92 1 0.0 0.0 0.0 0.0 +MAIN MAIN 44 0 0.0 1.4 0.0 100.0 + main Main 89 0 0.0 16.5 0.0 16.5 + CAF Main 87 0 0.0 0.0 0.0 7.4 + main Main 88 1 0.0 0.2 0.0 7.4 + runM Main 90 1 0.0 0.2 0.0 7.2 + bar Main 91 1 0.0 0.0 0.0 7.1 + errorM Main 93 1 0.0 0.0 0.0 0.0 + >>= Main 92 1 0.0 0.0 0.0 7.0 + >>=.\ Main 94 1 0.0 0.0 0.0 7.0 + foo Main 95 1 0.0 0.0 0.0 7.0 + errorM Main 96 0 0.0 0.0 0.0 7.0 + errorM.\ Main 97 1 0.0 7.0 0.0 7.0 + CAF GHC.IO.Handle.FD 84 0 0.0 66.2 0.0 66.2 + CAF GHC.Conc.Signal 82 0 0.0 1.3 0.0 1.3 + CAF GHC.Conc.Sync 81 0 0.0 0.4 0.0 0.4 + CAF GHC.IO.Encoding 74 0 0.0 6.3 0.0 6.3 + CAF GHC.IO.Encoding.Iconv 56 0 0.0 0.4 0.0 0.4 From git at git.haskell.org Tue May 6 08:43:28 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 6 May 2014 08:43:28 +0000 (UTC) Subject: [commit: ghc] master: Add -fno-full-laziness to get consistent profiling output (1302d50) Message-ID: <20140506084329.5930D2406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/1302d50587e012d792f4d3e16bd511258984f4b8/ghc >--------------------------------------------------------------- commit 1302d50587e012d792f4d3e16bd511258984f4b8 Author: Simon Peyton Jones Date: Fri May 2 12:10:26 2014 +0100 Add -fno-full-laziness to get consistent profiling output >--------------------------------------------------------------- 1302d50587e012d792f4d3e16bd511258984f4b8 testsuite/tests/profiling/should_run/all.T | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testsuite/tests/profiling/should_run/all.T b/testsuite/tests/profiling/should_run/all.T index 493c846..ac70b9f 100644 --- a/testsuite/tests/profiling/should_run/all.T +++ b/testsuite/tests/profiling/should_run/all.T @@ -25,7 +25,7 @@ test('T3001-2', test('scc001', [req_profiling, extra_ways(['prof']), only_ways(prof_ways)], compile_and_run, - ['-fno-state-hack']) # Note [consistent stacks] + ['-fno-state-hack -fno-full-laziness']) # Note [consistent stacks] test('scc002', [req_profiling, extra_ways(['prof']), only_ways(prof_ways)], From git at git.haskell.org Tue May 6 08:43:31 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 6 May 2014 08:43:31 +0000 (UTC) Subject: [commit: ghc] master: Fix over-zealous unused-import warning (9f3e39d) Message-ID: <20140506084331.AE90D2406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/9f3e39d5f8686e511ffca406a6e056dec4095e53/ghc >--------------------------------------------------------------- commit 9f3e39d5f8686e511ffca406a6e056dec4095e53 Author: Simon Peyton Jones Date: Fri May 2 12:09:52 2014 +0100 Fix over-zealous unused-import warning See Note [Un-warnable import decls] in RnNames. Fixes Trac #9061. >--------------------------------------------------------------- 9f3e39d5f8686e511ffca406a6e056dec4095e53 compiler/rename/RnNames.lhs | 24 ++++++++++++++++++++---- testsuite/tests/module/T9061.hs | 6 ++++++ testsuite/tests/module/all.T | 1 + 3 files changed, 27 insertions(+), 4 deletions(-) diff --git a/compiler/rename/RnNames.lhs b/compiler/rename/RnNames.lhs index 7f6a840..678eb73 100644 --- a/compiler/rename/RnNames.lhs +++ b/compiler/rename/RnNames.lhs @@ -1301,7 +1301,7 @@ type ImportDeclUsage warnUnusedImportDecls :: TcGblEnv -> RnM () warnUnusedImportDecls gbl_env = do { uses <- readMutVar (tcg_used_rdrnames gbl_env) - ; let imports = filter explicit_import (tcg_rn_imports gbl_env) + ; let imports = filterOut un_warnable_import (tcg_rn_imports gbl_env) rdr_env = tcg_rdr_env gbl_env ; let usage :: [ImportDeclUsage] @@ -1315,11 +1315,27 @@ warnUnusedImportDecls gbl_env ; whenGOptM Opt_D_dump_minimal_imports $ printMinimalImports usage } where - explicit_import (L _ decl) = not (ideclImplicit decl) - -- Filter out the implicit Prelude import - -- which we do not want to bleat about + un_warnable_import (L _ decl) -- See Note [Un-warnable import decls] + | ideclImplicit decl + = True + | Just (True, hides) <- ideclHiding decl + , not (null hides) + , pRELUDE_NAME == unLoc (ideclName decl) + = True + | otherwise + = False \end{code} +Note [Un-warnable import decls] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +We do not warn about the implicit import of Prelude, since the user can't remove it + +We do not warn about + import Prelude hiding( x, y ) +because even if nothing else from Prelude is used, it may be essential to hide +x,y to avoid name-shadowing warnings. Example (Trac #9061) + import Prelude hiding( log ) + f x = log where log = () Note [The ImportMap] ~~~~~~~~~~~~~~~~~~~~ diff --git a/testsuite/tests/module/T9061.hs b/testsuite/tests/module/T9061.hs new file mode 100644 index 0000000..1417dca --- /dev/null +++ b/testsuite/tests/module/T9061.hs @@ -0,0 +1,6 @@ +{-# OPTIONS_GHC -fwarn-unused-imports #-} +module T9061 where + +import Prelude hiding (log) + +f = log where log = () diff --git a/testsuite/tests/module/all.T b/testsuite/tests/module/all.T index 8eaa1d5..926cbb5 100644 --- a/testsuite/tests/module/all.T +++ b/testsuite/tests/module/all.T @@ -334,3 +334,4 @@ test('T414', normal, compile_fail, ['']) test('T414a', normal, compile, ['']) test('T414b', normal, compile, ['']) test('T3776', normal, compile, ['']) +test('T9061', normal, compile, ['']) From git at git.haskell.org Tue May 6 08:43:34 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 6 May 2014 08:43:34 +0000 (UTC) Subject: [commit: ghc] master: Improve comments and tracing in SpecConstr (675c547) Message-ID: <20140506084334.0DDDD2406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/675c5478793ac8cede5daca4f70cd09846879837/ghc >--------------------------------------------------------------- commit 675c5478793ac8cede5daca4f70cd09846879837 Author: Simon Peyton Jones Date: Mon May 5 08:50:51 2014 +0100 Improve comments and tracing in SpecConstr >--------------------------------------------------------------- 675c5478793ac8cede5daca4f70cd09846879837 compiler/specialise/SpecConstr.lhs | 53 ++++++++++++++++++++++---------------- 1 file changed, 31 insertions(+), 22 deletions(-) diff --git a/compiler/specialise/SpecConstr.lhs b/compiler/specialise/SpecConstr.lhs index 86a56f4..9df460e 100644 --- a/compiler/specialise/SpecConstr.lhs +++ b/compiler/specialise/SpecConstr.lhs @@ -396,16 +396,19 @@ use the calls in the un-specialised RHS as seeds. We call these Note [Top-level recursive groups] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -If all the bindings in a top-level recursive group are not exported, -all the calls are in the rest of the top-level bindings. -This means we can specialise with those call patterns instead of with the RHSs -of the recursive group. +If all the bindings in a top-level recursive group are local (not +exported), then all the calls are in the rest of the top-level +bindings. This means we can specialise with those call patterns +instead of with the RHSs of the recursive group. -To get the call usage information, we work backwards through the top-level bindings -so we see the usage before we get to the binding of the function. -Before we can collect the usage though, we go through all the bindings and add them -to the environment. This is necessary because usage is only tracked for functions -in the environment. +(Question: maybe we should *also* use calls in the rest of the +top-level bindings as seeds? + +To get the call usage information, we work backwards through the +top-level bindings so we see the usage before we get to the binding of +the function. Before we can collect the usage though, we go through +all the bindings and add them to the environment. This is necessary +because usage is only tracked for functions in the environment. The actual seeding of the specialisation is very similar to Note [Local recursive group]. @@ -1323,16 +1326,14 @@ scTopBind env usage (Rec prs) = do { (rhs_usgs, rhss') <- mapAndUnzipM (scExpr env) rhss ; return (usage `combineUsage` (combineUsages rhs_usgs), Rec (bndrs `zip` rhss')) } | otherwise -- Do specialisation - = do { (rhs_usgs, rhs_infos) <- mapAndUnzipM (scRecRhs env) (bndrs `zip` rhss) + = do { (rhs_usgs, rhs_infos) <- mapAndUnzipM (scRecRhs env) prs -- ; pprTrace "scTopBind" (ppr bndrs $$ ppr (map (lookupVarEnv (scu_calls usage)) bndrs)) (return ()) -- Note [Top-level recursive groups] - ; let (usg,rest) = if all (not . isExportedId) bndrs - then -- pprTrace "scTopBind-T" (ppr bndrs $$ ppr (map (fmap (map snd) . lookupVarEnv (scu_calls usage)) bndrs)) - ( usage - , [SI [] 0 (Just us) | us <- rhs_usgs] ) - else ( combineUsages rhs_usgs - , [SI [] 0 Nothing | _ <- rhs_usgs] ) + ; let (usg,rest) | any isExportedId bndrs -- Seed from RHSs + = ( combineUsages rhs_usgs, [SI [] 0 Nothing | _ <- rhs_usgs] ) + | otherwise -- Seed from body only + = ( usage, [SI [] 0 (Just us) | us <- rhs_usgs] ) ; (usage', specs) <- specLoop (scForce env force_spec) (scu_calls usg) rhs_infos nullUsage rest @@ -1446,11 +1447,6 @@ specialise env bind_calls (RI fn _ arg_bndrs body arg_occs) , notNull arg_bndrs -- Only specialise functions , Just all_calls <- lookupVarEnv bind_calls fn = do { (boring_call, pats) <- callsToPats env specs arg_occs all_calls --- ; pprTrace "specialise" (vcat [ ppr fn <+> text "with" <+> int (length pats) <+> text "good patterns" --- , text "arg_occs" <+> ppr arg_occs --- , text "calls" <+> ppr all_calls --- , text "good pats" <+> ppr pats]) $ --- return () -- Bale out if too many specialisations ; let n_pats = length pats @@ -1473,12 +1469,25 @@ specialise env bind_calls (RI fn _ arg_bndrs body arg_occs) _normal_case -> do { - let spec_env = decreaseSpecCount env n_pats +-- ; if (not (null pats) || isJust mb_unspec) then +-- pprTrace "specialise" (vcat [ ppr fn <+> text "with" <+> int (length pats) <+> text "good patterns" +-- , text "mb_unspec" <+> ppr (isJust mb_unspec) +-- , text "arg_occs" <+> ppr arg_occs +-- , text "good pats" <+> ppr pats]) $ +-- return () +-- else return () + + ; let spec_env = decreaseSpecCount env n_pats ; (spec_usgs, new_specs) <- mapAndUnzipM (spec_one spec_env fn arg_bndrs body) (pats `zip` [spec_count..]) -- See Note [Specialise original body] ; let spec_usg = combineUsages spec_usgs + + -- If there were any boring calls among the seeds (= all_calls), then those + -- calls will call the un-specialised function. So we should use the seeds + -- from the _unspecialised_ function's RHS, which are in mb_unspec, by returning + -- then in new_usg. (new_usg, mb_unspec') = case mb_unspec of Just rhs_usg | boring_call -> (spec_usg `combineUsage` rhs_usg, Nothing) From git at git.haskell.org Tue May 6 08:43:36 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 6 May 2014 08:43:36 +0000 (UTC) Subject: [commit: ghc] master: Modularise pretty-printing for foralls (3c3ce82) Message-ID: <20140506084336.7DA922406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/3c3ce829b64a9b5cc509db19d5d1acf44a565053/ghc >--------------------------------------------------------------- commit 3c3ce829b64a9b5cc509db19d5d1acf44a565053 Author: Simon Peyton Jones Date: Tue May 6 08:19:01 2014 +0100 Modularise pretty-printing for foralls See TypeRep.pprUserForAll. This just makes forall-printing a bit more consistent. In particular, I wasn't seeing the kind foralls when displaying a CoAxiom or CoAxBranch The output on T7939 is just possible a bit too verbose now, but even if so that's an error in the right direction. >--------------------------------------------------------------- 3c3ce829b64a9b5cc509db19d5d1acf44a565053 compiler/main/PprTyThing.hs | 8 ++------ compiler/types/Coercion.lhs | 2 +- compiler/types/Type.lhs | 2 +- compiler/types/TypeRep.lhs | 27 +++++++++++++++++---------- testsuite/tests/ghci/scripts/T7939.stdout | 4 ++-- 5 files changed, 23 insertions(+), 20 deletions(-) diff --git a/compiler/main/PprTyThing.hs b/compiler/main/PprTyThing.hs index 01932f6..4934024 100644 --- a/compiler/main/PprTyThing.hs +++ b/compiler/main/PprTyThing.hs @@ -32,14 +32,13 @@ import CoAxiom( CoAxiom(..), brListMap ) import HscTypes( tyThingParent_maybe ) import Type( tidyTopType, tidyOpenType, splitForAllTys, funResultTy ) import Kind( synTyConResKind ) -import TypeRep( pprTvBndrs, pprForAll, suppressKinds ) +import TypeRep( pprTvBndrs, pprUserForAll, suppressKinds ) import TysPrim( alphaTyVars ) import MkIface ( tyThingToIfaceDecl ) import TcType import Name import VarEnv( emptyTidyEnv ) import StaticFlags( opt_PprStyle_Debug ) -import DynFlags import Outputable import FastString @@ -234,7 +233,7 @@ pprDataConDecl :: ShowSub -> Bool -> DataCon -> SDoc pprDataConDecl ss gadt_style dataCon | not gadt_style = ppr_fields tys_w_strs | otherwise = ppr_bndr dataCon <+> dcolon <+> - sep [ pp_foralls, pprThetaArrowTy theta, pp_tau ] + sep [ pprUserForAll forall_tvs, pprThetaArrowTy theta, pp_tau ] -- Printing out the dataCon as a type signature, in GADT style where (forall_tvs, theta, tau) = tcSplitSigmaTy (dataConUserType dataCon) @@ -242,9 +241,6 @@ pprDataConDecl ss gadt_style dataCon labels = dataConFieldLabels dataCon stricts = dataConStrictMarks dataCon tys_w_strs = zip (map user_ify stricts) arg_tys - pp_foralls = sdocWithDynFlags $ \dflags -> - ppWhen (gopt Opt_PrintExplicitForalls dflags) - (pprForAll forall_tvs) pp_tau = foldr add (ppr res_ty) tys_w_strs add str_ty pp_ty = pprParendBangTy str_ty <+> arrow <+> pp_ty diff --git a/compiler/types/Coercion.lhs b/compiler/types/Coercion.lhs index a436bcf..53326e6 100644 --- a/compiler/types/Coercion.lhs +++ b/compiler/types/Coercion.lhs @@ -724,7 +724,7 @@ pprCoAxBranch :: TyCon -> CoAxBranch -> SDoc pprCoAxBranch fam_tc (CoAxBranch { cab_tvs = tvs , cab_lhs = lhs , cab_rhs = rhs }) - = hang (ifPprDebug (pprForAll tvs)) + = hang (pprUserForAll tvs) 2 (hang (pprTypeApp fam_tc lhs) 2 (equals <+> (ppr rhs))) pprCoAxBranchHdr :: CoAxiom br -> BranchIndex -> SDoc diff --git a/compiler/types/Type.lhs b/compiler/types/Type.lhs index 88054ce..7395329 100644 --- a/compiler/types/Type.lhs +++ b/compiler/types/Type.lhs @@ -128,7 +128,7 @@ module Type ( -- * Pretty-printing pprType, pprParendType, pprTypeApp, pprTyThingCategory, pprTyThing, - pprTvBndr, pprTvBndrs, pprForAll, pprSigmaType, + pprTvBndr, pprTvBndrs, pprForAll, pprUserForAll, pprSigmaType, pprEqPred, pprTheta, pprThetaArrowTy, pprClassPred, pprKind, pprParendKind, pprSourceTyCon, diff --git a/compiler/types/TypeRep.lhs b/compiler/types/TypeRep.lhs index 5787d87..866fc77 100644 --- a/compiler/types/TypeRep.lhs +++ b/compiler/types/TypeRep.lhs @@ -39,7 +39,8 @@ module TypeRep ( -- Pretty-printing pprType, pprParendType, pprTypeApp, pprTvBndr, pprTvBndrs, pprTyThing, pprTyThingCategory, pprSigmaType, - pprEqPred, pprTheta, pprForAll, pprThetaArrowTy, pprClassPred, + pprEqPred, pprTheta, pprForAll, pprUserForAll, + pprThetaArrowTy, pprClassPred, pprKind, pprParendKind, pprTyLit, suppressKinds, Prec(..), maybeParen, pprTcApp, pprPrefixApp, pprArrowChain, ppr_type, @@ -618,11 +619,11 @@ ppr_tylit _ tl = ------------------- ppr_sigma_type :: Bool -> Type -> SDoc --- Bool <=> Show the foralls -ppr_sigma_type show_foralls ty - = sep [ ppWhen (show_foralls || any tv_has_kind_var tvs) - (pprForAll tvs) - -- See Note [When to print foralls] +-- Bool <=> Show the foralls unconditionally +ppr_sigma_type show_foralls_unconditionally ty + = sep [ if show_foralls_unconditionally + then pprForAll tvs + else pprUserForAll tvs , pprThetaArrowTy ctxt , pprType tau ] where @@ -635,11 +636,17 @@ ppr_sigma_type show_foralls ty split2 ps (ty1 `FunTy` ty2) | isPredTy ty1 = split2 (ty1:ps) ty2 split2 ps ty = (reverse ps, ty) - tv_has_kind_var tv = not (isEmptyVarSet (tyVarsOfType (tyVarKind tv))) - pprSigmaType :: Type -> SDoc -pprSigmaType ty = sdocWithDynFlags $ \dflags -> - ppr_sigma_type (gopt Opt_PrintExplicitForalls dflags) ty +pprSigmaType ty = ppr_sigma_type False ty + +pprUserForAll :: [TyVar] -> SDoc +-- Print a user-level forall; see Note [WHen to print foralls] +pprUserForAll tvs + = sdocWithDynFlags $ \dflags -> + ppWhen (any tv_has_kind_var tvs || gopt Opt_PrintExplicitForalls dflags) $ + pprForAll tvs + where + tv_has_kind_var tv = not (isEmptyVarSet (tyVarsOfType (tyVarKind tv))) pprForAll :: [TyVar] -> SDoc pprForAll [] = empty diff --git a/testsuite/tests/ghci/scripts/T7939.stdout b/testsuite/tests/ghci/scripts/T7939.stdout index 9a88b5c..a479376 100644 --- a/testsuite/tests/ghci/scripts/T7939.stdout +++ b/testsuite/tests/ghci/scripts/T7939.stdout @@ -13,11 +13,11 @@ type family H (a :: Bool) :: Bool where H 'False = 'True H :: Bool -> Bool type family J (a :: [k]) :: Bool where J '[] = 'False - J (h : t) = 'True + forall (k :: BOX) (h :: k) (t :: [k]). J (h : t) = 'True -- Defined at T7939.hs:17:1 J :: [k] -> Bool type family K (a :: [k]) :: Maybe k where K '[] = 'Nothing - K (h : t) = 'Just h + forall (k :: BOX) (h :: k) (t :: [k]). K (h : t) = 'Just h -- Defined at T7939.hs:21:1 K :: [k] -> Maybe k From git at git.haskell.org Tue May 6 08:43:39 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 6 May 2014 08:43:39 +0000 (UTC) Subject: [commit: ghc] master: Second go at fixing #9061 (5b73dc5) Message-ID: <20140506084339.0DC172406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/5b73dc5fda1941d51827ea72614782c10a355a3d/ghc >--------------------------------------------------------------- commit 5b73dc5fda1941d51827ea72614782c10a355a3d Author: Simon Peyton Jones Date: Tue May 6 08:20:28 2014 +0100 Second go at fixing #9061 My first attempt introduce a bug in -fprint-minimal-imports, but fortunately a regression test caught it. >--------------------------------------------------------------- 5b73dc5fda1941d51827ea72614782c10a355a3d compiler/rename/RnNames.lhs | 46 +++++++++++++++++++++++---------------------- 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/compiler/rename/RnNames.lhs b/compiler/rename/RnNames.lhs index 678eb73..5599764 100644 --- a/compiler/rename/RnNames.lhs +++ b/compiler/rename/RnNames.lhs @@ -1301,11 +1301,14 @@ type ImportDeclUsage warnUnusedImportDecls :: TcGblEnv -> RnM () warnUnusedImportDecls gbl_env = do { uses <- readMutVar (tcg_used_rdrnames gbl_env) - ; let imports = filterOut un_warnable_import (tcg_rn_imports gbl_env) + ; let user_imports = filterOut (ideclImplicit . unLoc) (tcg_rn_imports gbl_env) + -- This whole function deals only with *user* imports + -- both for warning about unnecessary ones, and for + -- deciding the minimal ones rdr_env = tcg_rdr_env gbl_env ; let usage :: [ImportDeclUsage] - usage = findImportUsage imports rdr_env (Set.elems uses) + usage = findImportUsage user_imports rdr_env (Set.elems uses) ; traceRn (vcat [ ptext (sLit "Uses:") <+> ppr (Set.elems uses) , ptext (sLit "Import usage") <+> ppr usage]) @@ -1314,28 +1317,8 @@ warnUnusedImportDecls gbl_env ; whenGOptM Opt_D_dump_minimal_imports $ printMinimalImports usage } - where - un_warnable_import (L _ decl) -- See Note [Un-warnable import decls] - | ideclImplicit decl - = True - | Just (True, hides) <- ideclHiding decl - , not (null hides) - , pRELUDE_NAME == unLoc (ideclName decl) - = True - | otherwise - = False \end{code} -Note [Un-warnable import decls] -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -We do not warn about the implicit import of Prelude, since the user can't remove it - -We do not warn about - import Prelude hiding( x, y ) -because even if nothing else from Prelude is used, it may be essential to hide -x,y to avoid name-shadowing warnings. Example (Trac #9061) - import Prelude hiding( log ) - f x = log where log = () Note [The ImportMap] ~~~~~~~~~~~~~~~~~~~~ @@ -1449,6 +1432,11 @@ warnUnusedImport :: ImportDeclUsage -> RnM () warnUnusedImport (L loc decl, used, unused) | Just (False,[]) <- ideclHiding decl = return () -- Do not warn for 'import M()' + + | Just (True, hides) <- ideclHiding decl + , not (null hides) + , pRELUDE_NAME == unLoc (ideclName decl) + = return () -- Note [Do not warn about Prelude hiding] | null used = addWarnAt loc msg1 -- Nothing used; drop entire decl | null unused = return () -- Everything imported is used; nop | otherwise = addWarnAt loc msg2 -- Some imports are unused @@ -1468,6 +1456,19 @@ warnUnusedImport (L loc decl, used, unused) pp_not_used = text "is redundant" \end{code} +Note [Do not warn about Prelude hiding] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +We do not warn about + import Prelude hiding( x, y ) +because even if nothing else from Prelude is used, it may be essential to hide +x,y to avoid name-shadowing warnings. Example (Trac #9061) + import Prelude hiding( log ) + f x = log where log = () + + + +Note [Printing minimal imports] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ To print the minimal imports we walk over the user-supplied import decls, and simply trim their import lists. NB that @@ -1478,6 +1479,7 @@ decls, and simply trim their import lists. NB that \begin{code} printMinimalImports :: [ImportDeclUsage] -> RnM () +-- See Note [Printing minimal imports] printMinimalImports imports_w_usage = do { imports' <- mapM mk_minimal imports_w_usage ; this_mod <- getModule From git at git.haskell.org Tue May 6 08:43:41 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 6 May 2014 08:43:41 +0000 (UTC) Subject: [commit: ghc] master: Fix Trac #9071, an egregious bug in TcDeriv.inferConstraints (13a330e) Message-ID: <20140506084341.8DDE92406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/13a330e87cf459311a7f164e1e57baf877741da6/ghc >--------------------------------------------------------------- commit 13a330e87cf459311a7f164e1e57baf877741da6 Author: Simon Peyton Jones Date: Tue May 6 08:22:37 2014 +0100 Fix Trac #9071, an egregious bug in TcDeriv.inferConstraints The constraints for Functor don't line up 1-1 with the arguments (they are fetched out from sub-terms of the type), but the surrounding code was mistakenly assuming they were in 1-1 association. >--------------------------------------------------------------- 13a330e87cf459311a7f164e1e57baf877741da6 compiler/typecheck/TcDeriv.lhs | 34 ++++++++++++++++-------------- compiler/typecheck/TcGenGenerics.lhs | 11 +++++----- compiler/typecheck/TcRnTypes.lhs | 3 ++- testsuite/tests/deriving/should_fail/all.T | 3 +++ 4 files changed, 28 insertions(+), 23 deletions(-) diff --git a/compiler/typecheck/TcDeriv.lhs b/compiler/typecheck/TcDeriv.lhs index 71fd25c..23975b9 100644 --- a/compiler/typecheck/TcDeriv.lhs +++ b/compiler/typecheck/TcDeriv.lhs @@ -1121,21 +1121,23 @@ inferConstraints cls inst_tys rep_tc rep_tc_args | otherwise -- The others are a bit more complicated = ASSERT2( equalLength rep_tc_tvs all_rep_tc_args, ppr cls <+> ppr rep_tc ) - return (stupid_constraints ++ extra_constraints - ++ sc_constraints - ++ con_arg_constraints cls get_std_constrained_tys) - + do { traceTc "inferConstraints" (vcat [ppr cls <+> ppr inst_tys, ppr arg_constraints]) + ; return (stupid_constraints ++ extra_constraints + ++ sc_constraints + ++ arg_constraints) } where + arg_constraints = con_arg_constraints cls get_std_constrained_tys + -- Constraints arising from the arguments of each constructor con_arg_constraints cls' get_constrained_tys - = [ mkPredOrigin (DerivOriginDC data_con arg_n) (mkClassPred cls' [arg_ty]) - | data_con <- tyConDataCons rep_tc, - (arg_n, arg_ty) <- - ASSERT( isVanillaDataCon data_con ) - zip [1..] $ -- ASSERT is precondition of dataConInstOrigArgTys - get_constrained_tys $ - dataConInstOrigArgTys data_con all_rep_tc_args, - not (isUnLiftedType arg_ty) ] + = [ mkPredOrigin (DerivOriginDC data_con arg_n) (mkClassPred cls' [inner_ty]) + | data_con <- tyConDataCons rep_tc + , (arg_n, arg_ty) <- ASSERT( isVanillaDataCon data_con ) + zip [1..] $ -- ASSERT is precondition of dataConInstOrigArgTys + dataConInstOrigArgTys data_con all_rep_tc_args + , not (isUnLiftedType arg_ty) + , inner_ty <- get_constrained_tys arg_ty ] + -- No constraints for unlifted types -- See Note [Deriving and unboxed types] @@ -1145,10 +1147,10 @@ inferConstraints cls inst_tys rep_tc rep_tc_args -- (b) The rep_tc_args will be one short is_functor_like = getUnique cls `elem` functorLikeClassKeys - get_std_constrained_tys :: [Type] -> [Type] - get_std_constrained_tys tys - | is_functor_like = concatMap (deepSubtypesContaining last_tv) tys - | otherwise = tys + get_std_constrained_tys :: Type -> [Type] + get_std_constrained_tys ty + | is_functor_like = deepSubtypesContaining last_tv ty + | otherwise = [ty] rep_tc_tvs = tyConTyVars rep_tc last_tv = last rep_tc_tvs diff --git a/compiler/typecheck/TcGenGenerics.lhs b/compiler/typecheck/TcGenGenerics.lhs index d9d92ba..35bf424 100644 --- a/compiler/typecheck/TcGenGenerics.lhs +++ b/compiler/typecheck/TcGenGenerics.lhs @@ -189,14 +189,13 @@ metaTyConsToDerivStuff tc metaDts = %************************************************************************ \begin{code} -get_gen1_constrained_tys :: TyVar -> [Type] -> [Type] +get_gen1_constrained_tys :: TyVar -> Type -> [Type] -- called by TcDeriv.inferConstraints; generates a list of types, each of which -- must be a Functor in order for the Generic1 instance to work. -get_gen1_constrained_tys argVar = - concatMap $ argTyFold argVar $ ArgTyAlg { - ata_rec0 = const [], - ata_par1 = [], ata_rec1 = const [], - ata_comp = (:)} +get_gen1_constrained_tys argVar + = argTyFold argVar $ ArgTyAlg { ata_rec0 = const [] + , ata_par1 = [], ata_rec1 = const [] + , ata_comp = (:) } {- diff --git a/compiler/typecheck/TcRnTypes.lhs b/compiler/typecheck/TcRnTypes.lhs index f3df0bf..d598764 100644 --- a/compiler/typecheck/TcRnTypes.lhs +++ b/compiler/typecheck/TcRnTypes.lhs @@ -1848,7 +1848,8 @@ pprO TupleOrigin = ptext (sLit "a tuple") pprO NegateOrigin = ptext (sLit "a use of syntactic negation") pprO ScOrigin = ptext (sLit "the superclasses of an instance declaration") pprO DerivOrigin = ptext (sLit "the 'deriving' clause of a data type declaration") -pprO (DerivOriginDC dc n) = hsep [ ptext (sLit "the"), speakNth n, +pprO (DerivOriginDC dc n) = pprTrace "dco" (ppr dc <+> ppr n) $ + hsep [ ptext (sLit "the"), speakNth n, ptext (sLit "field of"), quotes (ppr dc), parens (ptext (sLit "type") <+> quotes (ppr ty)) ] where ty = dataConOrigArgTys dc !! (n-1) diff --git a/testsuite/tests/deriving/should_fail/all.T b/testsuite/tests/deriving/should_fail/all.T index d503b6e..99da88a 100644 --- a/testsuite/tests/deriving/should_fail/all.T +++ b/testsuite/tests/deriving/should_fail/all.T @@ -50,3 +50,6 @@ test('T7800', normal, multimod_compile_fail, ['T7800','']) test('T5498', normal, compile_fail, ['']) test('T6147', normal, compile_fail, ['']) test('T8851', normal, compile_fail, ['']) +test('T9071', normal, multimod_compile_fail, ['T9071','']) +test('T9071_2', normal, compile_fail, ['']) + From git at git.haskell.org Tue May 6 08:43:43 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 6 May 2014 08:43:43 +0000 (UTC) Subject: [commit: ghc] master: Add a bit more typechecker tracing (02227dd) Message-ID: <20140506084343.F18672406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/02227ddddf56301a9c9bafac81742c0585e9a108/ghc >--------------------------------------------------------------- commit 02227ddddf56301a9c9bafac81742c0585e9a108 Author: Simon Peyton Jones Date: Tue May 6 08:23:26 2014 +0100 Add a bit more typechecker tracing This is in pursuit of Trac #9063 >--------------------------------------------------------------- 02227ddddf56301a9c9bafac81742c0585e9a108 compiler/typecheck/TcInstDcls.lhs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/compiler/typecheck/TcInstDcls.lhs b/compiler/typecheck/TcInstDcls.lhs index fc18429..51e1528 100644 --- a/compiler/typecheck/TcInstDcls.lhs +++ b/compiler/typecheck/TcInstDcls.lhs @@ -37,6 +37,7 @@ import TcDeriv import TcEnv import TcHsType import TcUnify +import Coercion ( pprCoAxiom, pprCoAxBranch ) import MkCore ( nO_METHOD_BINDING_ERROR_ID ) import Type import TcEvidence @@ -545,13 +546,16 @@ tcClsInstDecl (L loc (ClsInstDecl { cid_poly_ty = poly_ty, cid_binds = binds -- instance C [x] -- Then we want to generate the decl: type F [x] b = () | otherwise - = forM defs $ \(CoAxBranch { cab_lhs = pat_tys, cab_rhs = rhs }) -> + = forM defs $ \br@(CoAxBranch { cab_lhs = pat_tys, cab_rhs = rhs }) -> do { let pat_tys' = substTys mini_subst pat_tys rhs' = substTy mini_subst rhs tv_set' = tyVarsOfTypes pat_tys' - tvs' = varSetElems tv_set' + tvs' = varSetElemsKvsFirst tv_set' ; rep_tc_name <- newFamInstTyConName (noLoc (tyConName fam_tc)) pat_tys' ; let axiom = mkSingleCoAxiom rep_tc_name tvs' fam_tc pat_tys' rhs' + ; traceTc "mk_deflt_at_instance" (vcat [ ppr (tyvars, theta, clas, inst_tys) + , pprCoAxBranch fam_tc br + , pprCoAxiom axiom ]) ; ASSERT( tyVarsOfType rhs' `subVarSet` tv_set' ) newFamInst SynFamilyInst axiom } From git at git.haskell.org Tue May 6 08:46:27 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 6 May 2014 08:46:27 +0000 (UTC) Subject: [commit: ghc] master: Adding missing test files for #9071 (59b4e6d) Message-ID: <20140506084627.34E0B2406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/59b4e6d0ba504b33cc7064d489b8ec485a7703f4/ghc >--------------------------------------------------------------- commit 59b4e6d0ba504b33cc7064d489b8ec485a7703f4 Author: Simon Peyton Jones Date: Tue May 6 09:46:14 2014 +0100 Adding missing test files for #9071 >--------------------------------------------------------------- 59b4e6d0ba504b33cc7064d489b8ec485a7703f4 testsuite/tests/deriving/should_fail/T9071-2.hs | 7 +++++++ testsuite/tests/deriving/should_fail/T9071.hs | 8 ++++++++ testsuite/tests/deriving/should_fail/T9071.stderr | 10 ++++++++++ testsuite/tests/deriving/should_fail/T9071_2.hs | 7 +++++++ testsuite/tests/deriving/should_fail/T9071_2.stderr | 8 ++++++++ testsuite/tests/deriving/should_fail/T9071a.hs | 4 ++++ 6 files changed, 44 insertions(+) diff --git a/testsuite/tests/deriving/should_fail/T9071-2.hs b/testsuite/tests/deriving/should_fail/T9071-2.hs new file mode 100644 index 0000000..7a2f474 --- /dev/null +++ b/testsuite/tests/deriving/should_fail/T9071-2.hs @@ -0,0 +1,7 @@ +{-# LANGUAGE DeriveFunctor #-} +module T9071_2 where + +newtype Mu f = Mu (f (Mu f)) + +newtype K1 a b = K1 a +newtype F1 a = F1 (Mu (K1 a)) deriving Functor diff --git a/testsuite/tests/deriving/should_fail/T9071.hs b/testsuite/tests/deriving/should_fail/T9071.hs new file mode 100644 index 0000000..dc64f42 --- /dev/null +++ b/testsuite/tests/deriving/should_fail/T9071.hs @@ -0,0 +1,8 @@ +{-# LANGUAGE DeriveFunctor #-} +module T9071 where + +import T9071a + +newtype K a b = K a +newtype F a = F (Mu (K a)) deriving Functor + diff --git a/testsuite/tests/deriving/should_fail/T9071.stderr b/testsuite/tests/deriving/should_fail/T9071.stderr new file mode 100644 index 0000000..259adba --- /dev/null +++ b/testsuite/tests/deriving/should_fail/T9071.stderr @@ -0,0 +1,10 @@ +[1 of 2] Compiling T9071a ( T9071a.hs, T9071a.o ) +[2 of 2] Compiling T9071 ( T9071.hs, T9071.o ) + +T9071.hs:7:37: + No instance for (Functor K) + arising from the first field of ?F? (type ?Mu (K a)?) + Possible fix: + use a standalone 'deriving instance' declaration, + so you can specify the instance context yourself + When deriving the instance for (Functor F) diff --git a/testsuite/tests/deriving/should_fail/T9071_2.hs b/testsuite/tests/deriving/should_fail/T9071_2.hs new file mode 100644 index 0000000..7a2f474 --- /dev/null +++ b/testsuite/tests/deriving/should_fail/T9071_2.hs @@ -0,0 +1,7 @@ +{-# LANGUAGE DeriveFunctor #-} +module T9071_2 where + +newtype Mu f = Mu (f (Mu f)) + +newtype K1 a b = K1 a +newtype F1 a = F1 (Mu (K1 a)) deriving Functor diff --git a/testsuite/tests/deriving/should_fail/T9071_2.stderr b/testsuite/tests/deriving/should_fail/T9071_2.stderr new file mode 100644 index 0000000..ae0fcdb --- /dev/null +++ b/testsuite/tests/deriving/should_fail/T9071_2.stderr @@ -0,0 +1,8 @@ + +T9071_2.hs:7:40: + No instance for (Functor Mu) + arising from the first field of ?F1? (type ?Mu (K1 a)?) + Possible fix: + use a standalone 'deriving instance' declaration, + so you can specify the instance context yourself + When deriving the instance for (Functor F1) diff --git a/testsuite/tests/deriving/should_fail/T9071a.hs b/testsuite/tests/deriving/should_fail/T9071a.hs new file mode 100644 index 0000000..bf3a126 --- /dev/null +++ b/testsuite/tests/deriving/should_fail/T9071a.hs @@ -0,0 +1,4 @@ +module T9071a where + +newtype Mu f = Mu (f (Mu f)) + From git at git.haskell.org Wed May 7 17:19:40 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 7 May 2014 17:19:40 +0000 (UTC) Subject: [commit: packages/haskeline] branch 'ghc-head' deleted Message-ID: <20140507171940.93E4C2406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haskeline Deleted branch: ghc-head From git at git.haskell.org Wed May 7 17:19:42 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 7 May 2014 17:19:42 +0000 (UTC) Subject: [commit: packages/haskeline] master: Add support for transformers-0.4.0.0 (11c47ff) Message-ID: <20140507171942.CD6662406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haskeline On branch : master Link : http://git.haskell.org/packages/haskeline.git/commitdiff/11c47ff4306891b0b37e9c77bce9da9f617cb652 >--------------------------------------------------------------- commit 11c47ff4306891b0b37e9c77bce9da9f617cb652 Author: Herbert Valerio Riedel Date: Tue May 6 23:11:08 2014 +0200 Add support for transformers-0.4.0.0 >--------------------------------------------------------------- 11c47ff4306891b0b37e9c77bce9da9f617cb652 System/Console/Haskeline/Monads.hs | 8 +++++--- haskeline.cabal | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/System/Console/Haskeline/Monads.hs b/System/Console/Haskeline/Monads.hs index 0433971..6668e96 100644 --- a/System/Console/Haskeline/Monads.hs +++ b/System/Console/Haskeline/Monads.hs @@ -2,7 +2,8 @@ module System.Console.Haskeline.Monads( module System.Console.Haskeline.MonadException, MonadTrans(..), MonadIO(..), - ReaderT(..), + ReaderT, + runReaderT, runReaderT', mapReaderT, asks, @@ -15,7 +16,8 @@ module System.Console.Haskeline.Monads( update, MonadReader(..), MonadState(..), - MaybeT(..), + MaybeT(MaybeT), + runMaybeT, orElse ) where @@ -23,7 +25,7 @@ import Control.Applicative (Applicative(..)) import Control.Monad (ap, liftM) import Control.Monad.IO.Class (MonadIO(..)) import Control.Monad.Trans.Class (MonadTrans(..)) -import Control.Monad.Trans.Maybe (MaybeT(..)) +import Control.Monad.Trans.Maybe (MaybeT(MaybeT),runMaybeT) import Control.Monad.Trans.Reader hiding (ask,asks) import qualified Control.Monad.Trans.Reader as Reader import Data.IORef diff --git a/haskeline.cabal b/haskeline.cabal index 311979b..c26768f 100644 --- a/haskeline.cabal +++ b/haskeline.cabal @@ -52,7 +52,7 @@ flag legacy-encoding Library Build-depends: base >=4.3 && < 4.8, containers>=0.4 && < 0.6, directory>=1.1 && < 1.3, bytestring>=0.9 && < 0.11, - filepath >= 1.2 && < 1.4, transformers >= 0.2 && < 0.4 + filepath >= 1.2 && < 1.4, transformers >= 0.2 && < 0.5 Default-Language: Haskell98 Default-Extensions: ForeignFunctionInterface, Rank2Types, FlexibleInstances, From git at git.haskell.org Wed May 7 17:19:44 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 7 May 2014 17:19:44 +0000 (UTC) Subject: [commit: packages/haskeline] master: Merge pull request #8 from hvr/transformers-0.4 (5579fc2) Message-ID: <20140507171944.DC69C2406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haskeline On branch : master Link : http://git.haskell.org/packages/haskeline.git/commitdiff/5579fc2a2949a143ec8946b9bc9dd2ba957bf091 >--------------------------------------------------------------- commit 5579fc2a2949a143ec8946b9bc9dd2ba957bf091 Merge: 9a1d72a 11c47ff Author: Judah Jacobson Date: Wed May 7 09:04:10 2014 -0700 Merge pull request #8 from hvr/transformers-0.4 Add support for transformers-0.4.0.0 >--------------------------------------------------------------- 5579fc2a2949a143ec8946b9bc9dd2ba957bf091 System/Console/Haskeline/Monads.hs | 8 +++++--- haskeline.cabal | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) From git at git.haskell.org Wed May 7 17:19:46 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 7 May 2014 17:19:46 +0000 (UTC) Subject: [commit: packages/haskeline] master's head updated: Merge pull request #8 from hvr/transformers-0.4 (5579fc2) Message-ID: <20140507171946.F0BF52406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haskeline Branch 'master' now includes: 8252f06 Fix build on ghc-6.12.3. 5b600ef Include termios.h on Android because winsize is defined in it. 3a92ddd Follow unix's version bump 40bcd6a Fix build on Win64 eb0ff26 Add 'catches' to MonadException. Patch from H?kan Th?rngren. 8d36fd1 Merge http://code.haskell.org/haskeline into ghc-head 495b00b Avoid shadowing `handlers` variable in `catches` 708f0f6 Fix Windows build. 0ef9364 Fix build on Win64 Manual merge from git.haskell.org/packages/haskeline.git Original patch by Ian Lynagh 1fb6f88 Avoid shadowing `handlers` variable in `catches` Manual merge from git.haskell.org/packages/haskeline.git Original patch by Herbert Valerio Riedel 2cd0d3d Follow unix's version bump Manual merge from git.haskell.org/packages/haskeline.git Original patch by Ian Lynagh 775d0f4 Fix Windows Build. Manual merge from git.haskell.org/packages/haskeline.git Original patch by Edward Z. Yang 0f23cdd Merge http://code.haskell.org/haskeline into ghc-head 6d890a6 Fix #124: git import had the wrong encoding for test filenames. 3734dd1 Update unit test instructions to compile Unit.hs. 694af53 Add missing Functor/Applicative instances 78f7cea Merge pull request #2 from hvr/fix-amp-warnings 46528c1 Create README.md 817842d Add (old) release notes for 0.7.0.3. d1e509b Bump version to 0.7.1.0 and add up-to-date CHANGES. e72fde4 Merge branch 'release-0.7' 8431a74 Rename CHANGES to Changelog. 279c4de Point to the repo on github, and bump version to 0.7.1.1. 70677db Add Travis build file. cf74907 Fix the Travis CI build. dfdf5b4 Simplify version dependencies to require ghc>=7.0.1. 9463063 Allow building with terminfo-0.4. 94c2033 Bump version to 0.7.1.2. 9a1d72a Update Changelog for 0.7.1.2. 11c47ff Add support for transformers-0.4.0.0 5579fc2 Merge pull request #8 from hvr/transformers-0.4 From git at git.haskell.org Wed May 7 18:58:12 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 7 May 2014 18:58:12 +0000 (UTC) Subject: [commit: ghc] master: Update transformers submodule to new v0.4 rel (22ed9ef) Message-ID: <20140507185812.1D25E2406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/22ed9ef718c03eb928ba69c67b85eb7f4d3bef0b/ghc >--------------------------------------------------------------- commit 22ed9ef718c03eb928ba69c67b85eb7f4d3bef0b Author: Herbert Valerio Riedel Date: Tue May 6 22:46:27 2014 +0200 Update transformers submodule to new v0.4 rel This also updates the haskeline to upstream master to accomodate the new transformers version >--------------------------------------------------------------- 22ed9ef718c03eb928ba69c67b85eb7f4d3bef0b libraries/haskeline | 2 +- libraries/transformers | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/haskeline b/libraries/haskeline index 9a1d72a..5579fc2 160000 --- a/libraries/haskeline +++ b/libraries/haskeline @@ -1 +1 @@ -Subproject commit 9a1d72aa30b093e27abbeed8cd0c863f0f109fee +Subproject commit 5579fc2a2949a143ec8946b9bc9dd2ba957bf091 diff --git a/libraries/transformers b/libraries/transformers index a59fb93..5df683c 160000 --- a/libraries/transformers +++ b/libraries/transformers @@ -1 +1 @@ -Subproject commit a59fb93860f84ccd44178dcbbb82cfea7e02cd07 +Subproject commit 5df683cd87cb0ed13f915f73b83a7673e18aa294 From git at git.haskell.org Thu May 8 12:06:27 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 8 May 2014 12:06:27 +0000 (UTC) Subject: [commit: ghc] master: Improve tracing in Simplifier (76820ca) Message-ID: <20140508120627.438662406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/76820ca3e3d8fec9992b19344bbe72bd2f00983a/ghc >--------------------------------------------------------------- commit 76820ca3e3d8fec9992b19344bbe72bd2f00983a Author: Simon Peyton Jones Date: Mon Apr 7 15:41:45 2014 +0100 Improve tracing in Simplifier >--------------------------------------------------------------- 76820ca3e3d8fec9992b19344bbe72bd2f00983a compiler/simplCore/Simplify.lhs | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/compiler/simplCore/Simplify.lhs b/compiler/simplCore/Simplify.lhs index 02470be..eb1a703 100644 --- a/compiler/simplCore/Simplify.lhs +++ b/compiler/simplCore/Simplify.lhs @@ -219,9 +219,7 @@ simplTopBinds env0 binds0 -- It's rather as if the top-level binders were imported. -- See note [Glomming] in OccurAnal. ; env1 <- simplRecBndrs env0 (bindersOfBinds binds0) - ; dflags <- getDynFlags - ; let dump_flag = dopt Opt_D_verbose_core2core dflags - ; env2 <- simpl_binds dump_flag env1 binds0 + ; env2 <- simpl_binds env1 binds0 ; freeTick SimplifierDone ; return env2 } where @@ -229,16 +227,10 @@ simplTopBinds env0 binds0 -- they should have their fragile IdInfo zapped (notably occurrence info) -- That's why we run down binds and bndrs' simultaneously. -- - -- The dump-flag emits a trace for each top-level binding, which - -- helps to locate the tracing for inlining and rule firing - simpl_binds :: Bool -> SimplEnv -> [InBind] -> SimplM SimplEnv - simpl_binds _ env [] = return env - simpl_binds dump env (bind:binds) = do { env' <- trace_bind dump bind $ - simpl_bind env bind - ; simpl_binds dump env' binds } - - trace_bind True bind = pprTrace "SimplBind" (ppr (bindersOf bind)) - trace_bind False _ = \x -> x + simpl_binds :: SimplEnv -> [InBind] -> SimplM SimplEnv + simpl_binds env [] = return env + simpl_binds env (bind:binds) = do { env' <- simpl_bind env bind + ; simpl_binds env' binds } simpl_bind env (Rec pairs) = simplRecBind env TopLevel pairs simpl_bind env (NonRec b r) = simplRecOrTopPair env' TopLevel NonRecursive b b' r @@ -293,12 +285,21 @@ simplRecOrTopPair :: SimplEnv -> SimplM SimplEnv -- Returns an env that includes the binding simplRecOrTopPair env top_lvl is_rec old_bndr new_bndr rhs - = do dflags <- getDynFlags - -- Check for unconditional inline - if preInlineUnconditionally dflags env top_lvl old_bndr rhs + = do { dflags <- getDynFlags + ; trace_bind dflags $ + if preInlineUnconditionally dflags env top_lvl old_bndr rhs + -- Check for unconditional inline then do tick (PreInlineUnconditionally old_bndr) return (extendIdSubst env old_bndr (mkContEx env rhs)) - else simplLazyBind env top_lvl is_rec old_bndr new_bndr rhs env + else simplLazyBind env top_lvl is_rec old_bndr new_bndr rhs env } + where + trace_bind dflags thing_inside + | not (dopt Opt_D_verbose_core2core dflags) + = thing_inside + | otherwise + = pprTrace "SimplBind" (ppr old_bndr) thing_inside + -- trace_bind emits a trace for each top-level binding, which + -- helps to locate the tracing for inlining and rule firing \end{code} From git at git.haskell.org Thu May 8 12:06:32 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 8 May 2014 12:06:32 +0000 (UTC) Subject: [commit: ghc] master: Refactor buildClass and mkDictSelId a bit, to avoid the no_unf argument (0f978b5) Message-ID: <20140508120632.640462406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/0f978b5be87ab0835301e63e7a3c05a1d3d281d5/ghc >--------------------------------------------------------------- commit 0f978b5be87ab0835301e63e7a3c05a1d3d281d5 Author: Simon Peyton Jones Date: Thu May 8 10:31:53 2014 +0100 Refactor buildClass and mkDictSelId a bit, to avoid the no_unf argument No change in functionality, just a cleaner story, with the RHS for dictionary selectors being treated less specially than before. >--------------------------------------------------------------- 0f978b5be87ab0835301e63e7a3c05a1d3d281d5 compiler/basicTypes/MkId.lhs | 62 +++++++++++++------------- compiler/iface/BuildTyCl.lhs | 15 +++---- compiler/iface/TcIface.lhs | 2 +- compiler/main/TidyPgm.lhs | 5 ++- compiler/typecheck/TcTyClsDecls.lhs | 2 +- compiler/vectorise/Vectorise/Type/TyConDecl.hs | 1 - 6 files changed, 41 insertions(+), 46 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 0f978b5be87ab0835301e63e7a3c05a1d3d281d5 From git at git.haskell.org Thu May 8 12:06:36 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 8 May 2014 12:06:36 +0000 (UTC) Subject: [commit: ghc] master: Mark evaluated arguments in dataConInstPat (4088799) Message-ID: <20140508120636.5B4472406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/40887990f274f900f306ca319d356f3046bf81a1/ghc >--------------------------------------------------------------- commit 40887990f274f900f306ca319d356f3046bf81a1 Author: Simon Peyton Jones Date: Thu May 8 10:33:17 2014 +0100 Mark evaluated arguments in dataConInstPat See Note [Mark evaluated arguments] in CoreUtils. This is not a significant change, but avoids a spurious Lint complaint. >--------------------------------------------------------------- 40887990f274f900f306ca319d356f3046bf81a1 compiler/coreSyn/CoreUtils.lhs | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/compiler/coreSyn/CoreUtils.lhs b/compiler/coreSyn/CoreUtils.lhs index ea2e17f..0acad9d 100644 --- a/compiler/coreSyn/CoreUtils.lhs +++ b/compiler/coreSyn/CoreUtils.lhs @@ -1222,7 +1222,7 @@ dataConInstPat :: [FastString] -- A long enough list of FSs to use for -> [Unique] -- An equally long list of uniques, at least one for each binder -> DataCon -> [Type] -- Types to instantiate the universally quantified tyvars - -> ([TyVar], [Id]) -- Return instantiated variables + -> ([TyVar], [Id]) -- Return instantiated variables -- dataConInstPat arg_fun fss us con inst_tys returns a triple -- (ex_tvs, arg_ids), -- @@ -1257,7 +1257,7 @@ dataConInstPat fss uniqs con inst_tys univ_tvs = dataConUnivTyVars con ex_tvs = dataConExTyVars con arg_tys = dataConRepArgTys con - + arg_strs = dataConRepStrictness con -- 1-1 with arg_tys n_ex = length ex_tvs -- split the Uniques and FastStrings @@ -1280,11 +1280,30 @@ dataConInstPat fss uniqs con inst_tys kind = Type.substTy subst (tyVarKind tv) -- Make value vars, instantiating types - arg_ids = zipWith3 mk_id_var id_uniqs id_fss arg_tys - mk_id_var uniq fs ty = mkUserLocal (mkVarOccFS fs) uniq - (Type.substTy full_subst ty) noSrcSpan + arg_ids = zipWith4 mk_id_var id_uniqs id_fss arg_tys arg_strs + mk_id_var uniq fs ty str + = mkLocalIdWithInfo name (Type.substTy full_subst ty) info + where + name = mkInternalName uniq (mkVarOccFS fs) noSrcSpan + info | isMarkedStrict str = vanillaIdInfo `setUnfoldingInfo` evaldUnfolding + | otherwise = vanillaIdInfo + -- See Note [Mark evaluated arguments] \end{code} +Note [Mark evaluated arguments] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +When pattern matching on a constructor with strict fields, the binder +can have an 'evaldUnfolding'. Moreover, it *should* have one, so that +when loading an interface file unfolding like: + data T = MkT !Int + f x = case x of { MkT y -> let v::Int# = case y of I# n -> n+1 + in ... } +we don't want Lint to complain. The 'y' is evaluated, so the +case in the RHS of the binding for 'v' is fine. But only if we +*know* that 'y' is evaluated. + +c.f. add_evals in Simplify.simplAlt + %************************************************************************ %* * Equality From git at git.haskell.org Thu May 8 12:06:38 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 8 May 2014 12:06:38 +0000 (UTC) Subject: [commit: ghc] master: Preserve evaluated-ness in CoreTidy (35be701) Message-ID: <20140508120639.4D8912406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/35be701121056b83e9f1ef911156aec829180a6b/ghc >--------------------------------------------------------------- commit 35be701121056b83e9f1ef911156aec829180a6b Author: Simon Peyton Jones Date: Thu May 8 10:38:52 2014 +0100 Preserve evaluated-ness in CoreTidy The main effect of this patch is to preserve the evaluated-ness of case binders and suchlike, to avoid spurious Lint complaints after tidying. See Note [Preserve evaluatedness] in CoreTidy. Plus a bit of associated refactoring of tidyIdBndr, tidyLetBndr. >--------------------------------------------------------------- 35be701121056b83e9f1ef911156aec829180a6b compiler/coreSyn/CoreTidy.lhs | 107 ++++++++++++++++++++++++++---------------- 1 file changed, 66 insertions(+), 41 deletions(-) diff --git a/compiler/coreSyn/CoreTidy.lhs b/compiler/coreSyn/CoreTidy.lhs index 8c0ae4a..cb2af7c 100644 --- a/compiler/coreSyn/CoreTidy.lhs +++ b/compiler/coreSyn/CoreTidy.lhs @@ -33,7 +33,6 @@ import Name hiding (tidyNameOcc) import SrcLoc import Maybes import Data.List -import Outputable \end{code} @@ -141,46 +140,6 @@ tidyBndr env var tidyBndrs :: TidyEnv -> [Var] -> (TidyEnv, [Var]) tidyBndrs env vars = mapAccumL tidyBndr env vars -tidyLetBndr :: TidyEnv -- Knot-tied version for unfoldings - -> TidyEnv -- The one to extend - -> (Id, CoreExpr) -> (TidyEnv, Var) --- Used for local (non-top-level) let(rec)s -tidyLetBndr rec_tidy_env env (id,rhs) - = ((tidy_occ_env,new_var_env), final_id) - where - ((tidy_occ_env,var_env), new_id) = tidyIdBndr env id - new_var_env = extendVarEnv var_env id final_id - -- Override the env we get back from tidyId with the - -- new IdInfo so it gets propagated to the usage sites. - - -- We need to keep around any interesting strictness and - -- demand info because later on we may need to use it when - -- converting to A-normal form. - -- eg. - -- f (g x), where f is strict in its argument, will be converted - -- into case (g x) of z -> f z by CorePrep, but only if f still - -- has its strictness info. - -- - -- Similarly for the demand info - on a let binder, this tells - -- CorePrep to turn the let into a case. - -- - -- Similarly arity info for eta expansion in CorePrep - -- - -- Set inline-prag info so that we preseve it across - -- separate compilation boundaries - final_id = new_id `setIdInfo` new_info - idinfo = idInfo id - new_info = idInfo new_id - `setArityInfo` exprArity rhs - `setStrictnessInfo` strictnessInfo idinfo - `setDemandInfo` demandInfo idinfo - `setInlinePragInfo` inlinePragInfo idinfo - `setUnfoldingInfo` new_unf - - new_unf | isStableUnfolding unf = tidyUnfolding rec_tidy_env unf (panic "tidy_unf") - | otherwise = noUnfolding - unf = unfoldingInfo idinfo - -- Non-top-level variables tidyIdBndr :: TidyEnv -> Id -> (TidyEnv, Id) tidyIdBndr env@(tidy_env, var_env) id @@ -199,11 +158,60 @@ tidyIdBndr env@(tidy_env, var_env) id -- Note [Tidy IdInfo] new_info = vanillaIdInfo `setOccInfo` occInfo old_info + `setUnfoldingInfo` new_unf old_info = idInfo id + old_unf = unfoldingInfo old_info + new_unf | isEvaldUnfolding old_unf = evaldUnfolding + | otherwise = noUnfolding + -- See Note [Preserve evaluatedness] in ((tidy_env', var_env'), id') } +tidyLetBndr :: TidyEnv -- Knot-tied version for unfoldings + -> TidyEnv -- The one to extend + -> (Id, CoreExpr) -> (TidyEnv, Var) +-- Used for local (non-top-level) let(rec)s +-- Just like tidyIdBndr above, but with more IdInfo +tidyLetBndr rec_tidy_env env@(tidy_env, var_env) (id,rhs) + = case tidyOccName tidy_env (getOccName id) of { (tidy_env', occ') -> + let + ty' = tidyType env (idType id) + name' = mkInternalName (idUnique id) occ' noSrcSpan + id' = mkLocalIdWithInfo name' ty' new_info + var_env' = extendVarEnv var_env id id' + + -- Note [Tidy IdInfo] + -- We need to keep around any interesting strictness and + -- demand info because later on we may need to use it when + -- converting to A-normal form. + -- eg. + -- f (g x), where f is strict in its argument, will be converted + -- into case (g x) of z -> f z by CorePrep, but only if f still + -- has its strictness info. + -- + -- Similarly for the demand info - on a let binder, this tells + -- CorePrep to turn the let into a case. + -- + -- Similarly arity info for eta expansion in CorePrep + -- + -- Set inline-prag info so that we preseve it across + -- separate compilation boundaries + old_info = idInfo id + new_info = vanillaIdInfo + `setOccInfo` occInfo old_info + `setArityInfo` exprArity rhs + `setStrictnessInfo` strictnessInfo old_info + `setDemandInfo` demandInfo old_info + `setInlinePragInfo` inlinePragInfo old_info + `setUnfoldingInfo` new_unf + + new_unf | isStableUnfolding old_unf = tidyUnfolding rec_tidy_env old_unf old_unf + | otherwise = noUnfolding + old_unf = unfoldingInfo old_info + in + ((tidy_env', var_env'), id') } + ------------ Unfolding -------------- tidyUnfolding :: TidyEnv -> Unfolding -> Unfolding -> Unfolding tidyUnfolding tidy_env df@(DFunUnfolding { df_bndrs = bndrs, df_args = args }) _ @@ -237,6 +245,23 @@ two reasons: Note that tidyLetBndr puts more IdInfo back. +Note [Preserve evaluatedness] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Consider + data T = MkT !Bool + ....(case v of MkT y -> + let z# = case y of + True -> 1# + False -> 2# + in ...) + +The z# binding is ok becuase the RHS is ok-for-speculation, +but Lint will complain unless it can *see* that. So we +preserve the evaluated-ness on 'y' in tidyBndr. + +(Another alterantive would be to tidy unboxed lets into cases, +but that seems more indirect and surprising.) + \begin{code} (=:) :: a -> (a -> b) -> b From git at git.haskell.org Thu May 8 12:06:42 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 8 May 2014 12:06:42 +0000 (UTC) Subject: [commit: ghc] master: Better error message in vectoriser (b5ca10c) Message-ID: <20140508120642.67EA72406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/b5ca10c08b2ae4d8914fb7565dc0a93165420260/ghc >--------------------------------------------------------------- commit b5ca10c08b2ae4d8914fb7565dc0a93165420260 Author: Simon Peyton Jones Date: Thu May 8 10:39:21 2014 +0100 Better error message in vectoriser >--------------------------------------------------------------- b5ca10c08b2ae4d8914fb7565dc0a93165420260 compiler/vectorise/Vectorise.hs | 2 +- testsuite/tests/dph/modules/dph-ExportList-vseg-fast.stderr | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/compiler/vectorise/Vectorise.hs b/compiler/vectorise/Vectorise.hs index 012ae37..38bd554 100644 --- a/compiler/vectorise/Vectorise.hs +++ b/compiler/vectorise/Vectorise.hs @@ -351,6 +351,6 @@ tryConvert var vect_var rhs = fromVect (idType var) (Var vect_var) `orElseErrV` do - { emitVt " Could NOT call vectorised from original version" $ ppr var + { emitVt " Could NOT call vectorised from original version" $ ppr var <+> dcolon <+> ppr (idType var) ; return rhs } diff --git a/testsuite/tests/dph/modules/dph-ExportList-vseg-fast.stderr b/testsuite/tests/dph/modules/dph-ExportList-vseg-fast.stderr index 749c3cd..bf6f453 100644 --- a/testsuite/tests/dph/modules/dph-ExportList-vseg-fast.stderr +++ b/testsuite/tests/dph/modules/dph-ExportList-vseg-fast.stderr @@ -1,6 +1,9 @@ [1 of 1] Compiling ExportList ( ExportList.hs, ExportList.o ) Warning: vectorisation failure: identityConvTyCon: type constructor contains parallel arrays [::] - Could NOT call vectorised from original version ExportList.solveV + Could NOT call vectorised from original version + ExportList.solveV :: GHC.Types.Double -> [:GHC.Types.Double:] Warning: vectorisation failure: identityConvTyCon: type constructor contains parallel arrays NodeV Could NOT call vectorised from original version - ExportList.solvePA + ExportList.solvePA :: ExportList.NodeV + -> GHC.Types.Double + -> Data.Array.Parallel.PArray.PData.Base.PArray GHC.Types.Double From git at git.haskell.org Thu May 8 12:06:45 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 8 May 2014 12:06:45 +0000 (UTC) Subject: [commit: ghc] master: Error message wibble, presumably due to recent changes in transformers (12332f1) Message-ID: <20140508120645.A0D7A2406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/12332f1add3eb9615a62abb36898819b2e67e865/ghc >--------------------------------------------------------------- commit 12332f1add3eb9615a62abb36898819b2e67e865 Author: Simon Peyton Jones Date: Thu May 8 13:06:05 2014 +0100 Error message wibble, presumably due to recent changes in transformers >--------------------------------------------------------------- 12332f1add3eb9615a62abb36898819b2e67e865 testsuite/tests/ghci/scripts/T5979.stderr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testsuite/tests/ghci/scripts/T5979.stderr b/testsuite/tests/ghci/scripts/T5979.stderr index fe6e012..7230011 100644 --- a/testsuite/tests/ghci/scripts/T5979.stderr +++ b/testsuite/tests/ghci/scripts/T5979.stderr @@ -1,4 +1,4 @@ : Could not find module ?Control.Monad.Trans.State? - It is not a module in the current program, or in any known package. + It is a member of the hidden package ?transformers-0.3.0.0?. From git at git.haskell.org Thu May 8 15:54:42 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 8 May 2014 15:54:42 +0000 (UTC) Subject: [commit: ghc] wip/ext-solver: A function for working with external constraints in bulk. (ca2721e) Message-ID: <20140508155444.40EE22406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ext-solver Link : http://ghc.haskell.org/trac/ghc/changeset/ca2721e84f2aa373361d5360922e7149d0602ded/ghc >--------------------------------------------------------------- commit ca2721e84f2aa373361d5360922e7149d0602ded Author: Iavor S. Diatchki Date: Thu May 8 08:54:27 2014 -0700 A function for working with external constraints in bulk. >--------------------------------------------------------------- ca2721e84f2aa373361d5360922e7149d0602ded compiler/typecheck/TcTypeNats.hs | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/compiler/typecheck/TcTypeNats.hs b/compiler/typecheck/TcTypeNats.hs index c7d2a25..4144906 100644 --- a/compiler/typecheck/TcTypeNats.hs +++ b/compiler/typecheck/TcTypeNats.hs @@ -932,8 +932,11 @@ solverImproveModel proc viRef imps = then varEq x ((x, e) : imps) more ys else varEq x imps (def : more) ys - -solverNewWork :: SolverProcess -> IORef VarInfo -> CtLoc -> Bool -> IO ExtSolRes +-- Examine the current state of the solver and compute new work. +solverNewWork :: SolverProcess -> IORef VarInfo + -> CtLoc -- Source of the new constraints + -> Bool -- Should generate givens? + -> IO ExtSolRes solverNewWork proc viRef loc withEv = do status <- solverCheck proc case status of @@ -949,6 +952,32 @@ solverNewWork proc viRef loc withEv = $ mkNewFact loc withEv (mkTyVarTy tv, ty) return $ ExtSolOk $ mapMaybe toCt imps +-- Check a list of constraints for consistency, and computer derived work. +-- Assumes that all constraints are given or all are not given. +solverImprove :: SolverProcess -> IORef VarInfo + -> [Ct] -> IO ExtSolRes +solverImprove proc viRef cts = + do let (ours, ourCts) = + unzip [ (rep,ct) | ct <- cts, Just rep <- [ knownCt ct ] ] + case ourCts of + [] -> return (ExtSolOk []) + oneOfOurs : _ -> + do solverPush proc viRef + mapM_ assume ours + let loc = ctLoc oneOfOurs -- XXX: What is a better location? + + -- XXX: When we compute improvements, + -- we should probably limit ourselves to compute improvements + -- only for the variables in the current scope. + res <- solverNewWork proc viRef loc (isGivenCt oneOfOurs) + solverPop proc viRef + return res + where + assume (vars,expr) = + do mapM_ (solverDeclare proc viRef) (eltsUFM vars) + solverAssume proc expr + + smtTy :: Ty -> SExpr smtTy ty = From git at git.haskell.org Sat May 10 02:51:49 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 10 May 2014 02:51:49 +0000 (UTC) Subject: [commit: ghc] master: Update .gitignore (c302a46) Message-ID: <20140510025149.535A72406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/c302a464556e837eaadbb60b310c09c8ab58fb40/ghc >--------------------------------------------------------------- commit c302a464556e837eaadbb60b310c09c8ab58fb40 Author: Austin Seipp Date: Sat May 3 17:35:04 2014 -0500 Update .gitignore Signed-off-by: Austin Seipp >--------------------------------------------------------------- c302a464556e837eaadbb60b310c09c8ab58fb40 .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 93fb881..a25197d 100644 --- a/.gitignore +++ b/.gitignore @@ -167,6 +167,7 @@ _darcs/ /utils/runghc/runghc.cabal /extra-gcc-opts +/sdistprep .tm_properties VERSION From git at git.haskell.org Sat May 10 02:51:52 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 10 May 2014 02:51:52 +0000 (UTC) Subject: [commit: ghc] master: testsuite: fix cgrun051 exit code (2f9a846) Message-ID: <20140510025152.EC2FE2406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/2f9a846848fa673e4fc635feff60598c57fedf8d/ghc >--------------------------------------------------------------- commit 2f9a846848fa673e4fc635feff60598c57fedf8d Author: Austin Seipp Date: Fri May 9 20:58:06 2014 -0500 testsuite: fix cgrun051 exit code Signed-off-by: Austin Seipp >--------------------------------------------------------------- 2f9a846848fa673e4fc635feff60598c57fedf8d testsuite/tests/codeGen/should_run/all.T | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testsuite/tests/codeGen/should_run/all.T b/testsuite/tests/codeGen/should_run/all.T index 1efe2a6..98328cf 100644 --- a/testsuite/tests/codeGen/should_run/all.T +++ b/testsuite/tests/codeGen/should_run/all.T @@ -48,7 +48,7 @@ test('cgrun047', normal, compile_and_run, ['']) test('cgrun048', normal, compile_and_run, ['']) test('cgrun049', normal, compile_and_run, ['-funbox-strict-fields']) test('cgrun050', normal, compile_and_run, ['']) -test('cgrun051', normal, compile_and_run, ['']) +test('cgrun051', [exit_code(1)], compile_and_run, ['']) test('cgrun052', only_ways(['optasm']), compile_and_run, ['-funbox-strict-fields']) test('cgrun053', normal, compile_and_run, ['']) test('cgrun054', normal, compile_and_run, ['']) From git at git.haskell.org Sat May 10 02:51:55 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 10 May 2014 02:51:55 +0000 (UTC) Subject: [commit: ghc] master: testsuite: fix cc004 (3ed867f) Message-ID: <20140510025155.447922406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/3ed867ff56cc3849b9bb20f939722de5a2f93809/ghc >--------------------------------------------------------------- commit 3ed867ff56cc3849b9bb20f939722de5a2f93809 Author: Austin Seipp Date: Fri May 9 21:50:52 2014 -0500 testsuite: fix cc004 Signed-off-by: Austin Seipp >--------------------------------------------------------------- 3ed867ff56cc3849b9bb20f939722de5a2f93809 testsuite/tests/ffi/should_compile/all.T | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/testsuite/tests/ffi/should_compile/all.T b/testsuite/tests/ffi/should_compile/all.T index 81f6a0d..84c7e86 100644 --- a/testsuite/tests/ffi/should_compile/all.T +++ b/testsuite/tests/ffi/should_compile/all.T @@ -9,9 +9,9 @@ test('cc001', normal, compile, ['']) # Non-static C call # cc004 test also uses stdcall, so it only works on i386. if config.platform.startswith('i386-'): - ways = expect_fail -else: ways = normal +else: + ways = expect_fail test('cc004', ways, compile, ['']) test('cc005', normal, compile, ['']) From git at git.haskell.org Sat May 10 09:39:36 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 10 May 2014 09:39:36 +0000 (UTC) Subject: [commit: ghc] master: Require transformers for T5979 (3abf949) Message-ID: <20140510093936.E5C402406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/3abf949b50f9fd84633fbf9b479e9cd5fa7125cd/ghc >--------------------------------------------------------------- commit 3abf949b50f9fd84633fbf9b479e9cd5fa7125cd Author: Joachim Breitner Date: Sat May 10 11:38:49 2014 +0200 Require transformers for T5979 in order to get a reliable error message (although the error message could be improved anyways to mention the explicit package the module is imported with.) >--------------------------------------------------------------- 3abf949b50f9fd84633fbf9b479e9cd5fa7125cd testsuite/tests/ghci/scripts/all.T | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testsuite/tests/ghci/scripts/all.T b/testsuite/tests/ghci/scripts/all.T index aacdd26..5918e13 100755 --- a/testsuite/tests/ghci/scripts/all.T +++ b/testsuite/tests/ghci/scripts/all.T @@ -113,7 +113,7 @@ test('T5564', normal, ghci_script, ['T5564.script']) test('Defer02', normal, ghci_script, ['Defer02.script']) test('T5820', normal, ghci_script, ['T5820.script']) test('T5836', normal, ghci_script, ['T5836.script']) -test('T5979', normalise_slashes, ghci_script, ['T5979.script']) +test('T5979', [reqlib('transformers'), normalise_slashes], ghci_script, ['T5979.script']) test('T5975a', [pre_cmd('touch f??b?r1.hs'), clean_cmd('rm f??b?r1.hs')], From git at git.haskell.org Sat May 10 16:30:22 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 10 May 2014 16:30:22 +0000 (UTC) Subject: [commit: ghc] master: Revert output of T5979 (fe8a378) Message-ID: <20140510163022.C56952406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/fe8a378ceb457fc8cdf97211fddf780f3fb1857f/ghc >--------------------------------------------------------------- commit fe8a378ceb457fc8cdf97211fddf780f3fb1857f Author: Joachim Breitner Date: Sat May 10 18:28:44 2014 +0200 Revert output of T5979 this reverts 12332f1. The error message changes when there are two versions of transformers in the database, one of them hidden. That might be a bug of its own, but for now lets make the test case succeed after a fresh build. Affected developers should probably $ ./inplace/bin/ghc-pkg unregister transformers-0.3.0.0 >--------------------------------------------------------------- fe8a378ceb457fc8cdf97211fddf780f3fb1857f testsuite/tests/ghci/scripts/T5979.stderr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testsuite/tests/ghci/scripts/T5979.stderr b/testsuite/tests/ghci/scripts/T5979.stderr index 7230011..fe6e012 100644 --- a/testsuite/tests/ghci/scripts/T5979.stderr +++ b/testsuite/tests/ghci/scripts/T5979.stderr @@ -1,4 +1,4 @@ : Could not find module ?Control.Monad.Trans.State? - It is a member of the hidden package ?transformers-0.3.0.0?. + It is not a module in the current program, or in any known package. From git at git.haskell.org Sun May 11 02:36:25 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 11 May 2014 02:36:25 +0000 (UTC) Subject: [commit: ghc] wip/ext-solver: Clarify comment. (7ef3656) Message-ID: <20140511023625.A58902406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ext-solver Link : http://ghc.haskell.org/trac/ghc/changeset/7ef36561bc080007ee70fe49071e96a3c6a6eca6/ghc >--------------------------------------------------------------- commit 7ef36561bc080007ee70fe49071e96a3c6a6eca6 Author: Iavor S. Diatchki Date: Sat May 10 12:00:04 2014 -0700 Clarify comment. >--------------------------------------------------------------- 7ef36561bc080007ee70fe49071e96a3c6a6eca6 compiler/typecheck/TcTypeNats.hs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/compiler/typecheck/TcTypeNats.hs b/compiler/typecheck/TcTypeNats.hs index 4144906..3114184 100644 --- a/compiler/typecheck/TcTypeNats.hs +++ b/compiler/typecheck/TcTypeNats.hs @@ -952,8 +952,13 @@ solverNewWork proc viRef loc withEv = $ mkNewFact loc withEv (mkTyVarTy tv, ty) return $ ExtSolOk $ mapMaybe toCt imps --- Check a list of constraints for consistency, and computer derived work. --- Assumes that all constraints are given or all are not given. +{- +Check a list of constraints for consistency, and computer derived work. +Does not affect set off assertions in the solver. +Assumes that either: + * all constraints are given, or + * all are not given. +-} solverImprove :: SolverProcess -> IORef VarInfo -> [Ct] -> IO ExtSolRes solverImprove proc viRef cts = From git at git.haskell.org Sun May 11 02:36:28 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 11 May 2014 02:36:28 +0000 (UTC) Subject: [commit: ghc] wip/ext-solver: A function to identify constraints that lead to a contradiction. (fceea0d) Message-ID: <20140511023628.379A62406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ext-solver Link : http://ghc.haskell.org/trac/ghc/changeset/fceea0d41b261a1dd43cc23958f8561a80db5a13/ghc >--------------------------------------------------------------- commit fceea0d41b261a1dd43cc23958f8561a80db5a13 Author: Iavor S. Diatchki Date: Sat May 10 12:00:40 2014 -0700 A function to identify constraints that lead to a contradiction. >--------------------------------------------------------------- fceea0d41b261a1dd43cc23958f8561a80db5a13 compiler/typecheck/TcTypeNats.hs | 59 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/compiler/typecheck/TcTypeNats.hs b/compiler/typecheck/TcTypeNats.hs index 3114184..9cad950 100644 --- a/compiler/typecheck/TcTypeNats.hs +++ b/compiler/typecheck/TcTypeNats.hs @@ -982,6 +982,65 @@ solverImprove proc viRef cts = do mapM_ (solverDeclare proc viRef) (eltsUFM vars) solverAssume proc expr +{- Given a set of constraints, try to split them into: + + (constraints that lead to a contradiction, all the others) + +Does not change the assertion state of the solver. +-} + +solverFindConstraidction :: SolverProcess -> IORef VarInfo -> + [Ct] -> IO (Maybe ([Ct], [Ct])) +solverFindConstraidction proc viRef cts = + do push -- scope for `needed` + prepare [] [] cts -- declare variables, then search. + + where + check = solverCheck proc + push = solverPush proc viRef + pop = solverPop proc viRef + assume = solverAssume proc + + prepare notNeeded maybeNeeded [] = + minimize notNeeded [] maybeNeeded + + prepare notNeeded maybeNeeded (ct : cts) = + case knownCt ct of + Just (vars,e) -> + do mapM_ (solverDeclare proc viRef) (eltsUFM vars) + prepare notNeeded ((ct,e) : maybeNeeded) cts + Nothing -> + prepare (ct : notNeeded) maybeNeeded cts + + + minimize notNeeded needed maybeNeeded = + do res <- check + case res of + Unsat -> do pop -- remove `needed` scope. + return $ Just (needed, map fst maybeNeeded ++ notNeeded) + _ -> do push -- scope for `maybeNeeded` + search notNeeded needed [] maybeNeeded + + search _ needed _ [] = + do pop -- Remove `maybeNeeded` + pop -- Remove `needed` + case needed of + [] -> return Nothing -- No definite contradictions + _ -> fail "Bug: we found a contradiction, and then lost it!" + + search notNeeded needed maybeNeeded ((ct,e) : more) = + do assume e -- Add to `maybeNeeded` + res <- check + case res of + + Unsat -> -- We found a contradiction using `needed` and `maybeNeeded`. + do pop -- remove `maybeNedded` + assume e -- add to `needed` + minimize (map fst more ++ notNeeded) (ct : needed) maybeNeeded + + -- No contradiction, keep searching. + _ -> search notNeeded needed ((ct,e) : maybeNeeded) more + smtTy :: Ty -> SExpr From git at git.haskell.org Sun May 11 02:36:30 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 11 May 2014 02:36:30 +0000 (UTC) Subject: [commit: ghc] wip/ext-solver: A function to simplify a set of constraints. (3c5f574) Message-ID: <20140511023630.C1FED2406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ext-solver Link : http://ghc.haskell.org/trac/ghc/changeset/3c5f57440321d8e41379dca015d2d62387fb130c/ghc >--------------------------------------------------------------- commit 3c5f57440321d8e41379dca015d2d62387fb130c Author: Iavor S. Diatchki Date: Sat May 10 12:35:30 2014 -0700 A function to simplify a set of constraints. Also, we factor out a common pattern. >--------------------------------------------------------------- 3c5f57440321d8e41379dca015d2d62387fb130c compiler/typecheck/TcTypeNats.hs | 90 +++++++++++++++++++++++++++++----------- 1 file changed, 65 insertions(+), 25 deletions(-) diff --git a/compiler/typecheck/TcTypeNats.hs b/compiler/typecheck/TcTypeNats.hs index 9cad950..4038a54 100644 --- a/compiler/typecheck/TcTypeNats.hs +++ b/compiler/typecheck/TcTypeNats.hs @@ -952,6 +952,26 @@ solverNewWork proc viRef loc withEv = $ mkNewFact loc withEv (mkTyVarTy tv, ty) return $ ExtSolOk $ mapMaybe toCt imps + +-------------------------------------------------------------------------------- +-- Higher level operations on collections of constraints. + + +-- Identify our constraints, and declare their variables in the current scope. +solverPrepare :: SolverProcess -> IORef VarInfo -> + [Ct] -> IO ([Ct], [(Ct,SExpr)]) +solverPrepare proc viRef = go [] [] + where + go others ours [] = return (others, ours) + go others ours (ct : cts) = + case knownCt ct of + Just (vars,e) -> + do mapM_ (solverDeclare proc viRef) (eltsUFM vars) + go others ((ct,e) : ours) cts + Nothing -> + go (ct : others) ours cts + + {- Check a list of constraints for consistency, and computer derived work. Does not affect set off assertions in the solver. @@ -962,25 +982,29 @@ Assumes that either: solverImprove :: SolverProcess -> IORef VarInfo -> [Ct] -> IO ExtSolRes solverImprove proc viRef cts = - do let (ours, ourCts) = - unzip [ (rep,ct) | ct <- cts, Just rep <- [ knownCt ct ] ] - case ourCts of - [] -> return (ExtSolOk []) - oneOfOurs : _ -> - do solverPush proc viRef - mapM_ assume ours + do push + (_,ours) <- solverPrepare proc viRef cts + case ours of + [] -> do pop + return (ExtSolOk []) + (oneOfOurs,_) : _ -> + do mapM_ (assume . snd) ours let loc = ctLoc oneOfOurs -- XXX: What is a better location? -- XXX: When we compute improvements, -- we should probably limit ourselves to compute improvements -- only for the variables in the current scope. + -- XXX: This might be a good idea for wanteds, but not givens: + -- assumptions in a later scope, may give us facts about + -- givens in earlier scopes. res <- solverNewWork proc viRef loc (isGivenCt oneOfOurs) - solverPop proc viRef + pop return res where - assume (vars,expr) = - do mapM_ (solverDeclare proc viRef) (eltsUFM vars) - solverAssume proc expr + push = solverPush proc viRef + pop = solverPop proc viRef + assume = solverAssume proc + {- Given a set of constraints, try to split them into: @@ -992,8 +1016,9 @@ Does not change the assertion state of the solver. solverFindConstraidction :: SolverProcess -> IORef VarInfo -> [Ct] -> IO (Maybe ([Ct], [Ct])) solverFindConstraidction proc viRef cts = - do push -- scope for `needed` - prepare [] [] cts -- declare variables, then search. + do push -- scope for `needed` + (others,ours) <- solverPrepare proc viRef cts -- declare vars + minimize others [] ours where check = solverCheck proc @@ -1001,18 +1026,6 @@ solverFindConstraidction proc viRef cts = pop = solverPop proc viRef assume = solverAssume proc - prepare notNeeded maybeNeeded [] = - minimize notNeeded [] maybeNeeded - - prepare notNeeded maybeNeeded (ct : cts) = - case knownCt ct of - Just (vars,e) -> - do mapM_ (solverDeclare proc viRef) (eltsUFM vars) - prepare notNeeded ((ct,e) : maybeNeeded) cts - Nothing -> - prepare (ct : notNeeded) maybeNeeded cts - - minimize notNeeded needed maybeNeeded = do res <- check case res of @@ -1043,6 +1056,33 @@ solverFindConstraidction proc viRef cts = +solverSimplify :: SolverProcess -> IORef VarInfo -> + [Ct] -> IO ([(EvTerm,Ct)], [Ct]) +solverSimplify proc viRef cts = + do push -- `unsolved` scope + (others,ours) <- solverPrepare proc viRef cts + go others [] ours + where + push = solverPush proc viRef + pop = solverPop proc viRef + assume = solverAssume proc + + go unsolved solved [] = + do pop -- remove `unsolved` scope + return (solved, unsolved) + + go unsolved solved ((ct,e) : more) = + do push -- Temporarily assume everything else. + mapM_ (assume . snd) more + proved <- solverProve proc viRef e + pop + if proved + then let ev = evBySMT "SMT" $ getEqPredTys $ ctPred ct + in go unsolved ((ev,ct) : solved) more + else do assume e -- add to `unsolved` + go (ct : unsolved) solved more + + smtTy :: Ty -> SExpr smtTy ty = SAtom $ From git at git.haskell.org Sun May 11 02:36:33 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 11 May 2014 02:36:33 +0000 (UTC) Subject: [commit: ghc] wip/ext-solver: Plug-in finding contradictions with improvement. (3455753) Message-ID: <20140511023633.43C0C2406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ext-solver Link : http://ghc.haskell.org/trac/ghc/changeset/3455753a167ef02e61615dfc5b3ad681e7f92dcc/ghc >--------------------------------------------------------------- commit 3455753a167ef02e61615dfc5b3ad681e7f92dcc Author: Iavor S. Diatchki Date: Sat May 10 14:37:12 2014 -0700 Plug-in finding contradictions with improvement. >--------------------------------------------------------------- 3455753a167ef02e61615dfc5b3ad681e7f92dcc compiler/typecheck/TcInteract.lhs | 2 +- compiler/typecheck/TcTypeNats.hs | 94 ++++++++++++++++++++++++++++----------- 2 files changed, 68 insertions(+), 28 deletions(-) diff --git a/compiler/typecheck/TcInteract.lhs b/compiler/typecheck/TcInteract.lhs index 6740d47..353dad6 100644 --- a/compiler/typecheck/TcInteract.lhs +++ b/compiler/typecheck/TcInteract.lhs @@ -249,7 +249,7 @@ externalSolverStage wi = {- Perhaps we should remove constraints that lead to a contadiction? As is, all constraints in this scope will be discarded (solved trivially). This seems OK: after all, the program is incorrect anyway. -} - ExtSolContradiction -> emitInsoluble wi >> return Stop + ExtSolContradiction {} -> emitInsoluble wi >> return Stop ExtSolOk newWork -> do updWorkListTcS (extendWorkListEqs newWork) diff --git a/compiler/typecheck/TcTypeNats.hs b/compiler/typecheck/TcTypeNats.hs index 4038a54..b3e7721 100644 --- a/compiler/typecheck/TcTypeNats.hs +++ b/compiler/typecheck/TcTypeNats.hs @@ -734,8 +734,12 @@ data ExternalSolver = ExternalSolver data ExtSolRes - = ExtSolContradiction -- ^ There is no model for assertions - | ExtSolOk [Ct] -- ^ New work (facts that will hold in all models) + = ExtSolContradiction {- inconsistent -} [Ct] + {- all others -} [Ct] + -- ^ There is no model for assertions. + + | ExtSolOk [Ct] + -- ^ New work (facts that will hold in all models) -------------------------------------------------------------------------------- -- Concrete implementation @@ -940,7 +944,7 @@ solverNewWork :: SolverProcess -> IORef VarInfo solverNewWork proc viRef loc withEv = do status <- solverCheck proc case status of - Unsat -> return ExtSolContradiction + Unsat -> return $ ExtSolContradiction [] [] Unknown -> return (ExtSolOk []) Sat -> do m <- solverGetModel proc =<< readIORef viRef @@ -982,42 +986,77 @@ Assumes that either: solverImprove :: SolverProcess -> IORef VarInfo -> [Ct] -> IO ExtSolRes solverImprove proc viRef cts = - do push - (_,ours) <- solverPrepare proc viRef cts + do push -- declare variables + (others,ours) <- solverPrepare proc viRef cts case ours of - [] -> do pop + [] -> do pop -- declarations return (ExtSolOk []) + (oneOfOurs,_) : _ -> - do mapM_ (assume . snd) ours - let loc = ctLoc oneOfOurs -- XXX: What is a better location? - - -- XXX: When we compute improvements, - -- we should probably limit ourselves to compute improvements - -- only for the variables in the current scope. - -- XXX: This might be a good idea for wanteds, but not givens: - -- assumptions in a later scope, may give us facts about - -- givens in earlier scopes. - res <- solverNewWork proc viRef loc (isGivenCt oneOfOurs) + do push + mapM_ (assume . snd) ours + status <- check pop + + res <- + case status of + + -- Inconsistent: find a smaller example, then stop. + Unsat -> + do mbRes <- solverFindConstraidction proc viRef others ours + case mbRes of + Nothing -> + fail "Bug: Failed to reporoduce contradiciton." + Just (core,rest) -> + return $ ExtSolContradiction core rest + + -- We don't know: treat as consistent. + Unknown -> return (ExtSolOk []) + + -- Consistent: try to compute derived work. + Sat -> + do m <- solverGetModel proc =<< readIORef viRef + imps <- solverImproveModel proc viRef m + vi <- readIORef viRef + + let loc = ctLoc oneOfOurs -- XXX: Better location? + withEv = isGivenCt oneOfOurs + toCt (x,e) = + do tv <- Map.lookup x (smtDeclaredVars vi) + ty <- sExprToType vi e + return $ mkNonCanonical + $ mkNewFact loc withEv (mkTyVarTy tv, ty) + return $ ExtSolOk $ mapMaybe toCt imps + + pop -- declarations return res where - push = solverPush proc viRef - pop = solverPop proc viRef - assume = solverAssume proc + push = solverPush proc viRef + pop = solverPop proc viRef + assume = solverAssume proc + check = solverCheck proc -{- Given a set of constraints, try to split them into: +{- Identify a sub-set of constraints that leads to a contradiction. - (constraints that lead to a contradiction, all the others) +We call this when we find out that a collection of constraints is +inconsistent: instead of marking them _all_ as insoluable, +we identify a sub-set that is the real cause of the problem. -Does not change the assertion state of the solver. +* Assumes that the variables in our constarints have been declared. +* Does not change the assertions in the solver. -} - -solverFindConstraidction :: SolverProcess -> IORef VarInfo -> - [Ct] -> IO (Maybe ([Ct], [Ct])) -solverFindConstraidction proc viRef cts = +solverFindConstraidction :: + SolverProcess -> -- Solver + IORef VarInfo -> -- Scoping of variables + [Ct] -> -- Constraints not relevant to us + [(Ct,SExpr)] -> -- Our constraints + IO (Maybe ( [Ct] -- Constraints that cause a contradiciotn + , [Ct] -- All other constraints (both others and ours) + ) + ) +solverFindConstraidction proc viRef others ours = do push -- scope for `needed` - (others,ours) <- solverPrepare proc viRef cts -- declare vars minimize others [] ours where @@ -1056,6 +1095,7 @@ solverFindConstraidction proc viRef cts = + solverSimplify :: SolverProcess -> IORef VarInfo -> [Ct] -> IO ([(EvTerm,Ct)], [Ct]) solverSimplify proc viRef cts = From git at git.haskell.org Sun May 11 02:36:35 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 11 May 2014 02:36:35 +0000 (UTC) Subject: [commit: ghc] wip/ext-solver: Comment only. (581859b) Message-ID: <20140511023635.DA3BF2406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ext-solver Link : http://ghc.haskell.org/trac/ghc/changeset/581859b7011001d54012369a37c06356735f4720/ghc >--------------------------------------------------------------- commit 581859b7011001d54012369a37c06356735f4720 Author: Iavor S. Diatchki Date: Sat May 10 15:16:12 2014 -0700 Comment only. >--------------------------------------------------------------- 581859b7011001d54012369a37c06356735f4720 compiler/typecheck/TcTypeNats.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/compiler/typecheck/TcTypeNats.hs b/compiler/typecheck/TcTypeNats.hs index b3e7721..0b586e4 100644 --- a/compiler/typecheck/TcTypeNats.hs +++ b/compiler/typecheck/TcTypeNats.hs @@ -1095,7 +1095,9 @@ solverFindConstraidction proc viRef others ours = - +{- Try to solve as much as possible from the given list of constraints. +Returns the solved constraints (with evidence), and all other constraints. +-} solverSimplify :: SolverProcess -> IORef VarInfo -> [Ct] -> IO ([(EvTerm,Ct)], [Ct]) solverSimplify proc viRef cts = From git at git.haskell.org Sun May 11 02:36:38 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 11 May 2014 02:36:38 +0000 (UTC) Subject: [commit: ghc] wip/ext-solver: Remove external solver stage. (6fd6415) Message-ID: <20140511023638.80AD72406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ext-solver Link : http://ghc.haskell.org/trac/ghc/changeset/6fd6415cbab0bd4aba3ddbb9ab7673cfc95dad26/ghc >--------------------------------------------------------------- commit 6fd6415cbab0bd4aba3ddbb9ab7673cfc95dad26 Author: Iavor S. Diatchki Date: Sat May 10 15:16:40 2014 -0700 Remove external solver stage. >--------------------------------------------------------------- 6fd6415cbab0bd4aba3ddbb9ab7673cfc95dad26 compiler/typecheck/TcInteract.lhs | 71 ++------------------------------------- 1 file changed, 2 insertions(+), 69 deletions(-) diff --git a/compiler/typecheck/TcInteract.lhs b/compiler/typecheck/TcInteract.lhs index 353dad6..b8c4c81 100644 --- a/compiler/typecheck/TcInteract.lhs +++ b/compiler/typecheck/TcInteract.lhs @@ -223,43 +223,10 @@ React with (F Int ~ b) ==> IR Stop True [] -- after substituting we re-canoni thePipeline :: [(String,SimplifierStage)] thePipeline = [ ("canonicalization", TcCanonical.canonicalize) , ("interact with inerts", interactWithInertsStage) - , ("top-level reactions", topReactionsStage) - , ("external solver", externalSolverStage) ] + , ("top-level reactions", topReactionsStage) ] \end{code} -******************************************************************************** -* -* External Solver -* -******************************************************************************** - -\begin{code} -externalSolverStage :: WorkItem -> TcS StopOrContinue -externalSolverStage wi = - do mb <- extSolProve wi - case mb of - Just ev -> - do when (isWantedCt wi) $ setEvBind (ctEvId $ ctEvidence wi) ev - return Stop - Nothing -> - do res <- extSolAssume wi -- Remember for later - case res of - -{- Perhaps we should remove constraints that lead to a contadiction? - As is, all constraints in this scope will be discarded (solved trivially). - This seems OK: after all, the program is incorrect anyway. -} - ExtSolContradiction {} -> emitInsoluble wi >> return Stop - - ExtSolOk newWork -> - do updWorkListTcS (extendWorkListEqs newWork) - return (ContinueWith wi) -\end{code} - - - - - ********************************************************************************* * * The interact-with-inert Stage @@ -723,41 +690,7 @@ interactTyVarEq inerts workItem@(CTyEqCan { cc_tyvar = tv, cc_rhs = rhs , cc_ev ; return (Nothing, True) } | otherwise - = do { _ <- extSolAssume workItem - {- XXX: This is not correct in two ways: - 1. The kicked-out constraints are not purged from the external - solver! Thus, when they go around the solver loop, they will - be "solved" in terms of themselves. Clearly wrong. - - 2. Even if we could remove them from the external solver, - we are not "kicking-out" enough constraints. Consider, - the following example: - - A: [W] 1 <=? x ~ True - B: [W] 1 + n ~ x - - If we process them in this order (A first, then B), then we - can't solve either constraint. - If we reverse their order (i.e., B first, then A), then - we can solve `A` because we have more information about `x`. - - In other words, in this case `B` should have kicked-out `A`. - - I think that both of these problems will be avoided, if - we moved the external solver outside of the pipeline, like this: - - Let GHC process constraints until they are "inert". - - Extract inert constraints relevant to the external solver, - and compute "improvements" (i.e., extra equalities). - - If there were additional equalities, add them to the work - queue and let GHC process things again until they are inert. - - This can be repeated a few times, but it will eventually - stop, as the external solver will run out of equalities to - find (this is bound by the number of variables in scope) - - Finally, the external solver can be run to solve - any inert wanted constraintsthat it knows about. - -} - - ; mb_solved <- trySpontaneousSolve ev tv rhs + = do { mb_solved <- trySpontaneousSolve ev tv rhs ; case mb_solved of SPCantSolve -- Includes givens -> do { untch <- getUntouchables From git at git.haskell.org Sun May 11 02:36:41 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 11 May 2014 02:36:41 +0000 (UTC) Subject: [commit: ghc] wip/ext-solver: Change the external-solver interface to work with collections of constraints (958be46) Message-ID: <20140511023641.2D3CB2406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ext-solver Link : http://ghc.haskell.org/trac/ghc/changeset/958be46d6d01418bef37dd600257523df2f01a87/ghc >--------------------------------------------------------------- commit 958be46d6d01418bef37dd600257523df2f01a87 Author: Iavor S. Diatchki Date: Sat May 10 15:44:17 2014 -0700 Change the external-solver interface to work with collections of constraints >--------------------------------------------------------------- 958be46d6d01418bef37dd600257523df2f01a87 compiler/typecheck/TcSMonad.lhs | 14 ++++--- compiler/typecheck/TcTypeNats.hs | 91 ++++++++++++++-------------------------- 2 files changed, 41 insertions(+), 64 deletions(-) diff --git a/compiler/typecheck/TcSMonad.lhs b/compiler/typecheck/TcSMonad.lhs index 7c67d27..903a906 100644 --- a/compiler/typecheck/TcSMonad.lhs +++ b/compiler/typecheck/TcSMonad.lhs @@ -83,7 +83,8 @@ module TcSMonad ( Untouchables, isTouchableMetaTyVarTcS, isFilledMetaTyVar_maybe, zonkTyVarsAndFV, - TN.ExtSolRes(..), extSolAssume, extSolProve, extSolPush, extSolPop, + TN.ExtSolRes(..), + extSolAssert, extSolImprove, extSolSolve, extSolPush, extSolPop, getDefaultInfo, getDynFlags, getGlobalRdrEnvTcS, @@ -1923,11 +1924,14 @@ Interaction with an External SMT Solver --------------------------------------- \begin{code} -extSolAssume :: Ct -> TcS TN.ExtSolRes -extSolAssume ct = withExtSol (\s -> TN.extSolAssume s ct) +extSolAssert :: [Ct] -> TcS () +extSolAssert ct = withExtSol (`TN.extSolAssert` ct) -extSolProve :: Ct -> TcS (Maybe EvTerm) -extSolProve ct = withExtSol (\s -> TN.extSolProve s ct) +extSolImprove :: [Ct] -> TcS TN.ExtSolRes +extSolImprove ct = withExtSol (`TN.extSolImprove` ct) + +extSolSolve :: [Ct] -> TcS ([(EvTerm,Ct)], [Ct]) +extSolSolve ct = withExtSol (`TN.extSolSolve` ct) extSolPush :: TcS () extSolPush = withExtSol TN.extSolPush diff --git a/compiler/typecheck/TcTypeNats.hs b/compiler/typecheck/TcTypeNats.hs index 0b586e4..1468bba 100644 --- a/compiler/typecheck/TcTypeNats.hs +++ b/compiler/typecheck/TcTypeNats.hs @@ -724,14 +724,30 @@ genLog x base = Just (exactLoop 0 x) -- Interface data ExternalSolver = ExternalSolver - { extSolPush :: IO () -- ^ Mark current set of assumptions - , extSolPop :: IO () -- ^ Revert to the last marked place - , extSolAssume :: Ct -> IO ExtSolRes -- ^ Add a new fact. - , extSolProve :: Ct -> IO (Maybe EvTerm) -- ^ Try to prove this - , extSolStop :: IO () -- ^ Exit the solver - } + { extSolPush :: IO () + -- ^ Mark current set of assumptions. + -- Does not change assertions. + + , extSolPop :: IO () + -- ^ Revert to the last marked place. + -- Changes assertions. + + , extSolAssert :: [Ct] -> IO () + -- ^ Add some assertions. + -- Changes assertions. + , extSolImprove :: [Ct] -> IO ExtSolRes + -- ^ Check for consistency and new work. + -- Does not change assertions. + , extSolSolve :: [Ct] -> IO ([(EvTerm,Ct)], [Ct]) + -- ^ Solve some constraints. + -- Does not change assertions. + + , extSolStop :: IO () + -- ^ Exit the solver. + -- The solver should not be used after this is called. + } data ExtSolRes = ExtSolContradiction {- inconsistent -} [Ct] @@ -760,44 +776,21 @@ newExternalSolver exe opts = { extSolPush = do solverDebug proc "=== PUSH ===" solverDebugNext proc solverPush proc viRef + , extSolPop = do solverDebugPrev proc solverDebug proc "=== POP ===" solverPop proc viRef - , extSolAssume = \ct -> - case knownCt ct of - Nothing -> return (ExtSolOk []) - Just (vars,expr) -> - debugStage proc ("assume: " ++ renderSExpr expr "") $ - do mapM_ (solverDeclare proc viRef) (eltsUFM vars) - solverAssume proc expr - solverNewWork proc viRef (ctLoc ct) (isGivenCt ct) - - , extSolProve = \ct -> - case knownCt ct of - Nothing -> return Nothing - Just (vars,expr) -> - debugStage proc ("prove: " ++ renderSExpr expr "") $ - do mapM_ (solverDeclare proc viRef) (eltsUFM vars) - proved <- solverProve proc viRef expr - if proved - then do solverDebug proc "proved" - return $ Just $ evBySMT "SMT" - $ getEqPredTys $ ctPred ct - else return Nothing - - , extSolStop = solverStop proc - } + , extSolAssert = \cts -> + do (_,ours) <- solverPrepare proc viRef cts + mapM_ (solverAssume proc . snd) ours -debugStage :: SolverProcess -> String -> IO a -> IO a -debugStage proc x m = - do solverDebug proc x - solverDebugNext proc - res <- m - solverDebugPrev proc - return res + , extSolImprove = solverImprove proc viRef + , extSolSolve = solverSimplify proc viRef + , extSolStop = solverStop proc + } mkNewFact :: CtLoc -> Bool -> (Type,Type) -> CtEvidence mkNewFact newLoc withEv (t1,t2) @@ -936,26 +929,6 @@ solverImproveModel proc viRef imps = then varEq x ((x, e) : imps) more ys else varEq x imps (def : more) ys --- Examine the current state of the solver and compute new work. -solverNewWork :: SolverProcess -> IORef VarInfo - -> CtLoc -- Source of the new constraints - -> Bool -- Should generate givens? - -> IO ExtSolRes -solverNewWork proc viRef loc withEv = - do status <- solverCheck proc - case status of - Unsat -> return $ ExtSolContradiction [] [] - Unknown -> return (ExtSolOk []) - Sat -> - do m <- solverGetModel proc =<< readIORef viRef - imps <- solverImproveModel proc viRef m - vi <- readIORef viRef - let toCt (x,e) = do tv <- Map.lookup x (smtDeclaredVars vi) - ty <- sExprToType vi e - return $ mkNonCanonical - $ mkNewFact loc withEv (mkTyVarTy tv, ty) - return $ ExtSolOk $ mapMaybe toCt imps - -------------------------------------------------------------------------------- -- Higher level operations on collections of constraints. @@ -983,8 +956,7 @@ Assumes that either: * all constraints are given, or * all are not given. -} -solverImprove :: SolverProcess -> IORef VarInfo - -> [Ct] -> IO ExtSolRes +solverImprove :: SolverProcess -> IORef VarInfo -> [Ct] -> IO ExtSolRes solverImprove proc viRef cts = do push -- declare variables (others,ours) <- solverPrepare proc viRef cts @@ -1124,6 +1096,7 @@ solverSimplify proc viRef cts = else do assume e -- add to `unsolved` go (ct : unsolved) solved more +-------------------------------------------------------------------------------- smtTy :: Ty -> SExpr smtTy ty = From git at git.haskell.org Sun May 11 02:36:43 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 11 May 2014 02:36:43 +0000 (UTC) Subject: [commit: ghc] wip/ext-solver: Interaction with external solver (not connected to GHC's solver) (9be9110) Message-ID: <20140511023643.BDA7B2406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ext-solver Link : http://ghc.haskell.org/trac/ghc/changeset/9be9110e9643d8c3d99ed5219015e07ce2c34b72/ghc >--------------------------------------------------------------- commit 9be9110e9643d8c3d99ed5219015e07ce2c34b72 Author: Iavor S. Diatchki Date: Sat May 10 16:41:56 2014 -0700 Interaction with external solver (not connected to GHC's solver) >--------------------------------------------------------------- 9be9110e9643d8c3d99ed5219015e07ce2c34b72 compiler/typecheck/TcInteract.lhs | 63 +++++++++++++++++++++++++++++++++++++++ compiler/typecheck/TcSMonad.lhs | 5 ++-- compiler/typecheck/TcTypeNats.hs | 20 +++++-------- 3 files changed, 74 insertions(+), 14 deletions(-) diff --git a/compiler/typecheck/TcInteract.lhs b/compiler/typecheck/TcInteract.lhs index b8c4c81..808c108 100644 --- a/compiler/typecheck/TcInteract.lhs +++ b/compiler/typecheck/TcInteract.lhs @@ -132,6 +132,69 @@ solveInteract cts NextWorkItem ct -- More work, loop around! -> do { runSolverPipeline thePipeline ct; solve_loop max_depth } } +inertactExternSolver :: Bool -- ^ Are we in given stage? + -> TcS Bool -- ^ Did we generatew new work. +inertactExternSolver inGivenStage = + do iSet <- getTcSInerts + let iCans = inert_cans iSet + feqs = funEqsToList (inert_funeqs iCans) + + {- `survived` should be a sub-set of the inert funeqs. + This function rebuilds the inert set, when we need to + kick-out some constraint (e.g., because they were solved, or + caused a contradiciton. -} + + rebuildInerts survived = + do let new_feqs = foldr addCt emptyFunEqs survived + new_iCans = iCans { inert_funeqs = new_feqs } + setTcSInerts iSet { inert_cans = new_iCans } + + res <- extSolImprove inGivenStage feqs + case res of + + -- Kick-out constraints that lead to a contradiciton + -- and add them as insoluable. + ExtSolContradiction bad_feqs ok_feqs -> + do rebuildInerts ok_feqs + mapM_ emitInsoluble bad_feqs + return False + + -- Consistent, and no more work. + ExtSolOk [] + + -- Assert the givens in the solver, so that they will be used + -- when we solve the wanteds (and nested implications). + | inGivenStage -> + do extSolAssert feqs + return False + + -- During the wanted stage, we try to solve the constraints + -- once there is no more additional work for re-writing. + | otherwise -> + do (solved, unsolved) <- extSolSolve feqs + case solved of + [] -> return False -- Shortcut for common case. + _ -> do rebuildInerts unsolved + let setEv (ev,ct) + | isWantedCt ct = + setEvBind (ctev_evar (cc_ev ct)) ev + | otherwise = return () + mapM_ setEv solved + return False + + -- We added some new work, so we should keep going. + ExtSolOk newWork -> + do updWorkListTcS (extendWorkListEqs newWork) + return True + + where + addCt ct mp = + case ct of + CFunEqCan { cc_fun = tc, cc_tyargs = tys } -> addFunEq mp tc tys ct + _ -> mp -- Should not happend + + + type WorkItem = Ct type SimplifierStage = WorkItem -> TcS StopOrContinue diff --git a/compiler/typecheck/TcSMonad.lhs b/compiler/typecheck/TcSMonad.lhs index 903a906..259ce2d 100644 --- a/compiler/typecheck/TcSMonad.lhs +++ b/compiler/typecheck/TcSMonad.lhs @@ -75,6 +75,7 @@ module TcSMonad ( findFunEq, findTyEqs, findDict, findDictsByClass, addDict, addDictsByClass, delDict, partitionDicts, findFunEqsByTyCon, findFunEqs, addFunEq, replaceFunEqs, partitionFunEqs, + emptyFunEqs, funEqsToList, instDFunType, -- Instantiation newFlexiTcSTy, instFlexiTcS, instFlexiTcSHelperTcS, @@ -1927,8 +1928,8 @@ Interaction with an External SMT Solver extSolAssert :: [Ct] -> TcS () extSolAssert ct = withExtSol (`TN.extSolAssert` ct) -extSolImprove :: [Ct] -> TcS TN.ExtSolRes -extSolImprove ct = withExtSol (`TN.extSolImprove` ct) +extSolImprove :: Bool -> [Ct] -> TcS TN.ExtSolRes +extSolImprove withEv ct = withExtSol (\s -> TN.extSolImprove s withEv ct) extSolSolve :: [Ct] -> TcS ([(EvTerm,Ct)], [Ct]) extSolSolve ct = withExtSol (`TN.extSolSolve` ct) diff --git a/compiler/typecheck/TcTypeNats.hs b/compiler/typecheck/TcTypeNats.hs index 1468bba..9d498ba 100644 --- a/compiler/typecheck/TcTypeNats.hs +++ b/compiler/typecheck/TcTypeNats.hs @@ -12,7 +12,7 @@ import TcEvidence ( mkTcAxiomRuleCo, EvTerm(..) ) import TyCon ( TyCon, SynTyConRhs(..), mkSynTyCon, TyConParent(..) ) import Coercion ( Role(..) ) import TcRnTypes ( Xi, Ct(..), ctPred, CtEvidence(..), mkNonCanonical - , isGivenCt, CtLoc, ctLoc ) + , CtLoc, ctLoc ) import CoAxiom ( CoAxiomRule(..), BuiltInSynFamily(..) ) import Name ( Name, BuiltInSyntax(..), nameOccName, nameUnique ) import OccName ( occNameString ) @@ -736,7 +736,7 @@ data ExternalSolver = ExternalSolver -- ^ Add some assertions. -- Changes assertions. - , extSolImprove :: [Ct] -> IO ExtSolRes + , extSolImprove :: Bool -> [Ct] -> IO ExtSolRes -- ^ Check for consistency and new work. -- Does not change assertions. @@ -952,12 +952,13 @@ solverPrepare proc viRef = go [] [] {- Check a list of constraints for consistency, and computer derived work. Does not affect set off assertions in the solver. -Assumes that either: - * all constraints are given, or - * all are not given. -} -solverImprove :: SolverProcess -> IORef VarInfo -> [Ct] -> IO ExtSolRes -solverImprove proc viRef cts = +solverImprove :: SolverProcess -> IORef VarInfo + -> Bool -- ^ Should we generate given constraints? + -- If not, we generate derived ones. + -> [Ct] + -> IO ExtSolRes +solverImprove proc viRef withEv cts = do push -- declare variables (others,ours) <- solverPrepare proc viRef cts case ours of @@ -992,7 +993,6 @@ solverImprove proc viRef cts = vi <- readIORef viRef let loc = ctLoc oneOfOurs -- XXX: Better location? - withEv = isGivenCt oneOfOurs toCt (x,e) = do tv <- Map.lookup x (smtDeclaredVars vi) ty <- sExprToType vi e @@ -1140,10 +1140,6 @@ type VarTypes = UniqFM (TyVar,String,Ty) knownCt :: Ct -> Maybe (VarTypes, SExpr) knownCt ct = case ct of - CTyEqCan _ x xi -> - do (vs1,e1) <- knownVar x - (vs2,e2) <- knownXi xi - return (plusUFM vs1 vs2, smtEq e1 e2) CFunEqCan _ f args rhs -> do (vs1,e1) <- knownTerm f args (vs2,e2) <- knownXi rhs From git at git.haskell.org Sun May 11 02:36:46 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 11 May 2014 02:36:46 +0000 (UTC) Subject: [commit: ghc] wip/ext-solver: Bugfix: Pop model assumptions AFTER we're done with improvements. (bad08fd) Message-ID: <20140511023646.5BEF02406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ext-solver Link : http://ghc.haskell.org/trac/ghc/changeset/bad08fd9dffea4deb1f82b48857291f204939077/ghc >--------------------------------------------------------------- commit bad08fd9dffea4deb1f82b48857291f204939077 Author: Iavor S. Diatchki Date: Sat May 10 19:34:57 2014 -0700 Bugfix: Pop model assumptions AFTER we're done with improvements. >--------------------------------------------------------------- bad08fd9dffea4deb1f82b48857291f204939077 compiler/typecheck/TcTypeNats.hs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/compiler/typecheck/TcTypeNats.hs b/compiler/typecheck/TcTypeNats.hs index 9d498ba..043cb11 100644 --- a/compiler/typecheck/TcTypeNats.hs +++ b/compiler/typecheck/TcTypeNats.hs @@ -969,14 +969,14 @@ solverImprove proc viRef withEv cts = do push mapM_ (assume . snd) ours status <- check - pop res <- case status of -- Inconsistent: find a smaller example, then stop. Unsat -> - do mbRes <- solverFindConstraidction proc viRef others ours + do pop + mbRes <- solverFindConstraidction proc viRef others ours case mbRes of Nothing -> fail "Bug: Failed to reporoduce contradiciton." @@ -984,12 +984,16 @@ solverImprove proc viRef withEv cts = return $ ExtSolContradiction core rest -- We don't know: treat as consistent. - Unknown -> return (ExtSolOk []) + Unknown -> do pop + return (ExtSolOk []) -- Consistent: try to compute derived work. Sat -> do m <- solverGetModel proc =<< readIORef viRef + imps <- solverImproveModel proc viRef m + pop + vi <- readIORef viRef let loc = ctLoc oneOfOurs -- XXX: Better location? From git at git.haskell.org Sun May 11 02:36:48 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 11 May 2014 02:36:48 +0000 (UTC) Subject: [commit: ghc] wip/ext-solver: Connect with GHC's solver + debugging. (b8693a4) Message-ID: <20140511023648.EE6422406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ext-solver Link : http://ghc.haskell.org/trac/ghc/changeset/b8693a426cd66cc7b470a32e7595d85e11d47efe/ghc >--------------------------------------------------------------- commit b8693a426cd66cc7b470a32e7595d85e11d47efe Author: Iavor S. Diatchki Date: Sat May 10 19:35:37 2014 -0700 Connect with GHC's solver + debugging. >--------------------------------------------------------------- b8693a426cd66cc7b470a32e7595d85e11d47efe compiler/typecheck/TcInteract.lhs | 21 ++++++++++++++------- compiler/typecheck/TcTypeNats.hs | 39 +++++++++++++++++++++++++++++++-------- 2 files changed, 45 insertions(+), 15 deletions(-) diff --git a/compiler/typecheck/TcInteract.lhs b/compiler/typecheck/TcInteract.lhs index 808c108..bad7bf5 100644 --- a/compiler/typecheck/TcInteract.lhs +++ b/compiler/typecheck/TcInteract.lhs @@ -85,9 +85,9 @@ solveInteractGiven loc old_fsks givens | null givens -- Shortcut for common case = return (True, old_fsks) | otherwise - = do { implics1 <- solveInteract fsk_bag + = do { implics1 <- solveInteractWithExtern True fsk_bag - ; (no_eqs, more_fsks, implics2) <- getGivenInfo (solveInteract given_bag) + ; (no_eqs, more_fsks, implics2) <- getGivenInfo (solveInteractWithExtern True given_bag) ; MASSERT( isEmptyBag implics1 && isEmptyBag implics2 ) -- empty implics because we discard Given equalities between -- foralls (see Note [Do not decompose given polytype equalities] @@ -112,11 +112,16 @@ solveInteractGiven loc old_fsks givens -- The main solver loop implements Note [Basic Simplifier Plan] --------------------------------------------------------------- + solveInteract :: Cts -> TcS (Bag Implication) +solveInteract = solveInteractWithExtern False + +solveInteractWithExtern :: Bool -- ^ Are we in the given stage? + -> Cts -> TcS (Bag Implication) -- Returns the final InertSet in TcS -- Has no effect on work-list or residual-iplications -solveInteract cts - = {-# SCC "solveInteract" #-} +solveInteractWithExtern inGivenStage cts + = {-# SCC "solveInteractWithExtern" #-} withWorkList cts $ do { dyn_flags <- getDynFlags ; solve_loop (maxSubGoalDepth dyn_flags) } @@ -126,15 +131,17 @@ solveInteract cts do { sel <- selectNextWorkItem max_depth ; case sel of NoWorkRemaining -- Done, successfuly (modulo frozen) - -> return () + -> do moreWork <- interactExternSolver inGivenStage + if moreWork then solve_loop max_depth + else return () MaxDepthExceeded cnt ct -- Failure, depth exceeded -> wrapErrTcS $ solverDepthErrorTcS cnt (ctEvidence ct) NextWorkItem ct -- More work, loop around! -> do { runSolverPipeline thePipeline ct; solve_loop max_depth } } -inertactExternSolver :: Bool -- ^ Are we in given stage? +interactExternSolver :: Bool -- ^ Are we in given stage? -> TcS Bool -- ^ Did we generatew new work. -inertactExternSolver inGivenStage = +interactExternSolver inGivenStage = do iSet <- getTcSInerts let iCans = inert_cans iSet feqs = funEqsToList (inert_funeqs iCans) diff --git a/compiler/typecheck/TcTypeNats.hs b/compiler/typecheck/TcTypeNats.hs index 043cb11..0a1757e 100644 --- a/compiler/typecheck/TcTypeNats.hs +++ b/compiler/typecheck/TcTypeNats.hs @@ -54,7 +54,8 @@ import Control.Monad (forever) import Control.Concurrent ( forkIO ) import qualified Control.Exception as X import System.Process ( runInteractiveProcess, waitForProcess ) -import System.IO ( hPutStrLn, hFlush, hGetContents, hGetLine ) +import System.IO ( hPutStrLn, hFlush, hGetContents, hGetLine, + stderr ) {------------------------------------------------------------------------------- Built-in type constructors for functions on type-lelve nats @@ -772,22 +773,28 @@ newExternalSolver exe opts = -- See Note [Variable Scopes] for an explanation of this. viRef <- newIORef emptyVarInfo + let dbg = solverDebug proc + return ExternalSolver - { extSolPush = do solverDebug proc "=== PUSH ===" + { extSolPush = do dbg "=== PUSH ===" solverDebugNext proc solverPush proc viRef , extSolPop = do solverDebugPrev proc - solverDebug proc "=== POP ===" + dbg "=== POP ===" solverPop proc viRef , extSolAssert = \cts -> - do (_,ours) <- solverPrepare proc viRef cts + do dbg "=== ASSERT ===" + (_,ours) <- solverPrepare proc viRef cts mapM_ (solverAssume proc . snd) ours + mapM_ (solverDebug proc . show . snd) ours - , extSolImprove = solverImprove proc viRef + , extSolImprove = \b cts -> do dbg "=== IMPROVE ===" + solverImprove proc viRef b cts - , extSolSolve = solverSimplify proc viRef + , extSolSolve = \cts -> do dbg "=== SOLVE ===" + solverSimplify proc viRef cts , extSolStop = solverStop proc } @@ -871,6 +878,7 @@ solverCheck proc = -- Prove something by concluding that a counter-example is impossible. solverProve :: SolverProcess -> IORef VarInfo -> SExpr -> IO Bool solverProve proc viRef e = + debug $ do solverPush proc viRef solverAssume proc $ SList [ SAtom "not", e ] res <- solverCheck proc @@ -879,6 +887,14 @@ solverProve proc viRef e = Unsat -> return True _ -> return False + where + debug m = do solverDebug proc ("Prove: " ++ show e) + solverDebugNext proc + res <- m + solverDebug proc (show res) + solverDebugPrev proc + return res + -- Get values for the variables that are in scope. solverGetModel :: SolverProcess -> VarInfo -> IO [(String,SExpr)] solverGetModel proc vi = @@ -1091,7 +1107,11 @@ solverSimplify proc viRef cts = go unsolved solved ((ct,e) : more) = do push -- Temporarily assume everything else. + solverDebug proc "Temporary assuming:" + solverDebugNext proc mapM_ (assume . snd) more + mapM_ (solverDebug proc . show . snd) more + solverDebugPrev proc proved <- solverProve proc viRef e pop if proved @@ -1295,6 +1315,9 @@ declareVar tv vi data SExpr = SAtom String | SList [SExpr] deriving Eq +instance Show SExpr where + showsPrec _ = renderSExpr + data SolverProcess = SolverProcess { solverDo :: SExpr -> IO SExpr , solverStop :: IO () @@ -1310,8 +1333,8 @@ startSolverProcess exe opts = do (hIn, hOut, hErr, h) <- runInteractiveProcess exe opts Nothing Nothing dbgNest <- newIORef (0 :: Int) - let dbgMsg x = return () {- do n <- readIORef dbgNest - putStrLn (replicate n ' ' ++ x) -} + let dbgMsg x = do n <- readIORef dbgNest + hPutStrLn stderr (replicate n ' ' ++ x) dbgNext = modifyIORef' dbgNest (+2) dbgPrev = modifyIORef' dbgNest (subtract 2) From git at git.haskell.org Sun May 11 15:53:25 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 11 May 2014 15:53:25 +0000 (UTC) Subject: [commit: ghc] wip/ext-solver: Simplify interaction with solver. (dd41854) Message-ID: <20140511155325.A21752406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ext-solver Link : http://ghc.haskell.org/trac/ghc/changeset/dd418548b3970c4616280d42b9df19796f6a2c3b/ghc >--------------------------------------------------------------- commit dd418548b3970c4616280d42b9df19796f6a2c3b Author: Iavor S. Diatchki Date: Sun May 11 08:25:07 2014 -0700 Simplify interaction with solver. It appears that pushing and poping does work as expected (i.e., it affects both assertions and declarations). The issue previously was that I was using `(push)` instead of `(push 1)`. While Yices rejects the first, CVC4 accepts it, but it looks like it treats it as `(push 0)`?? Either way, when we use `(push 1)`, everything seems to work as expected, so the machinery to emulate this behavior is not needed. >--------------------------------------------------------------- dd418548b3970c4616280d42b9df19796f6a2c3b compiler/typecheck/TcTypeNats.hs | 79 +++++++++++----------------------------- 1 file changed, 22 insertions(+), 57 deletions(-) diff --git a/compiler/typecheck/TcTypeNats.hs b/compiler/typecheck/TcTypeNats.hs index 0a1757e..a206236 100644 --- a/compiler/typecheck/TcTypeNats.hs +++ b/compiler/typecheck/TcTypeNats.hs @@ -41,8 +41,6 @@ import FastString ( FastString, fsLit ) import UniqFM ( UniqFM, emptyUFM, unitUFM, plusUFM, eltsUFM ) import Data.Map (Map) import qualified Data.Map as Map -import Data.Set (Set) -import qualified Data.Set as Set import Data.Maybe ( isJust, mapMaybe ) import Data.Char ( isSpace ) import Data.List ( unfoldr, foldl', partition ) @@ -50,7 +48,7 @@ import Data.IORef ( IORef, newIORef, atomicModifyIORef', atomicModifyIORef, modifyIORef' , readIORef ) -import Control.Monad (forever) +import Control.Monad ( forever, msum ) import Control.Concurrent ( forkIO ) import qualified Control.Exception as X import System.Process ( runInteractiveProcess, waitForProcess ) @@ -770,7 +768,6 @@ newExternalSolver exe opts = solverSimpleCmd proc [ "set-option", ":produce-models", "true" ] solverSimpleCmd proc [ "set-logic", "QF_LIA" ] - -- See Note [Variable Scopes] for an explanation of this. viRef <- newIORef emptyVarInfo let dbg = solverDebug proc @@ -832,13 +829,13 @@ solverSimpleCmd proc = solverAckCmd proc . SList . map SAtom -- Checkpoint state solverPush :: SolverProcess -> IORef VarInfo -> IO () solverPush proc viRef = - do solverSimpleCmd proc [ "push" ] + do solverSimpleCmd proc [ "push", "1" ] modifyIORef' viRef startScope -- Restore to last check-point solverPop :: SolverProcess -> IORef VarInfo -> IO () solverPop proc viRef = - do solverSimpleCmd proc [ "pop" ] + do solverSimpleCmd proc [ "pop", "1" ] modifyIORef' viRef endScope @@ -851,9 +848,7 @@ solverDeclare :: SolverProcess -> IORef VarInfo -> (TyVar, String, Ty) -> IO () solverDeclare proc viRef (tv,x,ty) = do status <- atomicModifyIORef' viRef (declareVar tv) case status of - Constrained -> return () - Declared -> - do mapM_ (solverAssume proc) (smtExtraConstraints x ty) + Declared -> return () Undeclared -> do solverAckCmd proc $ SList [SAtom "declare-fun", SAtom x, SList [], smtTy ty] @@ -1014,7 +1009,7 @@ solverImprove proc viRef withEv cts = let loc = ctLoc oneOfOurs -- XXX: Better location? toCt (x,e) = - do tv <- Map.lookup x (smtDeclaredVars vi) + do tv <- varToTyVar x vi ty <- sExprToType vi e return $ mkNonCanonical $ mkNewFact loc withEv (mkTyVarTy tv, ty) @@ -1222,7 +1217,7 @@ sExprToType vi expr = SAtom s | [(n,"")] <- reads s -> Just (num n) SAtom s - | Just v <- Map.lookup s (smtDeclaredVars vi) -> Just (mkTyVarTy v) + | Just v <- varToTyVar s vi -> Just (mkTyVarTy v) _ -> Nothing @@ -1230,49 +1225,24 @@ sExprToType vi expr = -------------------------------------------------------------------------------- -{- -Note [Variable Scopes] - -The SMTLIB format has an unfortunate "feature": push/pop commands affect -assertions but not variable declarations. So, if we declare a variable -after a push, then when we pop, all assertions about the variable will go away, -but not the variable declaration. - -This is particularly troublesome when variables have additional well-formedness -constraints that go beyond their type. In particular, we work with natural -numbers, while the basic type supported by a solver is integers. So, whenever -we declare a variable, we also add an additional assertion, constraining -the variable to be >= 0. - -Unfortunately, when we `pop` the well-formedness constraints are going -to go away, but not the variable declaration. So, if we want to mention -the variable again, in a new scope, then we have to add the additional -constraint but *not* add a declaration. - -Thus, a variable can be in one of three states: - 1. Declared and constrained - 2. Declared, but not constrained - 3. Not declared, and not constrained. --} - +-- Information about declared variables, so that we know how to extarct +-- models, and map them back into types. data VarInfo = VarInfo - { smtDeclaredVars :: Map String TyVar -- ^ all declared vars - , smtCurScope :: Set String -- ^ constrained - , smtOtherScopes :: [Set String] -- ^ constrained + { smtCurScope :: Map String TyVar + , smtOtherScopes :: [Map String TyVar] } emptyVarInfo :: VarInfo emptyVarInfo = VarInfo - { smtDeclaredVars = Map.empty - , smtCurScope = Set.empty + { smtCurScope = Map.empty , smtOtherScopes = [] } inScope :: VarInfo -> [String] -inScope vi = Set.toList $ Set.unions $ smtCurScope vi : smtOtherScopes vi +inScope vi = Map.keys $ Map.unions $ smtCurScope vi : smtOtherScopes vi startScope :: VarInfo -> VarInfo -startScope vi = vi { smtCurScope = Set.empty +startScope vi = vi { smtCurScope = Map.empty , smtOtherScopes = smtCurScope vi : smtOtherScopes vi } endScope :: VarInfo -> VarInfo @@ -1284,24 +1254,19 @@ endScope vi = , smtOtherScopes = ss } -data VarStatus = Undeclared | Declared | Constrained - --- | Update var info, and indicate what declaring we need to do. -declareVar :: TyVar -> VarInfo -> (VarInfo, VarStatus) -declareVar tv vi - | x `Set.member` smtCurScope vi = (vi, Constrained) +varToTyVar :: String -> VarInfo -> Maybe TyVar +varToTyVar x vi = msum $ map (Map.lookup x) $ smtCurScope vi : smtOtherScopes vi - | any (x `Set.member`) (smtOtherScopes vi) = (vi, Constrained) - | x `Map.member` smtDeclaredVars vi = - ( vi { smtCurScope = Set.insert x (smtCurScope vi) }, Declared ) +data VarStatus = Undeclared | Declared +-- | Update var info, and indicate if we need to declare the variable. +declareVar :: TyVar -> VarInfo -> (VarInfo, VarStatus) +declareVar tv vi + | x `Map.member` smtCurScope vi = (vi, Declared) + | any (x `Map.member`) (smtOtherScopes vi) = (vi, Declared) | otherwise = - ( vi { smtDeclaredVars = Map.insert x tv (smtDeclaredVars vi) - , smtCurScope = Set.insert x (smtCurScope vi) - } - , Undeclared - ) + ( vi { smtCurScope = Map.insert x tv (smtCurScope vi) }, Undeclared ) where x = thyVarName tv From git at git.haskell.org Sun May 11 15:53:28 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 11 May 2014 15:53:28 +0000 (UTC) Subject: [commit: ghc] wip/ext-solver: A comment showing a problem with `solverSimplify` and an idea on how to solve it. (cb9b93b) Message-ID: <20140511155329.06DAE2406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ext-solver Link : http://ghc.haskell.org/trac/ghc/changeset/cb9b93bd12937d83b5e6b7e9628b66d798b5edd2/ghc >--------------------------------------------------------------- commit cb9b93bd12937d83b5e6b7e9628b66d798b5edd2 Author: Iavor S. Diatchki Date: Sun May 11 08:53:14 2014 -0700 A comment showing a problem with `solverSimplify` and an idea on how to solve it. >--------------------------------------------------------------- cb9b93bd12937d83b5e6b7e9628b66d798b5edd2 compiler/typecheck/TcTypeNats.hs | 60 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/compiler/typecheck/TcTypeNats.hs b/compiler/typecheck/TcTypeNats.hs index a206236..5c52fa5 100644 --- a/compiler/typecheck/TcTypeNats.hs +++ b/compiler/typecheck/TcTypeNats.hs @@ -1085,6 +1085,66 @@ solverFindConstraidction proc viRef others ours = {- Try to solve as much as possible from the given list of constraints. Returns the solved constraints (with evidence), and all other constraints. -} +{- +Consider this example: + +ex4 :: p a -> p b -> p ((a + a) + b) -> p (2 * a + b) +ex4 _ = id + +A: a + a = u +B: x + b = v +C: 2 * a = w +D: w + b = v + +If we solve `B` or `D` first, then we are essnetially done, +as all the others can be substituted within each other. + +However, what if we happen to consider `C` first? + +(A,B,D) => C + +This goal is essentially: + +((a + a) + b ~ (2 * a) + b) => (a + a) ~ 2 * a + +which can be proved by cancelling `b` on both sides. + +Now, we are left with just `A,B,D`, which amounts to having +to prove: + +(a + a) + b ~ w + b + +We can't do this because we've lost the information about `w`. + + +Perhaps the answer is to solve all goals at the same time +(this also has the benefit of being more efficeint!). + +If we need to solve a collection of goals: + +A /\ B /\ C /\ D + +we look for a counter example, which amounts to finding a model for: + +not (A /\ B /\ C /\ D) + +If such a model does not exist, than we can solve all the goals. +If it does exits, then we can't solve all the golas, at which point +we could give up. + +Instead of giving up, it is nicer to try to identify a small +subset of all goals that can't be solved, to report a more +reasonable error. For example, if the goals were: + +(x = 2, a + 0 ~ a) + +We can't solve these togethere (there is no reason why `x` should be 2), +but we could solve the `a + 0 ~ a` part. +-} + + + + solverSimplify :: SolverProcess -> IORef VarInfo -> [Ct] -> IO ([(EvTerm,Ct)], [Ct]) solverSimplify proc viRef cts = From git at git.haskell.org Mon May 12 13:19:25 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 12 May 2014 13:19:25 +0000 (UTC) Subject: [commit: ghc] branch 'better-ho-cardinality' deleted Message-ID: <20140512131925.8240A2406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc Deleted branch: better-ho-cardinality From git at git.haskell.org Mon May 12 13:19:57 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 12 May 2014 13:19:57 +0000 (UTC) Subject: [commit: ghc] branch 'decision-procedure' deleted Message-ID: <20140512131957.C20D92406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc Deleted branch: decision-procedure From git at git.haskell.org Mon May 12 13:20:14 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 12 May 2014 13:20:14 +0000 (UTC) Subject: [commit: ghc] branch 'type-nats' deleted Message-ID: <20140512132014.7E8502406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc Deleted branch: type-nats From git at git.haskell.org Mon May 12 13:21:24 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 12 May 2014 13:21:24 +0000 (UTC) Subject: [commit: ghc] branch 'srcloc' deleted Message-ID: <20140512132124.74F9F2406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc Deleted branch: srcloc From git at git.haskell.org Mon May 12 13:21:33 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 12 May 2014 13:21:33 +0000 (UTC) Subject: [commit: ghc] branch 'real-src-loc-span' deleted Message-ID: <20140512132133.E6FFA2406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc Deleted branch: real-src-loc-span From git at git.haskell.org Mon May 12 13:21:45 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 12 May 2014 13:21:45 +0000 (UTC) Subject: [commit: ghc] branch 'cross-compiler-alienless' deleted Message-ID: <20140512132146.119C22406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc Deleted branch: cross-compiler-alienless From git at git.haskell.org Mon May 12 13:21:56 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 12 May 2014 13:21:56 +0000 (UTC) Subject: [commit: ghc] branch 'new-demand-to-merge' deleted Message-ID: <20140512132156.834182406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc Deleted branch: new-demand-to-merge From git at git.haskell.org Mon May 12 13:22:06 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 12 May 2014 13:22:06 +0000 (UTC) Subject: [commit: ghc] branch 'silent-sc-args' deleted Message-ID: <20140512132206.9B7872406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc Deleted branch: silent-sc-args From git at git.haskell.org Mon May 12 13:22:16 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 12 May 2014 13:22:16 +0000 (UTC) Subject: [commit: ghc] branch 'ghc-defer' deleted Message-ID: <20140512132216.2F6EC2406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc Deleted branch: ghc-defer From git at git.haskell.org Mon May 12 13:22:24 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 12 May 2014 13:22:24 +0000 (UTC) Subject: [commit: ghc] branch 'profiling' deleted Message-ID: <20140512132224.CA0172406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc Deleted branch: profiling From git at git.haskell.org Mon May 12 13:22:34 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 12 May 2014 13:22:34 +0000 (UTC) Subject: [commit: ghc] branch 'known-key-serialization' deleted Message-ID: <20140512132234.3A9112406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc Deleted branch: known-key-serialization From git at git.haskell.org Mon May 12 13:22:46 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 12 May 2014 13:22:46 +0000 (UTC) Subject: [commit: ghc] branch 'ghc-constraint-solver' deleted Message-ID: <20140512132246.55CAE2406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc Deleted branch: ghc-constraint-solver From git at git.haskell.org Mon May 12 13:22:57 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 12 May 2014 13:22:57 +0000 (UTC) Subject: [commit: ghc] branch 'ghc-new-co' deleted Message-ID: <20140512132257.4D71D2406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc Deleted branch: ghc-new-co From git at git.haskell.org Mon May 12 13:23:05 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 12 May 2014 13:23:05 +0000 (UTC) Subject: [commit: ghc] branch 'unboxed-tuple-arguments' deleted Message-ID: <20140512132306.420962406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc Deleted branch: unboxed-tuple-arguments From git at git.haskell.org Mon May 12 13:23:15 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 12 May 2014 13:23:15 +0000 (UTC) Subject: [commit: ghc] branch 'imp-param-class' deleted Message-ID: <20140512132315.E8B202406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc Deleted branch: imp-param-class From git at git.haskell.org Mon May 12 13:23:24 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 12 May 2014 13:23:24 +0000 (UTC) Subject: [commit: ghc] branch 'type-holes-branch' deleted Message-ID: <20140512132324.9840B2406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc Deleted branch: type-holes-branch From git at git.haskell.org Mon May 12 13:23:32 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 12 May 2014 13:23:32 +0000 (UTC) Subject: [commit: ghc] branch 'encoding' deleted Message-ID: <20140512132333.07A992406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc Deleted branch: encoding From git at git.haskell.org Mon May 12 13:23:41 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 12 May 2014 13:23:41 +0000 (UTC) Subject: [commit: ghc] branch 'cardinality' deleted Message-ID: <20140512132342.841322406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc Deleted branch: cardinality From git at git.haskell.org Mon May 12 13:23:52 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 12 May 2014 13:23:52 +0000 (UTC) Subject: [commit: ghc] branch 'at-defaults' deleted Message-ID: <20140512132352.597D82406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc Deleted branch: at-defaults From git at git.haskell.org Mon May 12 13:24:35 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 12 May 2014 13:24:35 +0000 (UTC) Subject: [commit: ghc] branch 'overlapping-tyfams' deleted Message-ID: <20140512132435.1F8562406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc Deleted branch: overlapping-tyfams From git at git.haskell.org Mon May 12 13:24:43 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 12 May 2014 13:24:43 +0000 (UTC) Subject: [commit: ghc] branch 'ghc-axioms' deleted Message-ID: <20140512132443.6081D2406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc Deleted branch: ghc-axioms From git at git.haskell.org Mon May 12 13:24:52 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 12 May 2014 13:24:52 +0000 (UTC) Subject: [commit: ghc] branch 'ticky-for-all-lets' deleted Message-ID: <20140512132452.3D8552406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc Deleted branch: ticky-for-all-lets From git at git.haskell.org Mon May 12 13:25:03 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 12 May 2014 13:25:03 +0000 (UTC) Subject: [commit: ghc] branch 'late-dmd' deleted Message-ID: <20140512132503.827D62406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc Deleted branch: late-dmd From git at git.haskell.org Mon May 12 13:25:13 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 12 May 2014 13:25:13 +0000 (UTC) Subject: [commit: ghc] branch 'atomics' deleted Message-ID: <20140512132513.C797F2406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc Deleted branch: atomics From git at git.haskell.org Mon May 12 13:25:25 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 12 May 2014 13:25:25 +0000 (UTC) Subject: [commit: ghc] branch 'ghc-parmake-gsoc' deleted Message-ID: <20140512132525.476BD2406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc Deleted branch: ghc-parmake-gsoc From git at git.haskell.org Mon May 12 13:25:37 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 12 May 2014 13:25:37 +0000 (UTC) Subject: [commit: ghc] branch 'cpr-sum-types' deleted Message-ID: <20140512132537.BAF3C2406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc Deleted branch: cpr-sum-types From git at git.haskell.org Mon May 12 13:26:06 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 12 May 2014 13:26:06 +0000 (UTC) Subject: [commit: ghc] branch 'simd' deleted Message-ID: <20140512132606.E38CC2406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc Deleted branch: simd From git at git.haskell.org Mon May 12 13:26:16 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 12 May 2014 13:26:16 +0000 (UTC) Subject: [commit: ghc] branch 'th-new' deleted Message-ID: <20140512132616.998E52406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc Deleted branch: th-new From git at git.haskell.org Mon May 12 13:27:03 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 12 May 2014 13:27:03 +0000 (UTC) Subject: [commit: ghc] branch 'unboxed-tuple-arguments2' deleted Message-ID: <20140512132703.E5C272406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc Deleted branch: unboxed-tuple-arguments2 From git at git.haskell.org Mon May 12 13:27:13 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 12 May 2014 13:27:13 +0000 (UTC) Subject: [commit: ghc] branch 'type-nats-simple' deleted Message-ID: <20140512132713.96E3E2406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc Deleted branch: type-nats-simple From git at git.haskell.org Mon May 12 13:27:44 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 12 May 2014 13:27:44 +0000 (UTC) Subject: [commit: ghc] branch 'newcg' deleted Message-ID: <20140512132744.926EC2406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc Deleted branch: newcg From git at git.haskell.org Mon May 12 13:27:56 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 12 May 2014 13:27:56 +0000 (UTC) Subject: [commit: ghc] branch 'cross' deleted Message-ID: <20140512132756.ACAD42406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc Deleted branch: cross From git at git.haskell.org Mon May 12 13:29:14 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 12 May 2014 13:29:14 +0000 (UTC) Subject: [commit: ghc] branch 'tc-arrows' deleted Message-ID: <20140512132914.4CA402406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc Deleted branch: tc-arrows From git at git.haskell.org Mon May 12 15:04:21 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 12 May 2014 15:04:21 +0000 (UTC) Subject: [commit: ghc] master: Comments only, on inert_fsks and inert_no_eqs (2745164) Message-ID: <20140512150423.BEE082406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/2745164acfd582d930cbc5080fdf052f61f6893e/ghc >--------------------------------------------------------------- commit 2745164acfd582d930cbc5080fdf052f61f6893e Author: Simon Peyton Jones Date: Fri May 9 10:40:50 2014 +0100 Comments only, on inert_fsks and inert_no_eqs I wrote these when studying Trac #9090 >--------------------------------------------------------------- 2745164acfd582d930cbc5080fdf052f61f6893e compiler/typecheck/TcInteract.lhs | 1 + compiler/typecheck/TcRnTypes.lhs | 2 ++ compiler/typecheck/TcSMonad.lhs | 59 +++++++++++++++++++++++++++++++++------ 3 files changed, 53 insertions(+), 9 deletions(-) diff --git a/compiler/typecheck/TcInteract.lhs b/compiler/typecheck/TcInteract.lhs index b8c4c81..064bda2 100644 --- a/compiler/typecheck/TcInteract.lhs +++ b/compiler/typecheck/TcInteract.lhs @@ -101,6 +101,7 @@ solveInteractGiven loc old_fsks givens , ctev_loc = loc } | ev_id <- givens ] + -- See Note [Given flatten-skolems] in TcSMonad fsk_bag = listToBag [ mkNonCanonical $ CtGiven { ctev_evtm = EvCoercion (mkTcNomReflCo tv_ty) , ctev_pred = pred , ctev_loc = loc } diff --git a/compiler/typecheck/TcRnTypes.lhs b/compiler/typecheck/TcRnTypes.lhs index d598764..7670566 100644 --- a/compiler/typecheck/TcRnTypes.lhs +++ b/compiler/typecheck/TcRnTypes.lhs @@ -1282,6 +1282,8 @@ data Implication ic_fsks :: [TcTyVar], -- Extra flatten-skolems introduced by -- by flattening the givens + -- See Note [Given flatten-skolems] + ic_no_eqs :: Bool, -- True <=> ic_givens have no equalities, for sure -- False <=> ic_givens might have equalities diff --git a/compiler/typecheck/TcSMonad.lhs b/compiler/typecheck/TcSMonad.lhs index 51f4945..dee4fe4 100644 --- a/compiler/typecheck/TcSMonad.lhs +++ b/compiler/typecheck/TcSMonad.lhs @@ -458,6 +458,7 @@ data InertSet , inert_fsks :: [TcTyVar] -- Rigid flatten-skolems (arising from givens) -- allocated in this local scope + -- See Note [Given flatten-skolems] , inert_solved_funeqs :: FunEqMap (CtEvidence, TcType) -- See Note [Type family equations] @@ -475,8 +476,29 @@ data InertSet -- - Stored not necessarily as fully rewritten -- (ToDo: rewrite lazily when we lookup) } +\end{code} +Note [Given flatten-skolems] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Suppose we simplify the implication + forall b. C (F a) b => (C (F a) beta, blah) +We'll flatten the givens, introducing a flatten-skolem, so the +givens effectively look like + (C fsk b, F a ~ fsk) +Then we simplify the wanteds, transforming (C (F a) beta) to (C fsk beta). +Now, if we don't solve that wanted, we'll put it back into the residual +implicaiton. But where is fsk bound? + +We solve this by recording the given flatten-skolems in the implication +(the ic_fsks field), so it's as if we change the implication to + forall b, fsk. (C fsk b, F a ~ fsk) => (C fsk beta, blah) + +We don't need to explicitly record the (F a ~ fsk) constraint in the implication +because we can recover it from inside the fsk TyVar itself. But we do need +to treat that (F a ~ fsk) as a new given. See the fsk_bag stuff in +TcInteract.solveInteractGiven. +\begin{code} instance Outputable InertCans where ppr ics = vcat [ ptext (sLit "Equalities:") <+> vcat (map ppr (varEnvElts (inert_eqs ics))) @@ -503,9 +525,9 @@ emptyInert , inert_funeqs = emptyFunEqs , inert_irreds = emptyCts , inert_insols = emptyCts - , inert_no_eqs = True + , inert_no_eqs = True -- See Note [inert_fsks and inert_no_eqs] } - , inert_fsks = [] + , inert_fsks = [] -- See Note [inert_fsks and inert_no_eqs] , inert_flat_cache = emptyFunEqs , inert_solved_funeqs = emptyFunEqs , inert_solved_dicts = emptyDictMap } @@ -518,10 +540,12 @@ addInertCan ics item@(CTyEqCan { cc_ev = ev }) (inert_eqs ics) (cc_tyvar item) [item] , inert_no_eqs = isFlatSkolEv ev && inert_no_eqs ics } + -- See Note [When does an implication have given equalities?] in TcSimplify addInertCan ics item@(CFunEqCan { cc_fun = tc, cc_tyargs = tys, cc_ev = ev }) = ics { inert_funeqs = addFunEq (inert_funeqs ics) tc tys item , inert_no_eqs = isFlatSkolEv ev && inert_no_eqs ics } + -- See Note [When does an implication have given equalities?] in TcSimplify addInertCan ics item@(CIrredEvCan {}) = ics { inert_irreds = inert_irreds ics `Bag.snocBag` item @@ -598,7 +622,7 @@ prepareInertsForImplications is , inert_irreds = Bag.filterBag isGivenCt irreds , inert_dicts = filterDicts isGivenCt dicts , inert_insols = emptyCts - , inert_no_eqs = True -- Ready for each implication + , inert_no_eqs = True -- See Note [inert_fsks and inert_no_eqs] } is_given_eq :: [Ct] -> Bool @@ -1254,19 +1278,36 @@ getUntouchables :: TcS Untouchables getUntouchables = wrapTcS TcM.getUntouchables getGivenInfo :: TcS a -> TcS (Bool, [TcTyVar], a) --- Run thing_inside, returning info on --- a) whether we got any new equalities --- b) which new (given) flatten skolems were generated +-- See Note [inert_fsks and inert_no_eqs] getGivenInfo thing_inside - = do { updInertTcS reset_vars - ; res <- thing_inside - ; is <- getTcSInerts + = do { + ; updInertTcS reset_vars -- Set inert_fsks and inert_no_eqs to initial values + ; res <- thing_inside -- Run thing_inside + ; is <- getTcSInerts -- Get new values of inert_fsks and inert_no_eqs ; return (inert_no_eqs (inert_cans is), inert_fsks is, res) } where reset_vars :: InertSet -> InertSet reset_vars is = is { inert_cans = (inert_cans is) { inert_no_eqs = True } , inert_fsks = [] } +\end{code} +Note [inert_fsks and inert_no_eqs] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +The function getGivenInfo runs thing_inside to see what new flatten-skolems +and equalities are generated by thing_inside. To that end, + * it initialises inert_fsks, inert_no_eqs + * runs thing_inside + * reads out inert_fsks, inert_no_eqs +This is the only place where it matters what inert_fsks and inert_no_eqs +are initialised to. In other places (eg emptyIntert), we need to set them +to something (because they are strict) but they will never be looked at. + +See Note [When does an implication have given equalities?] in TcSimplify +for more details about inert_no_eqs. + +See Note [Given flatten-skolems] for more details about inert_fsks. + +\begin{code} getTcSTyBinds :: TcS (IORef (Bool, TyVarEnv (TcTyVar, TcType))) getTcSTyBinds = TcS (return . tcs_ty_binds) From git at git.haskell.org Mon May 12 15:04:24 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 12 May 2014 15:04:24 +0000 (UTC) Subject: [commit: ghc] master: In splitHsFunType, take account of prefix (->) (770e16f) Message-ID: <20140512150424.8DF852406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/770e16fceee60db0c2f79e3b77f6fc619bc1d864/ghc >--------------------------------------------------------------- commit 770e16fceee60db0c2f79e3b77f6fc619bc1d864 Author: Simon Peyton Jones Date: Mon May 12 16:02:36 2014 +0100 In splitHsFunType, take account of prefix (->) This fixes Trac #9096 >--------------------------------------------------------------- 770e16fceee60db0c2f79e3b77f6fc619bc1d864 compiler/hsSyn/HsTypes.lhs | 31 ++++++++++++++++++++++++------- testsuite/tests/gadt/T9096.hs | 6 ++++++ testsuite/tests/gadt/all.T | 1 + 3 files changed, 31 insertions(+), 7 deletions(-) diff --git a/compiler/hsSyn/HsTypes.lhs b/compiler/hsSyn/HsTypes.lhs index 28c6a2b..6f65a12 100644 --- a/compiler/hsSyn/HsTypes.lhs +++ b/compiler/hsSyn/HsTypes.lhs @@ -45,6 +45,7 @@ import HsLit import Name( Name ) import RdrName( RdrName ) import DataCon( HsBang(..) ) +import TysPrim( funTyConName ) import Type import HsDoc import BasicTypes @@ -506,15 +507,31 @@ splitLHsClassTy_maybe ty HsKindSig ty _ -> checkl ty args _ -> Nothing --- Splits HsType into the (init, last) parts +-- splitHsFunType decomposes a type (t1 -> t2 ... -> tn) -- Breaks up any parens in the result type: -- splitHsFunType (a -> (b -> c)) = ([a,b], c) -splitHsFunType :: LHsType name -> ([LHsType name], LHsType name) -splitHsFunType (L _ (HsFunTy x y)) = (x:args, res) - where - (args, res) = splitHsFunType y -splitHsFunType (L _ (HsParTy ty)) = splitHsFunType ty -splitHsFunType other = ([], other) +-- Also deals with (->) t1 t2; that is why it only works on LHsType Name +-- (see Trac #9096) +splitHsFunType :: LHsType Name -> ([LHsType Name], LHsType Name) +splitHsFunType (L _ (HsParTy ty)) + = splitHsFunType ty + +splitHsFunType (L _ (HsFunTy x y)) + | (args, res) <- splitHsFunType y + = (x:args, res) + +splitHsFunType orig_ty@(L _ (HsAppTy t1 t2)) + = go t1 [t2] + where -- Look for (->) t1 t2, possibly with parenthesisation + go (L _ (HsTyVar fn)) tys | fn == funTyConName + , [t1,t2] <- tys + , (args, res) <- splitHsFunType t2 + = (t1:args, res) + go (L _ (HsAppTy t1 t2)) tys = go t1 (t2:tys) + go (L _ (HsParTy ty)) tys = go ty tys + go _ _ = ([], orig_ty) -- Failure to match + +splitHsFunType other = ([], other) \end{code} diff --git a/testsuite/tests/gadt/T9096.hs b/testsuite/tests/gadt/T9096.hs new file mode 100644 index 0000000..d778798 --- /dev/null +++ b/testsuite/tests/gadt/T9096.hs @@ -0,0 +1,6 @@ +{-# LANGUAGE GADTs #-} + +module T9096 where + +data Foo a where + MkFoo :: (->) a (Foo a) diff --git a/testsuite/tests/gadt/all.T b/testsuite/tests/gadt/all.T index 9192891..52a8812 100644 --- a/testsuite/tests/gadt/all.T +++ b/testsuite/tests/gadt/all.T @@ -122,3 +122,4 @@ test('T7321', ['$MAKE -s --no-print-directory T7321']) test('T7974', normal, compile, ['']) test('T7558', normal, compile_fail, ['']) +test('T9096', normal, compile, ['']) From git at git.haskell.org Mon May 12 15:04:26 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 12 May 2014 15:04:26 +0000 (UTC) Subject: [commit: ghc] master: Improve desugaring of lazy pattern match (b5cf17f) Message-ID: <20140512150426.D74322406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/b5cf17f2f39993595e6ec7bd6bfe000c58a09fd8/ghc >--------------------------------------------------------------- commit b5cf17f2f39993595e6ec7bd6bfe000c58a09fd8 Author: Simon Peyton Jones Date: Mon May 12 16:03:48 2014 +0100 Improve desugaring of lazy pattern match This patch implements a simpler, and nicer, desugaring for lazy pattern matching, fixing Trac #9098 >--------------------------------------------------------------- b5cf17f2f39993595e6ec7bd6bfe000c58a09fd8 compiler/deSugar/DsUtils.lhs | 17 ++++++++--------- compiler/types/Coercion.lhs | 7 +++---- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/compiler/deSugar/DsUtils.lhs b/compiler/deSugar/DsUtils.lhs index 2ad70c6..924ba88 100644 --- a/compiler/deSugar/DsUtils.lhs +++ b/compiler/deSugar/DsUtils.lhs @@ -64,7 +64,6 @@ import ConLike import DataCon import PatSyn import Type -import Coercion import TysPrim import TysWiredIn import BasicTypes @@ -638,12 +637,13 @@ mkSelectorBinds ticks pat val_expr -- efficient too. -- For the error message we make one error-app, to avoid duplication. - -- But we need it at different types... so we use coerce for that - ; err_expr <- mkErrorAppDs iRREFUT_PAT_ERROR_ID unitTy (ppr pat) - ; err_var <- newSysLocalDs unitTy - ; binds <- zipWithM (mk_bind val_var err_var) ticks' binders + -- But we need it at different types, so we make it polymorphic: + -- err_var = /\a. iRREFUT_PAT_ERR a "blah blah blah" + ; err_app <- mkErrorAppDs iRREFUT_PAT_ERROR_ID alphaTy (ppr pat) + ; err_var <- newSysLocalDs (mkForAllTy alphaTyVar alphaTy) + ; binds <- zipWithM (mk_bind val_var err_var) ticks' binders ; return ( (val_var, val_expr) : - (err_var, err_expr) : + (err_var, Lam alphaTyVar err_app) : binds ) } | otherwise @@ -665,14 +665,13 @@ mkSelectorBinds ticks pat val_expr mk_bind scrut_var err_var tick bndr_var = do -- (mk_bind sv err_var) generates - -- bv = case sv of { pat -> bv; other -> coerce (type-of-bv) err_var } + -- bv = case sv of { pat -> bv; other -> err_var @ type-of-bv } -- Remember, pat binds bv rhs_expr <- matchSimply (Var scrut_var) PatBindRhs pat (Var bndr_var) error_expr return (bndr_var, mkOptTickBox tick rhs_expr) where - error_expr = mkCast (Var err_var) co - co = mkUnsafeCo (exprType (Var err_var)) (idType bndr_var) + error_expr = Var err_var `App` Type (idType bndr_var) is_simple_lpat p = is_simple_pat (unLoc p) diff --git a/compiler/types/Coercion.lhs b/compiler/types/Coercion.lhs index 53326e6..195bc4c 100644 --- a/compiler/types/Coercion.lhs +++ b/compiler/types/Coercion.lhs @@ -1048,10 +1048,9 @@ ok_tc_app ty n = case splitTyConApp_maybe ty of mkInstCo :: Coercion -> Type -> Coercion mkInstCo co ty = InstCo co ty --- | Manufacture a coercion from thin air. Needless to say, this is --- not usually safe, but it is used when we know we are dealing with --- bottom, which is one case in which it is safe. This is also used --- to implement the @unsafeCoerce#@ primitive. Optimise by pushing +-- | Manufacture an unsafe coercion from thin air. +-- Currently (May 14) this is used only to implement the +-- @unsafeCoerce#@ primitive. Optimise by pushing -- down through type constructors. mkUnsafeCo :: Type -> Type -> Coercion mkUnsafeCo = mkUnivCo Representational From git at git.haskell.org Mon May 12 22:39:16 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 12 May 2014 22:39:16 +0000 (UTC) Subject: [commit: ghc] master: Typo in comment (315fff6) Message-ID: <20140512223916.D0D372406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/315fff63c67ff160578803914a4ada946399270f/ghc >--------------------------------------------------------------- commit 315fff63c67ff160578803914a4ada946399270f Author: Gabor Greif Date: Tue May 13 00:38:19 2014 +0200 Typo in comment >--------------------------------------------------------------- 315fff63c67ff160578803914a4ada946399270f compiler/deSugar/Check.lhs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/deSugar/Check.lhs b/compiler/deSugar/Check.lhs index c0fe9c0..fc3150d 100644 --- a/compiler/deSugar/Check.lhs +++ b/compiler/deSugar/Check.lhs @@ -123,7 +123,7 @@ untidy_message :: (Name, [HsLit]) -> (Name, [HsLit]) untidy_message (string, lits) = (string, map untidy_lit lits) \end{code} -The function @untidy@ does the reverse work of the @tidy_pat@ funcion. +The function @untidy@ does the reverse work of the @tidy_pat@ function. \begin{code} From git at git.haskell.org Mon May 12 22:49:59 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 12 May 2014 22:49:59 +0000 (UTC) Subject: [commit: ghc] master: Typo in note (1f8f927) Message-ID: <20140512225000.0DB4D2406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/1f8f927360f163eded62f7312d3d37bd93c5bfe7/ghc >--------------------------------------------------------------- commit 1f8f927360f163eded62f7312d3d37bd93c5bfe7 Author: Gabor Greif Date: Tue May 13 00:49:30 2014 +0200 Typo in note >--------------------------------------------------------------- 1f8f927360f163eded62f7312d3d37bd93c5bfe7 compiler/typecheck/TcSMonad.lhs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/typecheck/TcSMonad.lhs b/compiler/typecheck/TcSMonad.lhs index dee4fe4..70ba19e 100644 --- a/compiler/typecheck/TcSMonad.lhs +++ b/compiler/typecheck/TcSMonad.lhs @@ -487,7 +487,7 @@ givens effectively look like (C fsk b, F a ~ fsk) Then we simplify the wanteds, transforming (C (F a) beta) to (C fsk beta). Now, if we don't solve that wanted, we'll put it back into the residual -implicaiton. But where is fsk bound? +implication. But where is fsk bound? We solve this by recording the given flatten-skolems in the implication (the ic_fsks field), so it's as if we change the implication to From git at git.haskell.org Tue May 13 04:52:38 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 13 May 2014 04:52:38 +0000 (UTC) Subject: [commit: ghc] wip/ext-solver: Solve only wanted constraints. (06db95b) Message-ID: <20140513045238.C89B02406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ext-solver Link : http://ghc.haskell.org/trac/ghc/changeset/06db95b56270cd73c52af4bf5a258f08b7820902/ghc >--------------------------------------------------------------- commit 06db95b56270cd73c52af4bf5a258f08b7820902 Author: Iavor S. Diatchki Date: Mon May 12 21:51:25 2014 -0700 Solve only wanted constraints. >--------------------------------------------------------------- 06db95b56270cd73c52af4bf5a258f08b7820902 compiler/typecheck/TcInteract.lhs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/compiler/typecheck/TcInteract.lhs b/compiler/typecheck/TcInteract.lhs index bad7bf5..e269196 100644 --- a/compiler/typecheck/TcInteract.lhs +++ b/compiler/typecheck/TcInteract.lhs @@ -178,14 +178,13 @@ interactExternSolver inGivenStage = -- During the wanted stage, we try to solve the constraints -- once there is no more additional work for re-writing. | otherwise -> - do (solved, unsolved) <- extSolSolve feqs + do let (wanteds, others) = partition isWantedCt feqs + (solved, unsolved) <- extSolSolve wanteds case solved of [] -> return False -- Shortcut for common case. - _ -> do rebuildInerts unsolved - let setEv (ev,ct) - | isWantedCt ct = - setEvBind (ctev_evar (cc_ev ct)) ev - | otherwise = return () + _ -> do rebuildInerts (unsolved ++ others) + let setEv (ev,ct) = + setEvBind (ctev_evar (cc_ev ct)) ev mapM_ setEv solved return False From git at git.haskell.org Tue May 13 04:52:41 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 13 May 2014 04:52:41 +0000 (UTC) Subject: [commit: ghc] wip/ext-solver: An experiment with reordering goals while solving + more tricky examples. (45a5fcd) Message-ID: <20140513045241.398172406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ext-solver Link : http://ghc.haskell.org/trac/ghc/changeset/45a5fcdb12a9b503c9973d3f11c111f0f6bf5f7b/ghc >--------------------------------------------------------------- commit 45a5fcdb12a9b503c9973d3f11c111f0f6bf5f7b Author: Iavor S. Diatchki Date: Mon May 12 21:52:30 2014 -0700 An experiment with reordering goals while solving + more tricky examples. >--------------------------------------------------------------- 45a5fcdb12a9b503c9973d3f11c111f0f6bf5f7b compiler/typecheck/TcTypeNats.hs | 102 ++++++++++++++++++++++++++++----------- 1 file changed, 74 insertions(+), 28 deletions(-) diff --git a/compiler/typecheck/TcTypeNats.hs b/compiler/typecheck/TcTypeNats.hs index 5c52fa5..9dc4a9f 100644 --- a/compiler/typecheck/TcTypeNats.hs +++ b/compiler/typecheck/TcTypeNats.hs @@ -12,7 +12,7 @@ import TcEvidence ( mkTcAxiomRuleCo, EvTerm(..) ) import TyCon ( TyCon, SynTyConRhs(..), mkSynTyCon, TyConParent(..) ) import Coercion ( Role(..) ) import TcRnTypes ( Xi, Ct(..), ctPred, CtEvidence(..), mkNonCanonical - , CtLoc, ctLoc ) + , CtLoc, ctLoc, isGivenCt ) import CoAxiom ( CoAxiomRule(..), BuiltInSynFamily(..) ) import Name ( Name, BuiltInSyntax(..), nameOccName, nameUnique ) import OccName ( occNameString ) @@ -43,7 +43,7 @@ import Data.Map (Map) import qualified Data.Map as Map import Data.Maybe ( isJust, mapMaybe ) import Data.Char ( isSpace ) -import Data.List ( unfoldr, foldl', partition ) +import Data.List ( unfoldr, foldl', partition, sortBy, groupBy ) import Data.IORef ( IORef, newIORef, atomicModifyIORef', atomicModifyIORef, modifyIORef' , readIORef @@ -784,8 +784,9 @@ newExternalSolver exe opts = , extSolAssert = \cts -> do dbg "=== ASSERT ===" (_,ours) <- solverPrepare proc viRef cts - mapM_ (solverAssume proc . snd) ours - mapM_ (solverDebug proc . show . snd) ours + let expr (_,e,_) = e + mapM_ (solverAssume proc . expr) ours + mapM_ (solverDebug proc . show . expr) ours , extSolImprove = \b cts -> do dbg "=== IMPROVE ===" solverImprove proc viRef b cts @@ -947,17 +948,19 @@ solverImproveModel proc viRef imps = -- Identify our constraints, and declare their variables in the current scope. solverPrepare :: SolverProcess -> IORef VarInfo -> - [Ct] -> IO ([Ct], [(Ct,SExpr)]) + [Ct] -> IO ([Ct], [(Ct,SExpr,Maybe TyVar)]) solverPrepare proc viRef = go [] [] where go others ours [] = return (others, ours) go others ours (ct : cts) = case knownCt ct of - Just (vars,e) -> - do mapM_ (solverDeclare proc viRef) (eltsUFM vars) - go others ((ct,e) : ours) cts + Just (vars,e,mbV) -> + do let g = if isGivenCt ct then "[G] " else "[W/D] " + solverDebug proc (g ++ show e) + mapM_ (solverDeclare proc viRef) (eltsUFM vars) + go others ((ct,e,mbV) : ours) cts Nothing -> - go (ct : others) ours cts + go (ct : others) ours cts {- @@ -971,7 +974,8 @@ solverImprove :: SolverProcess -> IORef VarInfo -> IO ExtSolRes solverImprove proc viRef withEv cts = do push -- declare variables - (others,ours) <- solverPrepare proc viRef cts + (others,ours') <- solverPrepare proc viRef cts + let ours = [ (ct,e) | (ct,e,_) <- ours' ] case ours of [] -> do pop -- declarations return (ExtSolOk []) @@ -1115,31 +1119,50 @@ to prove: (a + a) + b ~ w + b We can't do this because we've lost the information about `w`. +To avoid this, we first try to solve equations that have the same varibal +on the RHS (e.g., F xs ~ a, G ys ~ a). + +However, this is not quite enough. Here is another tricky example: + +data T :: Nat -> * where + Even :: T (n + 1) -> T (2 * (n + 1)) + +addT :: T m -> T n -> T (m + n) +addT (Even x) (Even y) = Even (addT x y) + + +x :: T (a + 1) +y :: T (b + 1) + +[G] m = 2 * (a + 1) +[G] n = 2 * (b + 1) +addT x y :: T ((a + 1) + (b + 1)) -Perhaps the answer is to solve all goals at the same time -(this also has the benefit of being more efficeint!). +[W] (a + 1) + (b + 1) = x + 1 -- Applying Even is OK +[W] 2 * (x + 1) = m + n -- The result is correct -If we need to solve a collection of goals: +After canonicalization: -A /\ B /\ C /\ D +[G] a + 1 = t1 +[G] b + 1 = t2 +[G] 2 * t1 = m +[G] 2 * t2 = n -we look for a counter example, which amounts to finding a model for: +[W] t1 + t2 = t3 +[W] x + 1 = t3 +[W] 2 * t3 = t4 +[W] m + n = t4 -not (A /\ B /\ C /\ D) +The issue here seems to be that `x = a + b + 1`, but this intermediate +value is not named anywhere. What to do? -If such a model does not exist, than we can solve all the goals. -If it does exits, then we can't solve all the golas, at which point -we could give up. -Instead of giving up, it is nicer to try to identify a small -subset of all goals that can't be solved, to report a more -reasonable error. For example, if the goals were: +XXX: BUG The following incorrect program causes infinte improvement -(x = 2, a + 0 ~ a) +addT :: T m -> T n -> T (m + n) +addT (Even x) (Even y) = Even (addT x x) -We can't solve these togethere (there is no reason why `x` should be 2), -but we could solve the `a + 0 ~ a` part. -} @@ -1150,7 +1173,10 @@ solverSimplify :: SolverProcess -> IORef VarInfo -> solverSimplify proc viRef cts = do push -- `unsolved` scope (others,ours) <- solverPrepare proc viRef cts - go others [] ours + let r = reorder ours + solverDebug proc "Reordered:" + mapM_ (solverDebug proc . show . snd) r + go others [] r where push = solverPush proc viRef pop = solverPop proc viRef @@ -1175,6 +1201,22 @@ solverSimplify proc viRef cts = else do assume e -- add to `unsolved` go (ct : unsolved) solved more + reorder = map dropVar + . concat + . sortBy longer -- most vars first + . groupBy sameVars -- join together eqns for same variable + . sortBy cmpVars -- first sort by variable + + where + cmpVars (_,_,v1) (_,_,v2) = compare v1 v2 + sameVars (_,_,v1) (_,_,v2) = v1 == v2 + longer xs ys = compare (length ys) (length xs) + dropVar (ct,e,_) = (ct,e) + + + + + -------------------------------------------------------------------------------- smtTy :: Ty -> SExpr @@ -1216,13 +1258,17 @@ data Ty = TNat | TBool type VarTypes = UniqFM (TyVar,String,Ty) -knownCt :: Ct -> Maybe (VarTypes, SExpr) +{- | See if this constraint is one ofthe ones that we understand. +If the constraint is of the form `F ts ~ a`, where `a` is a type-variable, +we also return `a`. This is used to decide in what order to solve +constraints, see `solverSimplify`. -} +knownCt :: Ct -> Maybe (VarTypes, SExpr, Maybe TyVar) knownCt ct = case ct of CFunEqCan _ f args rhs -> do (vs1,e1) <- knownTerm f args (vs2,e2) <- knownXi rhs - return (plusUFM vs1 vs2, smtEq e1 e2) + return (plusUFM vs1 vs2, smtEq e1 e2, getTyVar_maybe rhs) _ -> Nothing knownTerm :: TyCon -> [Xi] -> Maybe (VarTypes, SExpr) From git at git.haskell.org Tue May 13 12:17:48 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 13 May 2014 12:17:48 +0000 (UTC) Subject: [commit: ghc] master: Lint should check that TyConAppCo doesn't have a synonym in the tycon position (4cfc1fa) Message-ID: <20140513121748.9EBEB2406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/4cfc1fae11ec9a5c4b34ac747f0ce50f52423eba/ghc >--------------------------------------------------------------- commit 4cfc1fae11ec9a5c4b34ac747f0ce50f52423eba Author: Simon Peyton Jones Date: Tue May 13 13:15:45 2014 +0100 Lint should check that TyConAppCo doesn't have a synonym in the tycon position That is why Lint didn't nail Trac #9102 >--------------------------------------------------------------- 4cfc1fae11ec9a5c4b34ac747f0ce50f52423eba compiler/coreSyn/CoreLint.lhs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/compiler/coreSyn/CoreLint.lhs b/compiler/coreSyn/CoreLint.lhs index b5c7985..3d3deab 100644 --- a/compiler/coreSyn/CoreLint.lhs +++ b/compiler/coreSyn/CoreLint.lhs @@ -856,6 +856,9 @@ lintCoercion co@(TyConAppCo r tc cos) ; checkRole co2 r r2 ; return (rk, mkFunTy s1 s2, mkFunTy t1 t2, r) } + | isSynTyCon tc + = failWithL (ptext (sLit "Synonym in TyConAppCo:") <+> ppr co) + | otherwise = do { (ks,ss,ts,rs) <- mapAndUnzip4M lintCoercion cos ; rk <- lint_co_app co (tyConKind tc) (ss `zip` ks) From git at git.haskell.org Tue May 13 12:17:50 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 13 May 2014 12:17:50 +0000 (UTC) Subject: [commit: ghc] master: Fix invariant in mkAppCoFlexible (21f17d0) Message-ID: <20140513121751.1BE342406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/21f17d06aa5c33e639f1b0d37b4bf888b494c441/ghc >--------------------------------------------------------------- commit 21f17d06aa5c33e639f1b0d37b4bf888b494c441 Author: Simon Peyton Jones Date: Tue May 13 13:17:19 2014 +0100 Fix invariant in mkAppCoFlexible mkAppCoFlexible was breaking the invariant that the head of a TyConAppCo cannot be a type synonym. This small patch fixes it. >--------------------------------------------------------------- 21f17d06aa5c33e639f1b0d37b4bf888b494c441 compiler/types/Coercion.lhs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/compiler/types/Coercion.lhs b/compiler/types/Coercion.lhs index 195bc4c..a8f9a2e 100644 --- a/compiler/types/Coercion.lhs +++ b/compiler/types/Coercion.lhs @@ -948,7 +948,9 @@ mkAppCo co1 co2 = mkAppCoFlexible co1 Nominal co2 mkAppCoFlexible :: Coercion -> Role -> Coercion -> Coercion mkAppCoFlexible (Refl r ty1) _ (Refl _ ty2) = Refl r (mkAppTy ty1 ty2) -mkAppCoFlexible (Refl r (TyConApp tc tys)) r2 co2 +mkAppCoFlexible (Refl r ty1) r2 co2 + | Just (tc, tys) <- splitTyConApp_maybe ty1 + -- Expand type synonyms; a TyConAppCo can't have a type synonym (Trac #9102) = TyConAppCo r tc (zip_roles (tyConRolesX r tc) tys) where zip_roles (r1:_) [] = [downgradeRole r1 r2 co2] From git at git.haskell.org Tue May 13 12:21:07 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 13 May 2014 12:21:07 +0000 (UTC) Subject: [commit: ghc] master: Fix globalRegMaybe for unregisterised build. (214ad2d) Message-ID: <20140513122107.077922406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/214ad2d24cda4aaef541df3e213d5c4845f95c71/ghc >--------------------------------------------------------------- commit 214ad2d24cda4aaef541df3e213d5c4845f95c71 Author: Peter Trommler Date: Wed Apr 30 11:41:51 2014 +0200 Fix globalRegMaybe for unregisterised build. In commit 83a003f globalRegMaybe will be called but panics for unregisterised compilers. In an unregisterised compiler there are no global registers so always return `Nothing`. Fixes #9055. >--------------------------------------------------------------- 214ad2d24cda4aaef541df3e213d5c4845f95c71 includes/CodeGen.Platform.hs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/includes/CodeGen.Platform.hs b/includes/CodeGen.Platform.hs index 3d6dd41..62708cc 100644 --- a/includes/CodeGen.Platform.hs +++ b/includes/CodeGen.Platform.hs @@ -742,6 +742,8 @@ globalRegMaybe CurrentTSO = Just (RealRegSingle REG_CurrentTSO) globalRegMaybe CurrentNursery = Just (RealRegSingle REG_CurrentNursery) # endif globalRegMaybe _ = Nothing +#elif MACHREGS_NO_REGS +globalRegMaybe _ = Nothing #else globalRegMaybe = panic "globalRegMaybe not defined for this platform" #endif From git at git.haskell.org Tue May 13 23:16:16 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 13 May 2014 23:16:16 +0000 (UTC) Subject: [commit: ghc] master: Wibble to 4cfc1fae (3fd7f54) Message-ID: <20140513231617.008D12406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/3fd7f543efe977de6f3cce9fcdfdad8b6825f948/ghc >--------------------------------------------------------------- commit 3fd7f543efe977de6f3cce9fcdfdad8b6825f948 Author: Simon Peyton Jones Date: Wed May 14 00:15:48 2014 +0100 Wibble to 4cfc1fae isSynTyCon is true of type *family* TyCons, which *are* allowed in TyConAppCo >--------------------------------------------------------------- 3fd7f543efe977de6f3cce9fcdfdad8b6825f948 compiler/coreSyn/CoreLint.lhs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/coreSyn/CoreLint.lhs b/compiler/coreSyn/CoreLint.lhs index 3d3deab..8665ec4 100644 --- a/compiler/coreSyn/CoreLint.lhs +++ b/compiler/coreSyn/CoreLint.lhs @@ -856,7 +856,7 @@ lintCoercion co@(TyConAppCo r tc cos) ; checkRole co2 r r2 ; return (rk, mkFunTy s1 s2, mkFunTy t1 t2, r) } - | isSynTyCon tc + | Just {} <- synTyConDefn_maybe tc = failWithL (ptext (sLit "Synonym in TyConAppCo:") <+> ppr co) | otherwise From git at git.haskell.org Wed May 14 00:34:04 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 14 May 2014 00:34:04 +0000 (UTC) Subject: [commit: ghc] master: Update Haddock submodule. (b036424) Message-ID: <20140514003404.2CEF92406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/b0364249b76b0091d83cae3b658ac3ed725ba5fc/ghc >--------------------------------------------------------------- commit b0364249b76b0091d83cae3b658ac3ed725ba5fc Author: Mateusz Kowalczyk Date: Wed May 14 02:32:42 2014 +0200 Update Haddock submodule. This splits up Haddock up a bit to allow use of its parser (and in the future perhaps more) without GHC dependency. It should build fine with the regular work-flow but if you get problems with building Haddock then please revert this and let me know. >--------------------------------------------------------------- b0364249b76b0091d83cae3b658ac3ed725ba5fc utils/haddock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/haddock b/utils/haddock index dba02d6..a19af87 160000 --- a/utils/haddock +++ b/utils/haddock @@ -1 +1 @@ -Subproject commit dba02d6df32534aac5d257f2d28596238d248942 +Subproject commit a19af87d6bfee1abc6c179f79eb391b381a26d81 From git at git.haskell.org Wed May 14 07:17:07 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 14 May 2014 07:17:07 +0000 (UTC) Subject: [commit: ghc] master: Add strict ver. of (<$>): (<$!>) to Control.Monad (0148a1c) Message-ID: <20140514071707.E4F6F2406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/0148a1c416e42a7d7c9ff3624a0640963bfe0012/ghc >--------------------------------------------------------------- commit 0148a1c416e42a7d7c9ff3624a0640963bfe0012 Author: Alexander Berntsen Date: Tue May 13 10:50:30 2014 +0200 Add strict ver. of (<$>): (<$!>) to Control.Monad A strict (<$>) has been proposed numerous times. The first time around[1] by Johan Tibell, and the last time around[2] by David Luposchainsky. David's thread was able to avoid The Bikeshed Monster, and his (<$!>) proposal received unanimous +1s all around. This addresses #9099. [1]: http://www.haskell.org/pipermail/libraries/2013-November/021728.html [2]: http://www.haskell.org/pipermail/libraries/2014-April/022864.html Authored-by: Alexander Berntsen Signed-off-by: Herbert Valerio Riedel >--------------------------------------------------------------- 0148a1c416e42a7d7c9ff3624a0640963bfe0012 libraries/base/Control/Monad.hs | 15 +++++++++++++++ libraries/base/changelog.md | 2 ++ 2 files changed, 17 insertions(+) diff --git a/libraries/base/Control/Monad.hs b/libraries/base/Control/Monad.hs index 19c9a87..00c1fdd 100644 --- a/libraries/base/Control/Monad.hs +++ b/libraries/base/Control/Monad.hs @@ -74,6 +74,9 @@ module Control.Monad , ap + -- ** Strict monadic functions + + , (<$!>) ) where import Data.Maybe @@ -311,6 +314,18 @@ is equivalent to ap :: (Monad m) => m (a -> b) -> m a -> m b ap = liftM2 id +infixl 4 <$!> + +-- | Strict version of 'Data.Functor.<$>'. +-- +-- /Since: 4.7.1.0/ +(<$!>) :: Monad m => (a -> b) -> m a -> m b +{-# INLINE (<$!>) #-} +f <$!> m = do + x <- m + let z = f x + z `seq` return z + -- ----------------------------------------------------------------------------- -- Other MonadPlus functions diff --git a/libraries/base/changelog.md b/libraries/base/changelog.md index c561165..4efb121 100644 --- a/libraries/base/changelog.md +++ b/libraries/base/changelog.md @@ -12,6 +12,8 @@ * Weaken RealFloat constraints on some `Data.Complex` functions + * Add `Control.Monad.(<$!>)` as a strict version of `(<$>)` + ## 4.7.0.0 *Apr 2014* * Bundled with GHC 7.8.1 From git at git.haskell.org Wed May 14 08:25:58 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 14 May 2014 08:25:58 +0000 (UTC) Subject: [commit: ghc] master: Set cabal files to default-language:Haskell2010 (dd92e21) Message-ID: <20140514082558.64A422406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/dd92e2179e3171a0630834b773c08d416101980d/ghc >--------------------------------------------------------------- commit dd92e2179e3171a0630834b773c08d416101980d Author: Herbert Valerio Riedel Date: Wed May 14 09:24:10 2014 +0200 Set cabal files to default-language:Haskell2010 This is a first step towards eliminating `default-extensions` in favour of per-file declared `{-# LANGUAGE ... #-}` pragmas. Signed-off-by: Herbert Valerio Riedel >--------------------------------------------------------------- dd92e2179e3171a0630834b773c08d416101980d compiler/ghc.cabal.in | 10 ++++------ ghc/ghc-bin.cabal.in | 9 +++++---- libraries/bin-package-db/bin-package-db.cabal | 16 ++++++++-------- libraries/integer-simple/integer-simple.cabal | 12 ++++++------ utils/compare_sizes/compareSizes.cabal | 4 +++- utils/dll-split/dll-split.cabal | 3 ++- utils/ghc-cabal/ghc-cabal.cabal | 3 ++- utils/ghc-pkg/ghc-pkg.cabal | 5 +++-- utils/ghc-pwd/ghc-pwd.cabal | 3 ++- utils/ghctags/ghctags.cabal | 4 +++- utils/hpc/hpc-bin.cabal | 5 +++-- utils/mkUserGuidePart/mkUserGuidePart.cabal | 3 ++- utils/runghc/runghc.cabal.in | 3 ++- 13 files changed, 45 insertions(+), 35 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc dd92e2179e3171a0630834b773c08d416101980d From git at git.haskell.org Wed May 14 09:19:12 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 14 May 2014 09:19:12 +0000 (UTC) Subject: [commit: ghc] master: Remove LANGUAGE pragrams implied by Haskell2010 (88c0870) Message-ID: <20140514091912.CE93D2406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/88c0870b44a3854bc6608055e7ef84da17324830/ghc >--------------------------------------------------------------- commit 88c0870b44a3854bc6608055e7ef84da17324830 Author: Herbert Valerio Riedel Date: Wed May 14 09:31:57 2014 +0200 Remove LANGUAGE pragrams implied by Haskell2010 Haskell2010 implies (at least) EmptyDataDecls, ForeignFunctionInterface, PatternGuards, DoAndIfThenElse, and RelaxedPolyRec. This is a follow-up to dd92e2179e3171a0630834b773c08d416101980d Signed-off-by: Herbert Valerio Riedel >--------------------------------------------------------------- 88c0870b44a3854bc6608055e7ef84da17324830 compiler/cmm/Hoopl/Dataflow.hs | 2 +- distrib/compare/Makefile | 2 +- distrib/compare/compare.hs | 2 -- ghc/Main.hs | 1 - libraries/integer-simple/GHC/Integer/Type.hs | 3 +-- utils/checkUniques/Makefile | 2 +- utils/checkUniques/checkUniques.hs | 2 -- utils/dll-split/Main.hs | 3 --- utils/ghc-pkg/Main.hs | 2 +- utils/ghctags/Main.hs | 2 +- utils/runghc/runghc.hs | 2 +- 11 files changed, 7 insertions(+), 16 deletions(-) diff --git a/compiler/cmm/Hoopl/Dataflow.hs b/compiler/cmm/Hoopl/Dataflow.hs index 78b930a..7105195 100644 --- a/compiler/cmm/Hoopl/Dataflow.hs +++ b/compiler/cmm/Hoopl/Dataflow.hs @@ -9,7 +9,7 @@ -- specialised to the UniqSM monad. -- -{-# LANGUAGE RankNTypes, ScopedTypeVariables, GADTs, EmptyDataDecls, PatternGuards, TypeFamilies, MultiParamTypeClasses #-} +{-# LANGUAGE RankNTypes, ScopedTypeVariables, GADTs, TypeFamilies, MultiParamTypeClasses #-} {-# OPTIONS_GHC -fprof-auto-top #-} {-# LANGUAGE Trustworthy #-} diff --git a/distrib/compare/Makefile b/distrib/compare/Makefile index f65c041..4964578 100644 --- a/distrib/compare/Makefile +++ b/distrib/compare/Makefile @@ -2,7 +2,7 @@ GHC = ghc compare: *.hs - "$(GHC)" -O --make -Wall -Werror $@ + "$(GHC)" -O -XHaskell2010 --make -Wall -Werror $@ .PHONY: clean clean: diff --git a/distrib/compare/compare.hs b/distrib/compare/compare.hs index 81055c2..8653e3f 100644 --- a/distrib/compare/compare.hs +++ b/distrib/compare/compare.hs @@ -1,5 +1,3 @@ -{-# LANGUAGE PatternGuards #-} - module Main (main) where import Control.Monad.State diff --git a/ghc/Main.hs b/ghc/Main.hs index d056bf9..fcb9bd1 100644 --- a/ghc/Main.hs +++ b/ghc/Main.hs @@ -1,5 +1,4 @@ {-# OPTIONS -fno-warn-incomplete-patterns -optc-DNON_POSIX_SOURCE #-} -{-# LANGUAGE ForeignFunctionInterface #-} ----------------------------------------------------------------------------- -- diff --git a/libraries/integer-simple/GHC/Integer/Type.hs b/libraries/integer-simple/GHC/Integer/Type.hs index 5deecd2..cd39b7d 100644 --- a/libraries/integer-simple/GHC/Integer/Type.hs +++ b/libraries/integer-simple/GHC/Integer/Type.hs @@ -1,6 +1,5 @@ -{-# LANGUAGE CPP, MagicHash, ForeignFunctionInterface, - NoImplicitPrelude, BangPatterns, UnboxedTuples, +{-# LANGUAGE CPP, MagicHash, NoImplicitPrelude, BangPatterns, UnboxedTuples, UnliftedFFITypes #-} -- Commentary of Integer library is located on the wiki: diff --git a/utils/checkUniques/Makefile b/utils/checkUniques/Makefile index a7b2df1..b017473 100644 --- a/utils/checkUniques/Makefile +++ b/utils/checkUniques/Makefile @@ -13,4 +13,4 @@ check: checkUniques ./checkUniques mkPreludeMiscIdUnique $(PREL_NAMES) $(DS_META) checkUniques: checkUniques.hs - $(GHC) --make $@ + $(GHC) -O -XHaskell2010 --make $@ diff --git a/utils/checkUniques/checkUniques.hs b/utils/checkUniques/checkUniques.hs index d8858de..2eda188 100644 --- a/utils/checkUniques/checkUniques.hs +++ b/utils/checkUniques/checkUniques.hs @@ -1,5 +1,3 @@ -{-# LANGUAGE PatternGuards #-} - -- Some things could be improved, e.g.: -- * Check that each file given contains at least one instance of the -- function diff --git a/utils/dll-split/Main.hs b/utils/dll-split/Main.hs index c0e3706..c3f5a15 100644 --- a/utils/dll-split/Main.hs +++ b/utils/dll-split/Main.hs @@ -1,6 +1,3 @@ - -{-# LANGUAGE PatternGuards #-} - module Main (main) where import Control.Monad diff --git a/utils/ghc-pkg/Main.hs b/utils/ghc-pkg/Main.hs index 30acbe2..6bac88b 100644 --- a/utils/ghc-pkg/Main.hs +++ b/utils/ghc-pkg/Main.hs @@ -1,4 +1,4 @@ -{-# LANGUAGE PatternGuards, CPP, ForeignFunctionInterface #-} +{-# LANGUAGE CPP #-} ----------------------------------------------------------------------------- -- -- (c) The University of Glasgow 2004-2009. diff --git a/utils/ghctags/Main.hs b/utils/ghctags/Main.hs index a67891e..815cc7c 100644 --- a/utils/ghctags/Main.hs +++ b/utils/ghctags/Main.hs @@ -1,4 +1,4 @@ -{-# LANGUAGE PatternGuards, ScopedTypeVariables #-} +{-# LANGUAGE ScopedTypeVariables #-} module Main where import Prelude hiding ( mod, id, mapM ) diff --git a/utils/runghc/runghc.hs b/utils/runghc/runghc.hs index 5280cb3..47a6bc5 100644 --- a/utils/runghc/runghc.hs +++ b/utils/runghc/runghc.hs @@ -1,4 +1,4 @@ -{-# LANGUAGE CPP, ForeignFunctionInterface #-} +{-# LANGUAGE CPP #-} #include "ghcconfig.h" ----------------------------------------------------------------------------- -- From git at git.haskell.org Wed May 14 19:26:40 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 14 May 2014 19:26:40 +0000 (UTC) Subject: [commit: ghc] master: Add missing stack checks to stg_ap_* functions (#9001) (fc0ed8a) Message-ID: <20140514192641.9B6322406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/fc0ed8a7309e7cc863b8155fae6b57cb23331c44/ghc >--------------------------------------------------------------- commit fc0ed8a7309e7cc863b8155fae6b57cb23331c44 Author: Simon Marlow Date: Wed May 14 12:25:08 2014 +0100 Add missing stack checks to stg_ap_* functions (#9001) >--------------------------------------------------------------- fc0ed8a7309e7cc863b8155fae6b57cb23331c44 testsuite/tests/codeGen/should_run/T9001.hs | 8 + .../tests/codeGen/should_run/T9001.stdout | 0 testsuite/tests/codeGen/should_run/all.T | 1 + utils/genapply/GenApply.hs | 312 +++++++++++++-------- 4 files changed, 206 insertions(+), 115 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc fc0ed8a7309e7cc863b8155fae6b57cb23331c44 From git at git.haskell.org Thu May 15 08:32:58 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 15 May 2014 08:32:58 +0000 (UTC) Subject: [commit: ghc] master: Convert `ghc-bin.cabal` to use others-extensions (2dd80f6) Message-ID: <20140515083258.8779A2406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/2dd80f6913d05e0b170e4ab39d3fbf6fb6a8bf2f/ghc >--------------------------------------------------------------- commit 2dd80f6913d05e0b170e4ab39d3fbf6fb6a8bf2f Author: Herbert Valerio Riedel Date: Wed May 14 12:41:21 2014 +0200 Convert `ghc-bin.cabal` to use others-extensions This replaces the previous `default-extensions` by per-file declared `{-# LANGUAGE ... #-}` pragmas. Signed-off-by: Herbert Valerio Riedel >--------------------------------------------------------------- 2dd80f6913d05e0b170e4ab39d3fbf6fb6a8bf2f ghc/GhciMonad.hs | 1 + ghc/InteractiveUI.hs | 1 + ghc/Main.hs | 1 + ghc/ghc-bin.cabal.in | 18 ++++++++++++------ 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/ghc/GhciMonad.hs b/ghc/GhciMonad.hs index a4abe32..8f429c5 100644 --- a/ghc/GhciMonad.hs +++ b/ghc/GhciMonad.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE CPP, FlexibleInstances, UnboxedTuples, MagicHash #-} {-# OPTIONS_GHC -fno-cse -fno-warn-orphans #-} -- -fno-cse is needed for GLOBAL_VAR's to behave properly diff --git a/ghc/InteractiveUI.hs b/ghc/InteractiveUI.hs index b41c2db..3f93972 100644 --- a/ghc/InteractiveUI.hs +++ b/ghc/InteractiveUI.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE CPP, MagicHash, NondecreasingIndentation, TupleSections #-} {-# OPTIONS -fno-cse #-} -- -fno-cse is needed for GLOBAL_VAR's to behave properly diff --git a/ghc/Main.hs b/ghc/Main.hs index fcb9bd1..86f1af3 100644 --- a/ghc/Main.hs +++ b/ghc/Main.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE CPP, NondecreasingIndentation #-} {-# OPTIONS -fno-warn-incomplete-patterns -optc-DNON_POSIX_SOURCE #-} ----------------------------------------------------------------------------- diff --git a/ghc/ghc-bin.cabal.in b/ghc/ghc-bin.cabal.in index 5b40e25..dcbc695 100644 --- a/ghc/ghc-bin.cabal.in +++ b/ghc/ghc-bin.cabal.in @@ -45,11 +45,17 @@ Executable ghc if flag(ghci) CPP-Options: -DGHCI GHC-Options: -fno-warn-name-shadowing - Other-Modules: InteractiveUI, GhciMonad, GhciTags + Other-Modules: + InteractiveUI + GhciMonad + GhciTags Build-Depends: transformers, haskeline - Default-Extensions: UnboxedTuples, - FlexibleInstances, - TupleSections, - MagicHash + Other-Extensions: + FlexibleInstances + MagicHash + TupleSections + UnboxedTuples - Default-Extensions: CPP, NondecreasingIndentation + Other-Extensions: + CPP + NondecreasingIndentation From git at git.haskell.org Thu May 15 08:33:00 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 15 May 2014 08:33:00 +0000 (UTC) Subject: [commit: ghc] master: Drop default-extensions:CPP in hpc-bin.cabal (d4aa4e4) Message-ID: <20140515083301.075512406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/d4aa4e4244bb4b2b902941bf2cbea864abd74ea5/ghc >--------------------------------------------------------------- commit d4aa4e4244bb4b2b902941bf2cbea864abd74ea5 Author: Herbert Valerio Riedel Date: Wed May 14 12:37:25 2014 +0200 Drop default-extensions:CPP in hpc-bin.cabal The utils/hpc/*.hs code doesn't use any CPP statements anyway, so this extensions was redundantly enabled to begin with. Signed-off-by: Herbert Valerio Riedel >--------------------------------------------------------------- d4aa4e4244bb4b2b902941bf2cbea864abd74ea5 utils/hpc/hpc-bin.cabal | 1 - 1 file changed, 1 deletion(-) diff --git a/utils/hpc/hpc-bin.cabal b/utils/hpc/hpc-bin.cabal index 6d15e8b..8ec6e5b 100644 --- a/utils/hpc/hpc-bin.cabal +++ b/utils/hpc/hpc-bin.cabal @@ -46,5 +46,4 @@ Executable hpc containers >= 0.1 && < 0.6, array >= 0.1 && < 0.6 Build-Depends: hpc - Default-Extensions: CPP From git at git.haskell.org Thu May 15 08:33:03 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 15 May 2014 08:33:03 +0000 (UTC) Subject: [commit: ghc] master: Avoid NondecreasingIndentation syntax in ghc-pkg (913b314) Message-ID: <20140515083303.8B6FF2406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/913b3146541e203b2524e756b047b7f90be849b7/ghc >--------------------------------------------------------------- commit 913b3146541e203b2524e756b047b7f90be849b7 Author: Herbert Valerio Riedel Date: Wed May 14 12:16:13 2014 +0200 Avoid NondecreasingIndentation syntax in ghc-pkg This also makes ghc-pkg.cabal `default-extensions`-free NB: Printing this commit via `git show --ignore-all-spaces` shows the only non-whitespaces changes are in `ghc-pkg.cabal` Signed-off-by: Herbert Valerio Riedel >--------------------------------------------------------------- 913b3146541e203b2524e756b047b7f90be849b7 utils/ghc-pkg/Main.hs | 60 ++++++++++++++++++++++----------------------- utils/ghc-pkg/ghc-pkg.cabal | 2 +- 2 files changed, 31 insertions(+), 31 deletions(-) diff --git a/utils/ghc-pkg/Main.hs b/utils/ghc-pkg/Main.hs index 6bac88b..290fb82 100644 --- a/utils/ghc-pkg/Main.hs +++ b/utils/ghc-pkg/Main.hs @@ -593,9 +593,9 @@ lookForPackageDBIn dir = do let path_dir = dir "package.conf.d" exists_dir <- doesDirectoryExist path_dir if exists_dir then return (Just path_dir) else do - let path_file = dir "package.conf" - exists_file <- doesFileExist path_file - if exists_file then return (Just path_file) else return Nothing + let path_file = dir "package.conf" + exists_file <- doesFileExist path_file + if exists_file then return (Just path_file) else return Nothing readParseDatabase :: Verbosity -> Maybe (FilePath,Bool) @@ -1035,34 +1035,34 @@ listPackages verbosity my_flags mPackageName mModuleName = do if simple_output then show_simple stack else do #if defined(mingw32_HOST_OS) || defined(BOOTSTRAPPING) - mapM_ show_normal stack + mapM_ show_normal stack #else - let - show_colour withF db = - mconcat $ map (<#> termText "\n") $ - (termText (location db) : - map (termText " " <#>) (map pp_pkg (packages db))) - where - pp_pkg p - | sourcePackageId p `elem` broken = withF Red doc - | exposed p = doc - | otherwise = withF Blue doc - where doc | verbosity >= Verbose - = termText (printf "%s (%s)" pkg ipid) - | otherwise - = termText pkg - where - InstalledPackageId ipid = installedPackageId p - pkg = display (sourcePackageId p) - - is_tty <- hIsTerminalDevice stdout - if not is_tty - then mapM_ show_normal stack - else do tty <- Terminfo.setupTermFromEnv - case Terminfo.getCapability tty withForegroundColor of - Nothing -> mapM_ show_normal stack - Just w -> runTermOutput tty $ mconcat $ - map (show_colour w) stack + let + show_colour withF db = + mconcat $ map (<#> termText "\n") $ + (termText (location db) : + map (termText " " <#>) (map pp_pkg (packages db))) + where + pp_pkg p + | sourcePackageId p `elem` broken = withF Red doc + | exposed p = doc + | otherwise = withF Blue doc + where doc | verbosity >= Verbose + = termText (printf "%s (%s)" pkg ipid) + | otherwise + = termText pkg + where + InstalledPackageId ipid = installedPackageId p + pkg = display (sourcePackageId p) + + is_tty <- hIsTerminalDevice stdout + if not is_tty + then mapM_ show_normal stack + else do tty <- Terminfo.setupTermFromEnv + case Terminfo.getCapability tty withForegroundColor of + Nothing -> mapM_ show_normal stack + Just w -> runTermOutput tty $ mconcat $ + map (show_colour w) stack #endif simplePackageList :: [Flag] -> [InstalledPackageInfo] -> IO () diff --git a/utils/ghc-pkg/ghc-pkg.cabal b/utils/ghc-pkg/ghc-pkg.cabal index 265721d..5743010 100644 --- a/utils/ghc-pkg/ghc-pkg.cabal +++ b/utils/ghc-pkg/ghc-pkg.cabal @@ -17,7 +17,7 @@ Executable ghc-pkg Default-Language: Haskell2010 Main-Is: Main.hs Other-Modules: Version - Default-Extensions: CPP, NondecreasingIndentation + Other-Extensions: CPP Build-Depends: base >= 4 && < 5, directory >= 1 && < 1.3, From git at git.haskell.org Thu May 15 08:33:05 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 15 May 2014 08:33:05 +0000 (UTC) Subject: [commit: ghc] master: Drop use of CPP in `bin-package-db` (61fdafc) Message-ID: <20140515083306.051EF2406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/61fdafcf96c2586710c9bbb0a0db2f21e348fc1e/ghc >--------------------------------------------------------------- commit 61fdafcf96c2586710c9bbb0a0db2f21e348fc1e Author: Herbert Valerio Riedel Date: Wed May 14 12:33:31 2014 +0200 Drop use of CPP in `bin-package-db` This also removes the redundant `default-extensions` field in `bin-package-db.cabal` and adds an `other-extensions` field instead. Signed-off-by: Herbert Valerio Riedel >--------------------------------------------------------------- 61fdafcf96c2586710c9bbb0a0db2f21e348fc1e .../bin-package-db/Distribution/InstalledPackageInfo/Binary.hs | 7 +++---- libraries/bin-package-db/bin-package-db.cabal | 7 ++++++- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/libraries/bin-package-db/Distribution/InstalledPackageInfo/Binary.hs b/libraries/bin-package-db/Distribution/InstalledPackageInfo/Binary.hs index ab7fcf5..6ad1697 100644 --- a/libraries/bin-package-db/Distribution/InstalledPackageInfo/Binary.hs +++ b/libraries/bin-package-db/Distribution/InstalledPackageInfo/Binary.hs @@ -1,11 +1,10 @@ -{-# LANGUAGE CPP, RecordWildCards, TypeSynonymInstances, StandaloneDeriving, GeneralizedNewtypeDeriving #-} +{-# LANGUAGE RecordWildCards, Trustworthy, TypeSynonymInstances, StandaloneDeriving, + GeneralizedNewtypeDeriving #-} {-# OPTIONS_GHC -fno-warn-name-shadowing #-} -- This module deliberately defines orphan instances for now. Should -- become unnecessary once we move to using the binary package properly: {-# OPTIONS_GHC -fno-warn-orphans #-} -#if __GLASGOW_HASKELL__ >= 701 -{-# LANGUAGE Trustworthy #-} -#endif + ----------------------------------------------------------------------------- -- | -- Module : Distribution.InstalledPackageInfo.Binary diff --git a/libraries/bin-package-db/bin-package-db.cabal b/libraries/bin-package-db/bin-package-db.cabal index 699a1dd..dd84f9c 100644 --- a/libraries/bin-package-db/bin-package-db.cabal +++ b/libraries/bin-package-db/bin-package-db.cabal @@ -14,6 +14,12 @@ source-repository head Library default-language: Haskell2010 + other-extensions: + GeneralizedNewtypeDeriving + RecordWildCards + StandaloneDeriving + Trustworthy + TypeSynonymInstances exposed-modules: Distribution.InstalledPackageInfo.Binary @@ -22,4 +28,3 @@ Library binary >= 0.5 && < 0.8, Cabal >= 1.20 && < 1.21 - default-extensions: CPP From git at git.haskell.org Thu May 15 08:33:08 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 15 May 2014 08:33:08 +0000 (UTC) Subject: [commit: ghc] master: Avoid trivial cases of NondecreasingIndentation (e199891) Message-ID: <20140515083308.8D7AB2406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/e199891f199795468cdcf977d5395d3c846cad72/ghc >--------------------------------------------------------------- commit e199891f199795468cdcf977d5395d3c846cad72 Author: Herbert Valerio Riedel Date: Thu May 15 09:51:51 2014 +0200 Avoid trivial cases of NondecreasingIndentation This cleanup allows the following refactoring commit to avoid adding a few `{-# LANGUAGE NondecreasingIndentation #-}` pragmas. Signed-off-by: Herbert Valerio Riedel >--------------------------------------------------------------- e199891f199795468cdcf977d5395d3c846cad72 compiler/llvmGen/LlvmCodeGen/CodeGen.hs | 4 ++-- compiler/main/HeaderInfo.hs | 4 ++-- compiler/utils/Binary.hs | 7 +++---- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/compiler/llvmGen/LlvmCodeGen/CodeGen.hs b/compiler/llvmGen/LlvmCodeGen/CodeGen.hs index 808c591..1140145 100644 --- a/compiler/llvmGen/LlvmCodeGen/CodeGen.hs +++ b/compiler/llvmGen/LlvmCodeGen/CodeGen.hs @@ -1002,8 +1002,8 @@ genMachOp _ op [x] = case op of sameConv from ty reduce expand = do x'@(vx, stmts, top) <- exprToVar x let sameConv' op = do - (v1, s1) <- doExpr ty $ Cast op vx ty - return (v1, stmts `snocOL` s1, top) + (v1, s1) <- doExpr ty $ Cast op vx ty + return (v1, stmts `snocOL` s1, top) dflags <- getDynFlags let toWidth = llvmWidthInBits dflags ty -- LLVM doesn't like trying to convert to same width, so diff --git a/compiler/main/HeaderInfo.hs b/compiler/main/HeaderInfo.hs index a083f4f..3e1edc3 100644 --- a/compiler/main/HeaderInfo.hs +++ b/compiler/main/HeaderInfo.hs @@ -185,8 +185,8 @@ lazyGetToks dflags filename handle = do -- large module names (#5981) nextbuf <- hGetStringBufferBlock handle new_size if (len nextbuf == 0) then lazyLexBuf handle state True new_size else do - newbuf <- appendStringBuffers (buffer state) nextbuf - unsafeInterleaveIO $ lazyLexBuf handle state{buffer=newbuf} False new_size + newbuf <- appendStringBuffers (buffer state) nextbuf + unsafeInterleaveIO $ lazyLexBuf handle state{buffer=newbuf} False new_size getToks :: DynFlags -> FilePath -> StringBuffer -> [Located Token] diff --git a/compiler/utils/Binary.hs b/compiler/utils/Binary.hs index 332bfc8..e9b7123 100644 --- a/compiler/utils/Binary.hs +++ b/compiler/utils/Binary.hs @@ -707,14 +707,13 @@ getBS bh = do l <- get bh fp <- mallocForeignPtrBytes l withForeignPtr fp $ \ptr -> do - let - go n | n == l = return $ BS.fromForeignPtr fp 0 l + let go n | n == l = return $ BS.fromForeignPtr fp 0 l | otherwise = do b <- getByte bh pokeElemOff ptr n b go (n+1) - -- - go 0 + -- + go 0 instance Binary ByteString where put_ bh f = putBS bh f From git at git.haskell.org Thu May 15 08:33:12 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 15 May 2014 08:33:12 +0000 (UTC) Subject: [commit: ghc] master: Add LANGUAGE pragmas to compiler/ source files (2389244) Message-ID: <20140515083312.68CF02406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/23892440032fcab8a6a753916d506857674169ec/ghc >--------------------------------------------------------------- commit 23892440032fcab8a6a753916d506857674169ec Author: Herbert Valerio Riedel Date: Wed May 14 19:46:28 2014 +0200 Add LANGUAGE pragmas to compiler/ source files In some cases, the layout of the LANGUAGE/OPTIONS_GHC lines has been reorganized, while following the convention, to - place `{-# LANGUAGE #-}` pragmas at the top of the source file, before any `{-# OPTIONS_GHC #-}`-lines. - Moreover, if the list of language extensions fit into a single `{-# LANGUAGE ... -#}`-line (shorter than 80 characters), keep it on one line. Otherwise split into `{-# LANGUAGE ... -#}`-lines for each individual language extension. In both cases, try to keep the enumeration alphabetically ordered. (The latter layout is preferable as it's more diff-friendly) While at it, this also replaces obsolete `{-# OPTIONS ... #-}` pragma occurences by `{-# OPTIONS_GHC ... #-}` pragmas. >--------------------------------------------------------------- 23892440032fcab8a6a753916d506857674169ec compiler/basicTypes/ConLike.lhs | 1 + compiler/basicTypes/DataCon.lhs | 3 +- compiler/basicTypes/Demand.lhs | 1 + compiler/basicTypes/Id.lhs | 2 ++ compiler/basicTypes/IdInfo.lhs | 2 +- compiler/basicTypes/Literal.lhs | 2 +- compiler/basicTypes/MkId.lhs | 3 +- compiler/basicTypes/Module.lhs | 1 + compiler/basicTypes/Name.lhs | 2 ++ compiler/basicTypes/NameEnv.lhs | 3 +- compiler/basicTypes/NameSet.lhs | 3 +- compiler/basicTypes/OccName.lhs | 4 ++- compiler/basicTypes/PatSyn.lhs | 1 + compiler/basicTypes/RdrName.lhs | 2 +- compiler/basicTypes/SrcLoc.lhs | 1 + compiler/basicTypes/UniqSupply.lhs | 2 ++ compiler/basicTypes/Unique.lhs | 2 +- compiler/basicTypes/Var.lhs | 3 +- compiler/basicTypes/VarSet.lhs | 3 +- compiler/cmm/Bitmap.hs | 2 ++ compiler/cmm/BlockId.hs | 4 ++- compiler/cmm/Cmm.hs | 2 +- compiler/cmm/CmmBuildInfoTables.hs | 2 +- compiler/cmm/CmmCallConv.hs | 1 + compiler/cmm/CmmExpr.hs | 3 ++ compiler/cmm/CmmInfo.hs | 3 +- compiler/cmm/CmmLayoutStack.hs | 2 +- compiler/cmm/CmmLive.hs | 1 + compiler/cmm/CmmMachOp.hs | 1 + compiler/cmm/CmmNode.hs | 7 +++- compiler/cmm/CmmOpt.hs | 2 ++ compiler/cmm/CmmPipeline.hs | 2 ++ compiler/cmm/CmmType.hs | 1 + compiler/cmm/CmmUtils.hs | 2 +- compiler/cmm/Hoopl.hs | 2 ++ compiler/cmm/Hoopl/Dataflow.hs | 13 ++++--- compiler/cmm/MkGraph.hs | 2 +- compiler/cmm/PprC.hs | 3 +- compiler/cmm/PprCmm.hs | 5 +-- compiler/cmm/PprCmmDecl.hs | 2 ++ compiler/cmm/SMRep.lhs | 2 +- compiler/codeGen/CgUtils.hs | 3 +- compiler/codeGen/CodeGen/Platform/ARM.hs | 1 + compiler/codeGen/CodeGen/Platform/NoRegs.hs | 1 + compiler/codeGen/CodeGen/Platform/PPC.hs | 1 + compiler/codeGen/CodeGen/Platform/PPC_Darwin.hs | 1 + compiler/codeGen/CodeGen/Platform/SPARC.hs | 1 + compiler/codeGen/CodeGen/Platform/X86.hs | 1 + compiler/codeGen/CodeGen/Platform/X86_64.hs | 1 + compiler/codeGen/StgCmm.hs | 2 ++ compiler/codeGen/StgCmmBind.hs | 2 ++ compiler/codeGen/StgCmmClosure.hs | 4 +-- compiler/codeGen/StgCmmCon.hs | 2 ++ compiler/codeGen/StgCmmEnv.hs | 2 ++ compiler/codeGen/StgCmmExpr.hs | 2 ++ compiler/codeGen/StgCmmForeign.hs | 2 ++ compiler/codeGen/StgCmmHeap.hs | 2 ++ compiler/codeGen/StgCmmLayout.hs | 2 ++ compiler/codeGen/StgCmmMonad.hs | 3 +- compiler/codeGen/StgCmmPrim.hs | 2 ++ compiler/codeGen/StgCmmProf.hs | 2 ++ compiler/codeGen/StgCmmTicky.hs | 2 ++ compiler/codeGen/StgCmmUtils.hs | 2 ++ compiler/coreSyn/CoreArity.lhs | 3 +- compiler/coreSyn/CoreFVs.lhs | 2 ++ compiler/coreSyn/CoreLint.lhs | 7 +--- compiler/coreSyn/CorePrep.lhs | 2 +- compiler/coreSyn/CoreSubst.lhs | 3 +- compiler/coreSyn/CoreSyn.lhs | 5 ++- compiler/coreSyn/CoreTidy.lhs | 3 +- compiler/coreSyn/CoreUnfold.lhs | 3 +- compiler/coreSyn/CoreUtils.lhs | 2 ++ compiler/coreSyn/MkCore.lhs | 3 +- compiler/coreSyn/TrieMap.lhs | 4 +-- compiler/deSugar/Check.lhs | 2 ++ compiler/deSugar/Coverage.lhs | 2 ++ compiler/deSugar/Desugar.lhs | 2 ++ compiler/deSugar/DsArrows.lhs | 3 +- compiler/deSugar/DsBinds.lhs | 3 +- compiler/deSugar/DsCCall.lhs | 3 +- compiler/deSugar/DsExpr.lhs | 2 ++ compiler/deSugar/DsForeign.lhs | 2 ++ compiler/deSugar/DsGRHSs.lhs | 2 ++ compiler/deSugar/DsListComp.lhs | 2 +- compiler/deSugar/DsMeta.hs | 2 ++ compiler/deSugar/DsMonad.lhs | 2 ++ compiler/deSugar/DsUtils.lhs | 3 +- compiler/deSugar/Match.lhs | 2 ++ compiler/deSugar/MatchCon.lhs | 3 +- compiler/deSugar/MatchLit.lhs | 2 ++ compiler/ghc.cabal.in | 41 ++++++++++++++++------ compiler/ghci/ByteCodeAsm.lhs | 4 +-- compiler/ghci/ByteCodeGen.lhs | 3 +- compiler/ghci/ByteCodeInstr.lhs | 3 +- compiler/ghci/ByteCodeItbls.lhs | 3 +- compiler/ghci/ByteCodeLink.lhs | 7 +++- compiler/ghci/Debugger.hs | 2 ++ compiler/ghci/DebuggerUtils.hs | 2 ++ compiler/ghci/Linker.lhs | 7 ++-- compiler/ghci/RtClosureInspect.hs | 4 ++- compiler/hsSyn/Convert.lhs | 2 ++ compiler/hsSyn/HsDoc.hs | 2 +- compiler/hsSyn/HsExpr.lhs | 2 +- compiler/hsSyn/HsLit.lhs | 4 +-- compiler/hsSyn/HsUtils.lhs | 3 +- compiler/iface/BinIface.hs | 2 ++ compiler/iface/BuildTyCl.lhs | 3 +- compiler/iface/IfaceEnv.lhs | 3 +- compiler/iface/IfaceSyn.lhs | 3 +- compiler/iface/LoadIface.lhs | 1 + compiler/iface/MkIface.lhs | 2 ++ compiler/iface/TcIface.lhs | 2 ++ compiler/llvmGen/Llvm/PpLlvm.hs | 2 ++ compiler/llvmGen/Llvm/Types.hs | 2 +- compiler/llvmGen/LlvmCodeGen.hs | 4 +-- compiler/llvmGen/LlvmCodeGen/Base.hs | 2 ++ compiler/llvmGen/LlvmCodeGen/CodeGen.hs | 5 ++- compiler/llvmGen/LlvmCodeGen/Data.hs | 1 + compiler/llvmGen/LlvmCodeGen/Ppr.hs | 3 +- compiler/llvmGen/LlvmCodeGen/Regs.hs | 2 ++ compiler/llvmGen/LlvmMangler.hs | 2 ++ compiler/main/BreakArray.hs | 2 ++ compiler/main/CmdLineParser.hs | 2 ++ compiler/main/CodeOutput.lhs | 2 ++ compiler/main/DriverMkDepend.hs | 2 ++ compiler/main/DriverPhases.hs | 2 ++ compiler/main/DriverPipeline.hs | 4 +-- compiler/main/DynFlags.hs | 4 ++- compiler/main/DynamicLoading.hs | 2 ++ compiler/main/ErrUtils.lhs | 1 + compiler/main/Finder.lhs | 2 ++ compiler/main/GHC.hs | 2 ++ compiler/main/GhcMake.hs | 2 +- compiler/main/GhcMonad.hs | 1 + compiler/main/HeaderInfo.hs | 2 ++ compiler/main/HscMain.hs | 2 ++ compiler/main/HscTypes.lhs | 1 + compiler/main/InteractiveEval.hs | 2 ++ compiler/main/InteractiveEvalTypes.hs | 2 ++ compiler/main/PackageConfig.hs | 2 ++ compiler/main/Packages.lhs | 2 ++ compiler/main/PlatformConstants.hs | 2 ++ compiler/main/PprTyThing.hs | 2 +- compiler/main/StaticFlags.hs | 3 +- compiler/main/SysTools.lhs | 2 ++ compiler/main/TidyPgm.lhs | 2 ++ compiler/nativeGen/AsmCodeGen.lhs | 3 +- compiler/nativeGen/NCGMonad.hs | 2 ++ compiler/nativeGen/PPC/CodeGen.hs | 2 +- compiler/nativeGen/PPC/Cond.hs | 2 +- compiler/nativeGen/PPC/Instr.hs | 2 ++ compiler/nativeGen/PPC/RegInfo.hs | 4 ++- compiler/nativeGen/PPC/Regs.hs | 2 ++ compiler/nativeGen/Reg.hs | 2 +- compiler/nativeGen/RegAlloc/Graph/Main.hs | 2 ++ compiler/nativeGen/RegAlloc/Graph/Stats.hs | 1 + compiler/nativeGen/RegAlloc/Graph/TrivColorable.hs | 2 +- compiler/nativeGen/RegAlloc/Linear/FreeRegs.hs | 1 + compiler/nativeGen/RegAlloc/Linear/Main.hs | 2 ++ compiler/nativeGen/RegAlloc/Linear/PPC/FreeRegs.hs | 1 - compiler/nativeGen/RegAlloc/Linear/State.hs | 2 ++ compiler/nativeGen/RegAlloc/Liveness.hs | 7 +++- compiler/nativeGen/RegClass.hs | 2 +- compiler/nativeGen/SPARC/CodeGen.hs | 2 ++ compiler/nativeGen/SPARC/CodeGen/Amode.hs | 2 +- compiler/nativeGen/SPARC/CodeGen/Base.hs | 2 +- compiler/nativeGen/SPARC/CodeGen/CondCode.hs | 2 +- compiler/nativeGen/SPARC/CodeGen/Expand.hs | 2 +- compiler/nativeGen/SPARC/CodeGen/Gen32.hs | 2 +- compiler/nativeGen/SPARC/CodeGen/Sanity.hs | 2 +- compiler/nativeGen/SPARC/Cond.hs | 2 +- compiler/nativeGen/SPARC/Imm.hs | 2 +- compiler/nativeGen/SPARC/Instr.hs | 4 ++- compiler/nativeGen/SPARC/Ppr.hs | 2 ++ compiler/nativeGen/SPARC/Regs.hs | 2 +- compiler/nativeGen/SPARC/ShortcutJump.hs | 2 +- compiler/nativeGen/SPARC/Stack.hs | 2 +- compiler/nativeGen/Size.hs | 2 +- compiler/nativeGen/TargetReg.hs | 4 +-- compiler/nativeGen/X86/CodeGen.hs | 3 +- compiler/nativeGen/X86/Instr.hs | 9 ++--- compiler/nativeGen/X86/Ppr.hs | 2 ++ compiler/nativeGen/X86/RegInfo.hs | 4 +-- compiler/nativeGen/X86/Regs.hs | 2 ++ compiler/parser/Ctype.lhs | 3 +- compiler/parser/RdrHsSyn.lhs | 2 ++ compiler/prelude/PrelInfo.lhs | 3 +- compiler/prelude/PrelNames.lhs | 2 ++ compiler/prelude/PrelRules.lhs | 4 +-- compiler/prelude/PrimOp.lhs | 2 ++ compiler/prelude/TysPrim.lhs | 3 +- compiler/prelude/TysWiredIn.lhs | 2 ++ compiler/profiling/CostCentre.lhs | 2 +- compiler/profiling/SCCfinal.lhs | 2 ++ compiler/rename/RnBinds.lhs | 2 +- compiler/rename/RnEnv.lhs | 2 ++ compiler/rename/RnExpr.lhs | 2 ++ compiler/rename/RnNames.lhs | 2 ++ compiler/rename/RnPat.lhs | 7 +--- compiler/rename/RnSource.lhs | 2 ++ compiler/rename/RnSplice.lhs | 2 ++ compiler/rename/RnTypes.lhs | 2 ++ compiler/simplCore/CSE.lhs | 2 ++ compiler/simplCore/CoreMonad.lhs | 5 ++- compiler/simplCore/FloatIn.lhs | 3 +- compiler/simplCore/FloatOut.lhs | 3 +- compiler/simplCore/LiberateCase.lhs | 3 +- compiler/simplCore/OccurAnal.lhs | 3 +- compiler/simplCore/SAT.lhs | 3 +- compiler/simplCore/SetLevels.lhs | 3 +- compiler/simplCore/SimplCore.lhs | 2 ++ compiler/simplCore/SimplEnv.lhs | 2 ++ compiler/simplCore/SimplUtils.lhs | 2 ++ compiler/simplCore/Simplify.lhs | 2 ++ compiler/simplStg/SimplStg.lhs | 2 ++ compiler/simplStg/StgStats.lhs | 2 ++ compiler/simplStg/UnariseStg.lhs | 2 ++ compiler/specialise/Rules.lhs | 2 ++ compiler/specialise/SpecConstr.lhs | 2 ++ compiler/specialise/Specialise.lhs | 2 ++ compiler/stgSyn/CoreToStg.lhs | 2 ++ compiler/stgSyn/StgLint.lhs | 2 ++ compiler/stgSyn/StgSyn.lhs | 1 + compiler/stranal/DmdAnal.lhs | 3 +- compiler/stranal/WorkWrap.lhs | 3 +- compiler/stranal/WwLib.lhs | 2 ++ compiler/typecheck/FamInst.lhs | 4 +-- compiler/typecheck/FunDeps.lhs | 2 ++ compiler/typecheck/Inst.lhs | 3 +- compiler/typecheck/TcAnnotations.lhs | 2 ++ compiler/typecheck/TcArrows.lhs | 3 +- compiler/typecheck/TcBinds.lhs | 2 ++ compiler/typecheck/TcCanonical.lhs | 2 ++ compiler/typecheck/TcClassDcl.lhs | 3 +- compiler/typecheck/TcDefaults.lhs | 2 +- compiler/typecheck/TcDeriv.lhs | 2 ++ compiler/typecheck/TcEnv.lhs | 2 ++ compiler/typecheck/TcErrors.lhs | 4 +-- compiler/typecheck/TcEvidence.lhs | 2 ++ compiler/typecheck/TcExpr.lhs | 2 ++ compiler/typecheck/TcForeign.lhs | 2 ++ compiler/typecheck/TcGenDeriv.lhs | 2 +- compiler/typecheck/TcGenGenerics.lhs | 4 +-- compiler/typecheck/TcHsSyn.lhs | 2 ++ compiler/typecheck/TcHsType.lhs | 3 +- compiler/typecheck/TcInstDcls.lhs | 3 +- compiler/typecheck/TcInteract.lhs | 2 ++ compiler/typecheck/TcMType.lhs | 3 +- compiler/typecheck/TcMatches.lhs | 3 +- compiler/typecheck/TcPat.lhs | 3 +- compiler/typecheck/TcPatSyn.lhs | 2 ++ compiler/typecheck/TcRnDriver.lhs | 2 ++ compiler/typecheck/TcRnMonad.lhs | 2 ++ compiler/typecheck/TcRnTypes.lhs | 2 ++ compiler/typecheck/TcRules.lhs | 2 +- compiler/typecheck/TcSMonad.lhs | 3 +- compiler/typecheck/TcSimplify.lhs | 2 ++ compiler/typecheck/TcSplice.lhs | 3 +- compiler/typecheck/TcSplice.lhs-boot | 2 ++ compiler/typecheck/TcTyClsDecls.lhs | 2 +- compiler/typecheck/TcTyDecls.lhs | 3 +- compiler/typecheck/TcType.lhs | 2 ++ compiler/typecheck/TcUnify.lhs | 3 +- compiler/typecheck/TcValidity.lhs | 2 ++ compiler/types/Class.lhs | 3 +- compiler/types/CoAxiom.lhs | 2 +- compiler/types/Coercion.lhs | 2 ++ compiler/types/FamInstEnv.lhs | 3 +- compiler/types/InstEnv.lhs | 2 ++ compiler/types/Kind.lhs | 3 +- compiler/types/OptCoercion.lhs | 3 +- compiler/types/TyCon.lhs | 1 + compiler/types/Type.lhs | 1 + compiler/types/TypeRep.lhs | 8 ++--- compiler/types/Unify.lhs | 3 +- compiler/utils/Bag.lhs | 2 ++ compiler/utils/Binary.hs | 2 +- compiler/utils/BufWrite.hs | 4 ++- compiler/utils/Digraph.lhs | 4 +-- compiler/utils/Encoding.hs | 2 +- compiler/utils/ExtsCompat46.hs | 2 +- compiler/utils/FastBool.lhs | 2 ++ compiler/utils/FastFunctions.lhs | 1 + compiler/utils/FastMutInt.lhs | 3 +- compiler/utils/FastString.lhs | 2 +- compiler/utils/FastTypes.lhs | 1 + compiler/utils/Fingerprint.hsc | 2 ++ compiler/utils/GraphBase.hs | 2 +- compiler/utils/GraphPpr.hs | 2 +- compiler/utils/IOEnv.hs | 3 +- compiler/utils/ListSetOps.lhs | 1 + compiler/utils/Pair.lhs | 2 ++ compiler/utils/Panic.lhs | 2 ++ compiler/utils/Pretty.lhs | 2 +- compiler/utils/Serialized.hs | 3 +- compiler/utils/State.hs | 1 + compiler/utils/StringBuffer.lhs | 2 +- compiler/utils/UniqFM.lhs | 4 +-- compiler/utils/Util.lhs | 1 + compiler/vectorise/Vectorise/Exp.hs | 2 +- compiler/vectorise/Vectorise/Monad/InstEnv.hs | 2 ++ compiler/vectorise/Vectorise/Type/Env.hs | 2 ++ compiler/vectorise/Vectorise/Utils/Base.hs | 2 ++ 303 files changed, 583 insertions(+), 201 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 23892440032fcab8a6a753916d506857674169ec From git at git.haskell.org Thu May 15 12:04:24 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 15 May 2014 12:04:24 +0000 (UTC) Subject: [commit: ghc] master: Express OPTIONS_GHC as LANGUAGE pragmas (9a58cac) Message-ID: <20140515120424.4CCD82406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/9a58cac8c964ecd475bd8a7bbffc435f1ed130b2/ghc >--------------------------------------------------------------- commit 9a58cac8c964ecd475bd8a7bbffc435f1ed130b2 Author: Herbert Valerio Riedel Date: Thu May 15 13:52:14 2014 +0200 Express OPTIONS_GHC as LANGUAGE pragmas These two instances were missed previously for some unknown reason Signed-off-by: Herbert Valerio Riedel >--------------------------------------------------------------- 9a58cac8c964ecd475bd8a7bbffc435f1ed130b2 libraries/base/GHC/IP.hs | 2 +- libraries/base/GHC/TypeLits.hs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/libraries/base/GHC/IP.hs b/libraries/base/GHC/IP.hs index 4794c05..95b00c1 100644 --- a/libraries/base/GHC/IP.hs +++ b/libraries/base/GHC/IP.hs @@ -2,7 +2,7 @@ {-# LANGUAGE FunctionalDependencies #-} {-# LANGUAGE KindSignatures #-} {-# LANGUAGE DataKinds #-} -{-# OPTIONS_GHC -XNoImplicitPrelude #-} +{-# LANGUAGE NoImplicitPrelude #-} -- | /Since: 4.6.0.0/ module GHC.IP (IP(..)) where diff --git a/libraries/base/GHC/TypeLits.hs b/libraries/base/GHC/TypeLits.hs index 083ae4d..53a6004 100644 --- a/libraries/base/GHC/TypeLits.hs +++ b/libraries/base/GHC/TypeLits.hs @@ -9,7 +9,8 @@ {-# LANGUAGE ExistentialQuantification #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE UndecidableInstances #-} -- for compiling instances of (==) -{-# OPTIONS_GHC -XNoImplicitPrelude #-} +{-# LANGUAGE NoImplicitPrelude #-} + {-| This module is an internal GHC module. It declares the constants used in the implementation of type-level natural numbers. The programmer interface for working with type-level naturals should be defined in a separate library. From git at git.haskell.org Thu May 15 15:07:36 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 15 May 2014 15:07:36 +0000 (UTC) Subject: [commit: ghc] master: Refactoring around TyCon.isSynTyCon (022f875) Message-ID: <20140515150736.D19D62406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/022f8750edf6f413fba31293435dcc62600eab77/ghc >--------------------------------------------------------------- commit 022f8750edf6f413fba31293435dcc62600eab77 Author: Simon Peyton Jones Date: Thu May 15 16:07:04 2014 +0100 Refactoring around TyCon.isSynTyCon * Document isSynTyCon better * Add isTypeSyonymTyCon for regular H98 type synonyms * Use isTypeSynonymTyCon rather than isSynTyCon where the former is really intended All arose as part of a bug I introduced when fixing Trac #9102, thinking that isSynTyCon meant H98 type syononyms. >--------------------------------------------------------------- 022f8750edf6f413fba31293435dcc62600eab77 compiler/main/PprTyThing.hs | 2 +- compiler/typecheck/TcDeriv.lhs | 1 + compiler/typecheck/TcInstDcls.lhs | 7 +++--- compiler/typecheck/TcTyClsDecls.lhs | 20 ++++++++--------- compiler/typecheck/TcTyDecls.lhs | 8 +++---- compiler/typecheck/TcType.lhs | 2 +- compiler/typecheck/TcValidity.lhs | 2 +- compiler/types/TyCon.lhs | 45 ++++++++++++++++++++----------------- 8 files changed, 45 insertions(+), 42 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 022f8750edf6f413fba31293435dcc62600eab77 From git at git.haskell.org Fri May 16 08:52:59 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 16 May 2014 08:52:59 +0000 (UTC) Subject: [commit: ghc] master: Only uninstall signal handlers if they were actually installed (#9068) (bc7d49a) Message-ID: <20140516085259.E173C2406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/bc7d49a658a516679cc264502e72560c1d2c2314/ghc >--------------------------------------------------------------- commit bc7d49a658a516679cc264502e72560c1d2c2314 Author: Simon Marlow Date: Wed May 14 21:10:06 2014 +0100 Only uninstall signal handlers if they were actually installed (#9068) Submitted by: tomgr >--------------------------------------------------------------- bc7d49a658a516679cc264502e72560c1d2c2314 rts/RtsStartup.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/rts/RtsStartup.c b/rts/RtsStartup.c index aa7306f..15e48a6 100644 --- a/rts/RtsStartup.c +++ b/rts/RtsStartup.c @@ -355,8 +355,12 @@ hs_exit_(rtsBool wait_foreign) resetTerminalSettings(); #endif - // uninstall signal handlers - resetDefaultHandlers(); +#if defined(RTS_USER_SIGNALS) + if (RtsFlags.MiscFlags.install_signal_handlers) { + // uninstall signal handlers + resetDefaultHandlers(); + } +#endif /* stop timing the shutdown, we're about to print stats */ stat_endExit(); From git at git.haskell.org Mon May 19 05:10:27 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 19 May 2014 05:10:27 +0000 (UTC) Subject: [commit: ghc] master: ghc: Update containers submodule (882978d) Message-ID: <20140519051027.B11B12406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/882978dd56513faab1c76ad5b8271a7623fd5f56/ghc >--------------------------------------------------------------- commit 882978dd56513faab1c76ad5b8271a7623fd5f56 Author: Austin Seipp Date: Sun May 18 16:58:46 2014 -0500 ghc: Update containers submodule Also update a few tests, since containers now has IsList instances. Signed-off-by: Austin Seipp >--------------------------------------------------------------- 882978dd56513faab1c76ad5b8271a7623fd5f56 libraries/containers | 2 +- .../tests/overloadedlists/should_run/overloadedlistsrun02.hs | 5 ----- .../tests/overloadedlists/should_run/overloadedlistsrun04.hs | 8 -------- 3 files changed, 1 insertion(+), 14 deletions(-) diff --git a/libraries/containers b/libraries/containers index e787f05..e84c5d2 160000 --- a/libraries/containers +++ b/libraries/containers @@ -1 +1 @@ -Subproject commit e787f05e7ef7b07363bd04962af8b1ec65693888 +Subproject commit e84c5d2145415cb0beacce0909a551ae5e28d396 diff --git a/testsuite/tests/overloadedlists/should_run/overloadedlistsrun02.hs b/testsuite/tests/overloadedlists/should_run/overloadedlistsrun02.hs index 8567db3..a6b9bb8 100644 --- a/testsuite/tests/overloadedlists/should_run/overloadedlistsrun02.hs +++ b/testsuite/tests/overloadedlists/should_run/overloadedlistsrun02.hs @@ -6,8 +6,3 @@ import GHC.Exts main = do print ([] :: (S.Set Int)) print (['a','b','c'] :: (S.Set Char)) print (['a','c'..'g'] :: (S.Set Char)) - -instance Ord a => IsList (S.Set a) where - type (Item (S.Set a)) = a - fromList = S.fromList - toList = S.toList diff --git a/testsuite/tests/overloadedlists/should_run/overloadedlistsrun04.hs b/testsuite/tests/overloadedlists/should_run/overloadedlistsrun04.hs index 478d8d2..1111f93 100644 --- a/testsuite/tests/overloadedlists/should_run/overloadedlistsrun04.hs +++ b/testsuite/tests/overloadedlists/should_run/overloadedlistsrun04.hs @@ -18,11 +18,3 @@ f [_] = "one element" f [2,_] = "two elements, the smaller one is 2" f [_,2] = "two elements, the bigger one is 2" f _ = "else" - - -instance Ord a => IsList (S.Set a) where - type (Item (S.Set a)) = a - fromList = S.fromList - toList = S.toList - - From git at git.haskell.org Mon May 19 05:10:30 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 19 May 2014 05:10:30 +0000 (UTC) Subject: [commit: ghc] master: base: Document Foreign.ForeignPtr (#8475) (4dac3a4) Message-ID: <20140519051030.AAFB32406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/4dac3a4124e5b3bb2ef8f9105f8921dcbb5183f7/ghc >--------------------------------------------------------------- commit 4dac3a4124e5b3bb2ef8f9105f8921dcbb5183f7 Author: Chris Heller Date: Sun May 18 21:31:14 2014 -0500 base: Document Foreign.ForeignPtr (#8475) Signed-off-by: Austin Seipp >--------------------------------------------------------------- 4dac3a4124e5b3bb2ef8f9105f8921dcbb5183f7 libraries/base/Foreign/ForeignPtr.hs | 1 - 1 file changed, 1 deletion(-) diff --git a/libraries/base/Foreign/ForeignPtr.hs b/libraries/base/Foreign/ForeignPtr.hs index 0017c0e..2e9b9ec 100644 --- a/libraries/base/Foreign/ForeignPtr.hs +++ b/libraries/base/Foreign/ForeignPtr.hs @@ -1,6 +1,5 @@ {-# LANGUAGE Unsafe #-} {-# LANGUAGE NoImplicitPrelude #-} -{-# OPTIONS_HADDOCK hide #-} ----------------------------------------------------------------------------- -- | From git at git.haskell.org Mon May 19 05:10:34 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 19 May 2014 05:10:34 +0000 (UTC) Subject: [commit: ghc] master: rts: remove stable-names from hashtable upon free (b75d126) Message-ID: <20140519051034.2A08B2406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/b75d126e779e8690c675be84e8972dc023e04b9b/ghc >--------------------------------------------------------------- commit b75d126e779e8690c675be84e8972dc023e04b9b Author: Edward Z. Yang Date: Sun May 18 21:32:10 2014 -0500 rts: remove stable-names from hashtable upon free This fixes #9078. Signed-off-by: Austin Seipp >--------------------------------------------------------------- b75d126e779e8690c675be84e8972dc023e04b9b rts/Stable.c | 1 + testsuite/tests/rts/T9078.hs | 10 ++++++++++ testsuite/tests/rts/T9078.stderr | 2 ++ testsuite/tests/rts/all.T | 3 +++ 4 files changed, 16 insertions(+) diff --git a/rts/Stable.c b/rts/Stable.c index ec74b0d..431b7c6 100644 --- a/rts/Stable.c +++ b/rts/Stable.c @@ -246,6 +246,7 @@ STATIC_INLINE void freeSnEntry(snEntry *sn) { ASSERT(sn->sn_obj == NULL); + removeHashTable(addrToStableHash, (W_)sn->old, NULL); sn->addr = (P_)stable_name_free; stable_name_free = sn; } diff --git a/testsuite/tests/rts/T9078.hs b/testsuite/tests/rts/T9078.hs new file mode 100644 index 0000000..d0389f1 --- /dev/null +++ b/testsuite/tests/rts/T9078.hs @@ -0,0 +1,10 @@ +module Main where + +import Control.Monad +import System.Mem.StableName + +main :: IO () +main = replicateM_ 500000 (makeStableName foo) + +foo :: Int +foo = 1 diff --git a/testsuite/tests/rts/T9078.stderr b/testsuite/tests/rts/T9078.stderr new file mode 100644 index 0000000..901a1ca --- /dev/null +++ b/testsuite/tests/rts/T9078.stderr @@ -0,0 +1,2 @@ +cap 0: initialised +cap 0: shutting down diff --git a/testsuite/tests/rts/all.T b/testsuite/tests/rts/all.T index f5a72f8..a56a3f3 100644 --- a/testsuite/tests/rts/all.T +++ b/testsuite/tests/rts/all.T @@ -227,3 +227,6 @@ test('T8124', [ only_ways(threaded_ways), omit_ways(['ghci']), # The ghci way gets confused by the RTS options test('T9045', [ omit_ways(['ghci']), extra_run_opts('10000 +RTS -A8k -RTS') ], compile_and_run, ['']) +# I couldn't reproduce 9078 with the -threaded runtime, but could easily +# with the non-threaded one. +test('T9078', [ omit_ways(threaded_ways) ], compile_and_run, ['-with-rtsopts="-DS" -debug']) From git at git.haskell.org Mon May 19 05:10:36 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 19 May 2014 05:10:36 +0000 (UTC) Subject: [commit: ghc] master: integer-gmp: do not confuse ./configure (#8783) (39aa1e9) Message-ID: <20140519051036.821EF2406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/39aa1e95f5ffaf3409ae9d741e4a886fcd38652b/ghc >--------------------------------------------------------------- commit 39aa1e95f5ffaf3409ae9d741e4a886fcd38652b Author: Christian Maeder Date: Sun May 18 21:36:40 2014 -0500 integer-gmp: do not confuse ./configure (#8783) Signed-off-by: Austin Seipp >--------------------------------------------------------------- 39aa1e95f5ffaf3409ae9d741e4a886fcd38652b libraries/integer-gmp/gmp/ghc.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/integer-gmp/gmp/ghc.mk b/libraries/integer-gmp/gmp/ghc.mk index ab89917..139ae93 100644 --- a/libraries/integer-gmp/gmp/ghc.mk +++ b/libraries/integer-gmp/gmp/ghc.mk @@ -146,7 +146,7 @@ libraries/integer-gmp/gmp/libgmp.a libraries/integer-gmp/gmp/gmp.h: PATH=`pwd`:$$PATH; \ export PATH; \ cd gmpbuild && \ - CC=$(CCX) NM=$(NM) AR=$(AR_STAGE1) $(SHELL) ./configure \ + CC=$(CCX) NM=$(NM) AR=$(AR_STAGE1) ./configure \ --enable-shared=no \ --host=$(HOSTPLATFORM) --build=$(BUILDPLATFORM) $(MAKE) -C libraries/integer-gmp/gmp/gmpbuild MAKEFLAGS= From git at git.haskell.org Mon May 19 05:10:38 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 19 May 2014 05:10:38 +0000 (UTC) Subject: [commit: ghc] master: Extract derived constants from nm output for various OSes differently. (3df1c51) Message-ID: <20140519051039.123E62406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/3df1c5109a6bd2a522717e524c10d842d4cd8ab8/ghc >--------------------------------------------------------------- commit 3df1c5109a6bd2a522717e524c10d842d4cd8ab8 Author: Christian Maeder Date: Thu Apr 3 10:00:07 2014 +0200 Extract derived constants from nm output for various OSes differently. Fixes #8783. In order to avoid querying the nm version that does not work on Mac OS X we use the "nm -P" output that is supposed to produce (more portable) POSIX output and works on all tested OSes (MinGW, Mac OS X, Solaris and Linux using GNU nm) although slightly different (as documented). The "nm -P" output is actually only needed to recognize the output of a non-GNU Solaris nm (all other OSes produce sane outut using "nm" only). Signed-off-by: Austin Seipp >--------------------------------------------------------------- 3df1c5109a6bd2a522717e524c10d842d4cd8ab8 utils/deriveConstants/DeriveConstants.hs | 37 +++++++++++++------------------- 1 file changed, 15 insertions(+), 22 deletions(-) diff --git a/utils/deriveConstants/DeriveConstants.hs b/utils/deriveConstants/DeriveConstants.hs index 8c943f0..6bfce24 100644 --- a/utils/deriveConstants/DeriveConstants.hs +++ b/utils/deriveConstants/DeriveConstants.hs @@ -641,7 +641,7 @@ getWanted verbose tmpdir gccProgram gccFlags nmProgram oFile = tmpdir "tmp.o" writeFile cFile cStuff execute verbose gccProgram (gccFlags ++ ["-c", cFile, "-o", oFile]) - xs <- readProcess nmProgram [oFile] "" + xs <- readProcess nmProgram ["-P", oFile] "" let ls = lines xs ms = map parseNmLine ls m = Map.fromList $ catMaybes ms @@ -710,28 +710,21 @@ getWanted verbose tmpdir gccProgram gccFlags nmProgram doWanted (ClosurePayloadMacro {}) = [] doWanted (FieldTypeGcptrMacro {}) = [] - -- parseNmLine parses nm output that looks like - -- "0000000b C derivedConstantMAX_Vanilla_REG" + -- parseNmLine parses "nm -P" output that looks like + -- "derivedConstantMAX_Vanilla_REG C 0000000b 0000000b" (GNU nm) + -- "_derivedConstantMAX_Vanilla_REG C b 0" (Mac OS X) + -- "_derivedConstantMAX_Vanilla_REG C 000000b" (MinGW) + -- "derivedConstantMAX_Vanilla_REG D 1 b" (Solaris) -- and returns ("MAX_Vanilla_REG", 11) - parseNmLine xs0 = case break (' ' ==) xs0 of - (x1, ' ' : xs1) -> - case break (' ' ==) xs1 of - (x2, ' ' : x3) -> - case readHex x1 of - [(size, "")] -> - case x2 of - "C" -> - let x3' = case x3 of - '_' : rest -> rest - _ -> x3 - in case stripPrefix prefix x3' of - Just name -> - Just (name, size) - _ -> Nothing - _ -> Nothing - _ -> Nothing - _ -> Nothing - _ -> Nothing + parseNmLine line + = case words line of + ('_' : n) : "C" : s : _ -> mkP n s + n : "C" : s : _ -> mkP n s + [n, "D", _, s] -> mkP n s + _ -> Nothing + where mkP r s = case (stripPrefix prefix r, readHex s) of + (Just name, [(size, "")]) -> Just (name, size) + _ -> Nothing -- If an Int value is larger than 2^28 or smaller -- than -2^28, then fail. From git at git.haskell.org Mon May 19 15:40:36 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 19 May 2014 15:40:36 +0000 (UTC) Subject: [commit: ghc] master: Remove the bit about External Core from flags.xml (eab173b) Message-ID: <20140519154037.085472406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/eab173b1e4eb588577d105ced57faff2c74cf0b2/ghc >--------------------------------------------------------------- commit eab173b1e4eb588577d105ced57faff2c74cf0b2 Author: Simon Peyton Jones Date: Fri May 16 08:35:25 2014 +0100 Remove the bit about External Core from flags.xml This is a lefover vestige from Austin's removal of External Core >--------------------------------------------------------------- eab173b1e4eb588577d105ced57faff2c74cf0b2 docs/users_guide/flags.xml | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/docs/users_guide/flags.xml b/docs/users_guide/flags.xml index dc7644a..063b573 100644 --- a/docs/users_guide/flags.xml +++ b/docs/users_guide/flags.xml @@ -2607,34 +2607,6 @@ - External core file options - - - - - - - - Flag - Description - Static/Dynamic - Reverse - - - - - - (deprecated) Generate .hcr external Core files - dynamic - - - - - - - - - - Compiler debugging options From git at git.haskell.org Mon May 19 15:40:39 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 19 May 2014 15:40:39 +0000 (UTC) Subject: [commit: ghc] master: Tighten up wording in the section on let-generalisation and MonoLocalBinds (3a61e6d) Message-ID: <20140519154039.A44812406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/3a61e6de311ad235aec9f0a55201656805e3c04e/ghc >--------------------------------------------------------------- commit 3a61e6de311ad235aec9f0a55201656805e3c04e Author: Simon Peyton Jones Date: Fri May 16 08:34:44 2014 +0100 Tighten up wording in the section on let-generalisation and MonoLocalBinds >--------------------------------------------------------------- 3a61e6de311ad235aec9f0a55201656805e3c04e docs/users_guide/glasgow_exts.xml | 49 ++++++++++++++++++++++++++++----------- 1 file changed, 35 insertions(+), 14 deletions(-) diff --git a/docs/users_guide/glasgow_exts.xml b/docs/users_guide/glasgow_exts.xml index dc381a4..e2513c2 100644 --- a/docs/users_guide/glasgow_exts.xml +++ b/docs/users_guide/glasgow_exts.xml @@ -8112,12 +8112,30 @@ pattern binding must have the same context. For example, this is fine: An ML-style language usually generalises the type of any let-bound or where-bound variable, so that it is as polymorphic as possible. -With the flag GHC implements a slightly more conservative policy: -it generalises only "closed" bindings. -A binding is considered "closed" if either +With the flag GHC implements a slightly more conservative policy, +using the following rules: -It is one of the top-level bindings of a module, or -Its free variables are all themselves closed + + A variable is closed if and only if + + the variable is let-bound + one of the following holds: + + the variable has an explicit type signature that has no free type variables, or + its binding group is fully generalised (see next bullet) + + + + + + + A binding group is fully generalised if and only if + + each of its free variables is either imported or closed, and + the binding is not affected by the monomorphism restriction + (Haskell Report, Section 4.5.5) + + For example, consider @@ -8126,15 +8144,18 @@ g x = let h y = f y * 2 k z = z+x in h x + k x -Here f and g are closed because they are bound at top level. -Also h is closed because its only free variable f is closed. -But k is not closed because it mentions x which is locally bound. -Another way to think of it is this: all closed bindings could be defined at top level. -(In the example, we could move h to top level.) - -All of this applies only to bindings that lack an explicit type signature, so that GHC has to -infer its type. If you supply a type signature, then that fixes type of the binding, end of story. - +Here f is generalised because it has no free variables; and its binding group +in unaffected by the monomorphism restriction; and hence f is closed. +The same reasoning applies to g, except that it has one closed free variable, namely f. +Similarly h is closed, even though it is not bound at top level, +because its only free variable f is closed. +But k is not closed because it mentions x which is not closed (because it is no let-bound). + + +Notice that a top-level binding that is affected by the monomorphism restriction is not closed, and hence may +in turn prevent generalisation of bindings that mention it. + + The rationale for this more conservative strategy is given in the papers "Let should not be generalised" and "Modular type inference with local assumptions", and a related blog post. From git at git.haskell.org Mon May 19 20:52:47 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 19 May 2014 20:52:47 +0000 (UTC) Subject: [commit: ghc] master: Re-add 'classP' with a compatible implementation and a deprecation notice (4117551) Message-ID: <20140519205247.CBD332406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/4117551f8822ff76501f9f96186dbd39dda26f1d/ghc >--------------------------------------------------------------- commit 4117551f8822ff76501f9f96186dbd39dda26f1d Author: Gabor Greif Date: Wed May 14 23:41:50 2014 +0200 Re-add 'classP' with a compatible implementation and a deprecation notice >--------------------------------------------------------------- 4117551f8822ff76501f9f96186dbd39dda26f1d libraries/template-haskell/Language/Haskell/TH.hs | 2 +- libraries/template-haskell/Language/Haskell/TH/Lib.hs | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/libraries/template-haskell/Language/Haskell/TH.hs b/libraries/template-haskell/Language/Haskell/TH.hs index e9765a9..916f101 100644 --- a/libraries/template-haskell/Language/Haskell/TH.hs +++ b/libraries/template-haskell/Language/Haskell/TH.hs @@ -112,7 +112,7 @@ module Language.Haskell.TH( -- **** Strictness isStrict, notStrict, strictType, varStrictType, -- **** Class Contexts - cxt, normalC, recC, infixC, forallC, + cxt, classP, normalC, recC, infixC, forallC, -- *** Kinds varK, conK, tupleK, arrowK, listK, appK, starK, constraintK, diff --git a/libraries/template-haskell/Language/Haskell/TH/Lib.hs b/libraries/template-haskell/Language/Haskell/TH/Lib.hs index 49baa96..08235ba 100644 --- a/libraries/template-haskell/Language/Haskell/TH/Lib.hs +++ b/libraries/template-haskell/Language/Haskell/TH/Lib.hs @@ -526,6 +526,13 @@ sigT t k equalityT :: TypeQ equalityT = return EqualityT +{-# DEPRECATED classP "Constraint constructors are just type constructors, frob this code as 'constraintT'." #-} +classP :: Name -> [Q Type] -> Q Pred +classP cla tys + = do + tysl <- sequence tys + return (foldl AppT (ConT cla) tysl) + promotedT :: Name -> TypeQ promotedT = return . PromotedT From git at git.haskell.org Mon May 19 20:52:50 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 19 May 2014 20:52:50 +0000 (UTC) Subject: [commit: ghc] master: Provide deprecated backward compatible implementation to 'equalP' (135489d) Message-ID: <20140519205250.5CDC12406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/135489ddc77c6e1b686c0ebf00dee95b218681ed/ghc >--------------------------------------------------------------- commit 135489ddc77c6e1b686c0ebf00dee95b218681ed Author: Gabor Greif Date: Fri May 16 19:41:34 2014 +0200 Provide deprecated backward compatible implementation to 'equalP' >--------------------------------------------------------------- 135489ddc77c6e1b686c0ebf00dee95b218681ed libraries/template-haskell/Language/Haskell/TH.hs | 2 +- libraries/template-haskell/Language/Haskell/TH/Lib.hs | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/libraries/template-haskell/Language/Haskell/TH.hs b/libraries/template-haskell/Language/Haskell/TH.hs index 916f101..5852145 100644 --- a/libraries/template-haskell/Language/Haskell/TH.hs +++ b/libraries/template-haskell/Language/Haskell/TH.hs @@ -112,7 +112,7 @@ module Language.Haskell.TH( -- **** Strictness isStrict, notStrict, strictType, varStrictType, -- **** Class Contexts - cxt, classP, normalC, recC, infixC, forallC, + cxt, classP, equalP, normalC, recC, infixC, forallC, -- *** Kinds varK, conK, tupleK, arrowK, listK, appK, starK, constraintK, diff --git a/libraries/template-haskell/Language/Haskell/TH/Lib.hs b/libraries/template-haskell/Language/Haskell/TH/Lib.hs index 08235ba..345f16b 100644 --- a/libraries/template-haskell/Language/Haskell/TH/Lib.hs +++ b/libraries/template-haskell/Language/Haskell/TH/Lib.hs @@ -533,6 +533,15 @@ classP cla tys tysl <- sequence tys return (foldl AppT (ConT cla) tysl) +{-# DEPRECATED equalP "Constraint constructors are just type constructors, frob this code as 'equalT'." #-} +equalP :: TypeQ -> TypeQ -> PredQ +equalP tleft tright + = do + tleft1 <- tleft + tright1 <- tright + eqT <- equalityT + return (foldl AppT eqT [tleft1, tright1]) + promotedT :: Name -> TypeQ promotedT = return . PromotedT From git at git.haskell.org Mon May 19 20:52:53 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 19 May 2014 20:52:53 +0000 (UTC) Subject: [commit: ghc] master: Catch some typos (a8cba19) Message-ID: <20140519205253.4EFE82406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/a8cba196e9d651571c4902706b73ab0c591dc335/ghc >--------------------------------------------------------------- commit a8cba196e9d651571c4902706b73ab0c591dc335 Author: Gabor Greif Date: Mon May 19 19:42:07 2014 +0200 Catch some typos >--------------------------------------------------------------- a8cba196e9d651571c4902706b73ab0c591dc335 docs/users_guide/glasgow_exts.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/users_guide/glasgow_exts.xml b/docs/users_guide/glasgow_exts.xml index e2513c2..7872a88 100644 --- a/docs/users_guide/glasgow_exts.xml +++ b/docs/users_guide/glasgow_exts.xml @@ -8145,11 +8145,11 @@ g x = let h y = f y * 2 in h x + k x Here f is generalised because it has no free variables; and its binding group -in unaffected by the monomorphism restriction; and hence f is closed. +is unaffected by the monomorphism restriction; and hence f is closed. The same reasoning applies to g, except that it has one closed free variable, namely f. Similarly h is closed, even though it is not bound at top level, because its only free variable f is closed. -But k is not closed because it mentions x which is not closed (because it is no let-bound). +But k is not closed, because it mentions x which is not closed (because it is not let-bound). Notice that a top-level binding that is affected by the monomorphism restriction is not closed, and hence may From git at git.haskell.org Mon May 19 20:52:55 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 19 May 2014 20:52:55 +0000 (UTC) Subject: [commit: ghc] master: Fix below warning by including "unistd.h" also (3a04ce2) Message-ID: <20140519205255.EBA4B2406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/3a04ce29a2d92f58ab07f83f4970c544e4afdf00/ghc >--------------------------------------------------------------- commit 3a04ce29a2d92f58ab07f83f4970c544e4afdf00 Author: Gabor Greif Date: Mon May 19 22:50:41 2014 +0200 Fix below warning by including "unistd.h" also exec_signals_prepare.c:26:5: warning: implicit declaration of function 'execv' is invalid in C99 [-Wimplicit-function-declaration] execv(argv[1], argv+1); ^ 1 warning generated. >--------------------------------------------------------------- 3a04ce29a2d92f58ab07f83f4970c544e4afdf00 testsuite/tests/rts/exec_signals_prepare.c | 1 + 1 file changed, 1 insertion(+) diff --git a/testsuite/tests/rts/exec_signals_prepare.c b/testsuite/tests/rts/exec_signals_prepare.c index 26f30ac..2b01dd5 100644 --- a/testsuite/tests/rts/exec_signals_prepare.c +++ b/testsuite/tests/rts/exec_signals_prepare.c @@ -2,6 +2,7 @@ #include #include #include +#include // Invokes a process, making sure that the state of the signal // handlers has all been set back to the unix default. From git at git.haskell.org Tue May 20 07:44:33 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 20 May 2014 07:44:33 +0000 (UTC) Subject: [commit: ghc] master: Harden imports in `DeriveConstants.hs` module (a15d243) Message-ID: <20140520074433.A8EB62406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/a15d243e4c15c45a401dec8c30a5135b6b006115/ghc >--------------------------------------------------------------- commit a15d243e4c15c45a401dec8c30a5135b6b006115 Author: Herbert Valerio Riedel Date: Tue May 20 09:40:36 2014 +0200 Harden imports in `DeriveConstants.hs` module This was generated by applying `-ddump-minimal-imports` and addresses the current compile failure (see #9016) with GHC HEAD due to the new `die` being exported by `System.Exit` Signed-off-by: Herbert Valerio Riedel >--------------------------------------------------------------- a15d243e4c15c45a401dec8c30a5135b6b006115 utils/deriveConstants/DeriveConstants.hs | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/utils/deriveConstants/DeriveConstants.hs b/utils/deriveConstants/DeriveConstants.hs index 6bfce24..d15f619 100644 --- a/utils/deriveConstants/DeriveConstants.hs +++ b/utils/deriveConstants/DeriveConstants.hs @@ -10,20 +10,20 @@ into non-C source containing this information. ------------------------------------------------------------------------ -} -import Control.Monad -import Data.Bits -import Data.Char -import Data.List +import Control.Monad (when, unless) +import Data.Bits (shiftL) +import Data.Char (toLower) +import Data.List (stripPrefix) import Data.Map (Map) import qualified Data.Map as Map -import Data.Maybe -import Numeric -import System.Environment -import System.Exit -import System.FilePath -import System.IO -import System.Info -import System.Process +import Data.Maybe (catMaybes) +import Numeric (readHex) +import System.Environment (getArgs) +import System.Exit (ExitCode(ExitSuccess), exitFailure) +import System.FilePath (()) +import System.IO (stderr, hPutStrLn) +import System.Info (os) +import System.Process (showCommandForUser, readProcess, rawSystem) main :: IO () main = do opts <- parseArgs From git at git.haskell.org Tue May 20 08:48:17 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 20 May 2014 08:48:17 +0000 (UTC) Subject: [commit: ghc] master: Coercible: Unwrap newtypes before coercing under tycons (7e78faf) Message-ID: <20140520084817.BD5172406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/7e78faf033405bd5f3b6b787343c98e33d767bda/ghc >--------------------------------------------------------------- commit 7e78faf033405bd5f3b6b787343c98e33d767bda Author: Joachim Breitner Date: Tue May 20 10:25:26 2014 +0200 Coercible: Unwrap newtypes before coercing under tycons This fixes parts of #9117. >--------------------------------------------------------------- 7e78faf033405bd5f3b6b787343c98e33d767bda compiler/typecheck/TcInteract.lhs | 76 ++++++++++++++--------- testsuite/tests/typecheck/should_compile/T9117.hs | 13 ++++ testsuite/tests/typecheck/should_compile/all.T | 1 + 3 files changed, 60 insertions(+), 30 deletions(-) diff --git a/compiler/typecheck/TcInteract.lhs b/compiler/typecheck/TcInteract.lhs index a6b7f44..fc8466b 100644 --- a/compiler/typecheck/TcInteract.lhs +++ b/compiler/typecheck/TcInteract.lhs @@ -1929,6 +1929,8 @@ getCoercibleInst loc ty1 ty2 = do where go :: FamInstEnvs -> GlobalRdrEnv -> TcS LookupInstResult go famenv rdr_env + -- Also see [Order of Coercible Instances] + -- Coercible a a (see case 1 in [Coercible Instances]) | ty1 `tcEqType` ty2 = do return $ GenInst [] @@ -1944,7 +1946,19 @@ getCoercibleInst loc ty1 ty2 = do ev_term <- deferTcSForAllEq Representational loc (tvs1,body1) (tvs2,body2) return $ GenInst [] ev_term - -- Coercible (D ty1 ty2) (D ty1' ty2') (see case 3 in [Coercible Instances]) + -- Coercible NT a (see case 4 in [Coercible Instances]) + | Just (tc,tyArgs) <- splitTyConApp_maybe ty1, + Just (concTy, ntCo) <- instNewTyConTF_maybe famenv tc tyArgs, + dataConsInScope rdr_env tc -- Do not look at all tyConsOfTyCon + = do markDataConsAsUsed rdr_env tc + ct_ev <- requestCoercible loc concTy ty2 + local_var <- mkSysLocalM (fsLit "coev") $ mkCoerciblePred concTy ty2 + let binds = EvBinds (unitBag (EvBind local_var (getEvTerm ct_ev))) + tcCo = TcLetCo binds $ + coercionToTcCoercion ntCo `mkTcTransCo` mkTcCoVarCo local_var + return $ GenInst (freshGoals [ct_ev]) (EvCoercion tcCo) + + -- Coercible (D ty1 ty2) (D ty1' ty2') (see case 2 in [Coercible Instances]) | Just (tc1,tyArgs1) <- splitTyConApp_maybe ty1, Just (tc2,tyArgs2) <- splitTyConApp_maybe ty2, tc1 == tc2, @@ -1975,19 +1989,7 @@ getCoercibleInst loc ty1 ty2 = do tcCo = TcLetCo binds (mkTcTyConAppCo Representational tc1 arg_cos) return $ GenInst (catMaybes arg_new) (EvCoercion tcCo) - -- Coercible NT a (see case 4 in [Coercible Instances]) - | Just (tc,tyArgs) <- splitTyConApp_maybe ty1, - Just (concTy, ntCo) <- instNewTyConTF_maybe famenv tc tyArgs, - dataConsInScope rdr_env tc -- Do not look at all tyConsOfTyCon - = do markDataConsAsUsed rdr_env tc - ct_ev <- requestCoercible loc concTy ty2 - local_var <- mkSysLocalM (fsLit "coev") $ mkCoerciblePred concTy ty2 - let binds = EvBinds (unitBag (EvBind local_var (getEvTerm ct_ev))) - tcCo = TcLetCo binds $ - coercionToTcCoercion ntCo `mkTcTransCo` mkTcCoVarCo local_var - return $ GenInst (freshGoals [ct_ev]) (EvCoercion tcCo) - - -- Coercible a NT (see case 4 in [Coercible Instances]) + -- Coercible a NT (see case 3 in [Coercible Instances]) | Just (tc,tyArgs) <- splitTyConApp_maybe ty2, Just (concTy, ntCo) <- instNewTyConTF_maybe famenv tc tyArgs, dataConsInScope rdr_env tc -- Do not look at all tyConsOfTyCon @@ -2047,26 +2049,14 @@ air, in getCoercibleInst. The following ?instances? are present: (which would be illegal to write like that in the source code, but we have it nevertheless). - - 3. instance (Coercible t1_r t1'_r, Coercible t2_r t2_r',...) => - Coercible (C t1_r t2_r ... t1_p t2_p ... t1_n t2_n ...) - (C t1_r' t2_r' ... t1_p' t2_p' ... t1_n t2_n ...) - for a type constructor C where - * the nominal type arguments are not changed, - * the phantom type arguments may change arbitrarily - * the representational type arguments are again Coercible - - The type constructor can be used undersaturated; then the Coercible - instance is at a higher kind. This does not cause problems. - - 4. instance Coercible r b => Coercible (NT t1 t2 ...) b + 3. instance Coercible r b => Coercible (NT t1 t2 ...) b instance Coercible a r => Coercible a (NT t1 t2 ...) for a newtype constructor NT (or data family instance that resolves to a newtype) where * r is the concrete type of NT, instantiated with the arguments t1 t2 ... * the constructor of NT are in scope. - Again, the newtype TyCon can appear undersaturated, but only if it has + The newtype TyCon can appear undersaturated, but only if it has enough arguments to apply the newtype coercion (which is eta-reduced). Examples: newtype NT a = NT (Either a Int) Coercible (NT Int) (Either Int Int) -- ok @@ -2074,12 +2064,24 @@ air, in getCoercibleInst. The following ?instances? are present: newtype NT3 a b = NT3 (b -> a) Coercible (NT2 Int) (NT3 Int) -- cannot be derived + 4. instance (Coercible t1_r t1'_r, Coercible t2_r t2_r',...) => + Coercible (C t1_r t2_r ... t1_p t2_p ... t1_n t2_n ...) + (C t1_r' t2_r' ... t1_p' t2_p' ... t1_n t2_n ...) + for a type constructor C where + * the nominal type arguments are not changed, + * the phantom type arguments may change arbitrarily + * the representational type arguments are again Coercible + + The type constructor can be used undersaturated; then the Coercible + instance is at a higher kind. This does not cause problems. + + The type checker generates evidence in the form of EvCoercion, but the TcCoercion therein has role Representational, which are turned into Core coercions by dsEvTerm in DsBinds. -The evidence for the first three instance is generated here by -getCoercibleInst, for the second instance deferTcSForAllEq is used. +The evindence for the second case is created by deferTcSForAllEq, for the other +cases by getCoercibleInst. When the constraint cannot be solved, it is treated as any other unsolved constraint, i.e. it can turn up in an inferred type signature, or reported to @@ -2088,6 +2090,20 @@ coercible_msg in TcErrors gives additional explanations of why GHC could not find a Coercible instance, so it duplicates some of the logic from getCoercibleInst (in negated form). +Note [Order of Coercible Instances] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +At first glance, the order of the various coercible instance doesn't matter, as +incoherence is no issue here: We do not care how the evidence is constructed, +as long as it is. + +But since the solver does not backtrack, the order does matter, as otherwise we may run +into dead ends. If case 4 (coercing under type constructors) were tried before +case 3 (unwrapping newtypes), which is tempting, as it yields solutions faster +and builds smaller evidence turns, then using a role annotation this can +prevent the solver from finding an otherwise possible solution. See T9117.hs +for the code. + Note [Instance and Given overlap] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/testsuite/tests/typecheck/should_compile/T9117.hs b/testsuite/tests/typecheck/should_compile/T9117.hs new file mode 100644 index 0000000..cb05bf2 --- /dev/null +++ b/testsuite/tests/typecheck/should_compile/T9117.hs @@ -0,0 +1,13 @@ +{-# LANGUAGE RoleAnnotations #-} + +-- Also see Note [Order of Coercible Instances] + +module T9117 where + +import Data.Coerce + +newtype Phant a = MkPhant Char +type role Phant representational + +ex1 :: Phant Bool +ex1 = coerce (MkPhant 'x' :: Phant Int) diff --git a/testsuite/tests/typecheck/should_compile/all.T b/testsuite/tests/typecheck/should_compile/all.T index 373e739..2c3efad 100644 --- a/testsuite/tests/typecheck/should_compile/all.T +++ b/testsuite/tests/typecheck/should_compile/all.T @@ -418,3 +418,4 @@ test('T8644', normal, compile, ['']) test('T8762', normal, compile, ['']) test('MutRec', normal, compile, ['']) test('T8856', normal, compile, ['']) +test('T9117', normal, compile, ['']) From git at git.haskell.org Tue May 20 08:53:33 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 20 May 2014 08:53:33 +0000 (UTC) Subject: [commit: ghc] master: Coercible: Test case for now broken(?) corner case (94c5767) Message-ID: <20140520085333.42AD32406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/94c57676d7f88cd9edcc522aa3dc3ec6e3ad6633/ghc >--------------------------------------------------------------- commit 94c57676d7f88cd9edcc522aa3dc3ec6e3ad6633 Author: Joachim Breitner Date: Tue May 20 10:52:14 2014 +0200 Coercible: Test case for now broken(?) corner case involving a non-terminating newtype. This worked before 7e78faf03. Probably not a problem, but still better to have a test case for it. See ticket #9117. >--------------------------------------------------------------- 94c57676d7f88cd9edcc522aa3dc3ec6e3ad6633 testsuite/tests/typecheck/should_compile/T9117_2.hs | 10 ++++++++++ testsuite/tests/typecheck/should_compile/all.T | 1 + 2 files changed, 11 insertions(+) diff --git a/testsuite/tests/typecheck/should_compile/T9117_2.hs b/testsuite/tests/typecheck/should_compile/T9117_2.hs new file mode 100644 index 0000000..e7b08d8 --- /dev/null +++ b/testsuite/tests/typecheck/should_compile/T9117_2.hs @@ -0,0 +1,10 @@ +module T9117_2 where + + +import Data.Coerce + +newtype Foo a = Foo (Foo a) +newtype Age = MkAge Int + +ex1 :: (Foo Age) -> (Foo Int) +ex1 = coerce diff --git a/testsuite/tests/typecheck/should_compile/all.T b/testsuite/tests/typecheck/should_compile/all.T index 2c3efad..07d05b8 100644 --- a/testsuite/tests/typecheck/should_compile/all.T +++ b/testsuite/tests/typecheck/should_compile/all.T @@ -419,3 +419,4 @@ test('T8762', normal, compile, ['']) test('MutRec', normal, compile, ['']) test('T8856', normal, compile, ['']) test('T9117', normal, compile, ['']) +test('T9117_2', expect_broken('9117'), compile, ['']) From git at git.haskell.org Tue May 20 10:28:13 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 20 May 2014 10:28:13 +0000 (UTC) Subject: [commit: ghc] master: Tweaks to note; also fixed unicode quotes (7d958ce) Message-ID: <20140520102813.808EE2406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/7d958ce323e3433c9e996e1a240a5741bfcfc341/ghc >--------------------------------------------------------------- commit 7d958ce323e3433c9e996e1a240a5741bfcfc341 Author: Gabor Greif Date: Tue May 20 11:04:54 2014 +0200 Tweaks to note; also fixed unicode quotes to regular ones. >--------------------------------------------------------------- 7d958ce323e3433c9e996e1a240a5741bfcfc341 compiler/typecheck/TcInteract.lhs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/compiler/typecheck/TcInteract.lhs b/compiler/typecheck/TcInteract.lhs index fc8466b..832b8ee 100644 --- a/compiler/typecheck/TcInteract.lhs +++ b/compiler/typecheck/TcInteract.lhs @@ -2040,7 +2040,7 @@ Note [Coercible Instances] The class Coercible is special: There are no regular instances, and the user cannot even define them (it is listed as an `abstractClass` in TcValidity). Instead, the type checker will create instances and their evidence out of thin -air, in getCoercibleInst. The following ?instances? are present: +air, in getCoercibleInst. The following "instances" are present: 1. instance Coercible a a for any type a at any kind k. @@ -2054,7 +2054,7 @@ air, in getCoercibleInst. The following ?instances? are present: for a newtype constructor NT (or data family instance that resolves to a newtype) where * r is the concrete type of NT, instantiated with the arguments t1 t2 ... - * the constructor of NT are in scope. + * the constructor of NT is in scope. The newtype TyCon can appear undersaturated, but only if it has enough arguments to apply the newtype coercion (which is eta-reduced). Examples: @@ -2080,7 +2080,7 @@ The type checker generates evidence in the form of EvCoercion, but the TcCoercion therein has role Representational, which are turned into Core coercions by dsEvTerm in DsBinds. -The evindence for the second case is created by deferTcSForAllEq, for the other +The evidence for the second case is created by deferTcSForAllEq, for the other cases by getCoercibleInst. When the constraint cannot be solved, it is treated as any other unsolved @@ -2093,7 +2093,7 @@ getCoercibleInst (in negated form). Note [Order of Coercible Instances] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -At first glance, the order of the various coercible instance doesn't matter, as +At first glance, the order of the various coercible instances doesn't matter, as incoherence is no issue here: We do not care how the evidence is constructed, as long as it is. From git at git.haskell.org Fri May 23 06:49:23 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 23 May 2014 06:49:23 +0000 (UTC) Subject: [commit: ghc] master: Simple eta reduction in call to adjustMatchResults, just a tidy-up (bc58d2e) Message-ID: <20140523064923.2FFE22406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/bc58d2e8a9da7cab90e4a06c28197d1d746a06cf/ghc >--------------------------------------------------------------- commit bc58d2e8a9da7cab90e4a06c28197d1d746a06cf Author: Simon Peyton Jones Date: Mon May 19 23:51:24 2014 +0100 Simple eta reduction in call to adjustMatchResults, just a tidy-up >--------------------------------------------------------------- bc58d2e8a9da7cab90e4a06c28197d1d746a06cf compiler/deSugar/DsGRHSs.lhs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/compiler/deSugar/DsGRHSs.lhs b/compiler/deSugar/DsGRHSs.lhs index 0a4e1ed..a571e80 100644 --- a/compiler/deSugar/DsGRHSs.lhs +++ b/compiler/deSugar/DsGRHSs.lhs @@ -63,10 +63,8 @@ dsGRHSs hs_ctx _ (GRHSs grhss binds) rhs_ty = ASSERT( notNull grhss ) do { match_results <- mapM (dsGRHS hs_ctx rhs_ty) grhss ; let match_result1 = foldr1 combineMatchResults match_results - match_result2 = adjustMatchResultDs - (\e -> dsLocalBinds binds e) - match_result1 - -- NB: nested dsLet inside matchResult + match_result2 = adjustMatchResultDs (dsLocalBinds binds) match_result1 + -- NB: nested dsLet inside matchResult ; return match_result2 } dsGRHS :: HsMatchContext Name -> Type -> LGRHS Id (LHsExpr Id) -> DsM MatchResult From git at git.haskell.org Fri May 23 06:49:26 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 23 May 2014 06:49:26 +0000 (UTC) Subject: [commit: ghc] master: Make the unifier a fixpoint even for the free kind vars of a tyvar (d8d9711) Message-ID: <20140523064926.97CD72406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/d8d97113c24e7216be36c9cdfc58e91f26528f06/ghc >--------------------------------------------------------------- commit d8d97113c24e7216be36c9cdfc58e91f26528f06 Author: Simon Peyton Jones Date: Fri May 23 07:47:17 2014 +0100 Make the unifier a fixpoint even for the free kind vars of a tyvar The (pure) unifier tcUnifyTys returns an idempotent substitution. But previously the kinds of type variables free in the range of the subst could have un-substituted kind variables. This patch fixes that, fixing Trac #9106. See Note [Finding the substitution fixpoint] in Unify >--------------------------------------------------------------- d8d97113c24e7216be36c9cdfc58e91f26528f06 compiler/types/Unify.lhs | 46 ++++++++++++++++++++++++++++------ testsuite/tests/polykinds/T9106.hs | 14 +++++++++++ testsuite/tests/polykinds/T9106.stderr | 8 ++++++ testsuite/tests/polykinds/all.T | 1 + 4 files changed, 62 insertions(+), 7 deletions(-) diff --git a/compiler/types/Unify.lhs b/compiler/types/Unify.lhs index 1ce1d62..24aa7a7 100644 --- a/compiler/types/Unify.lhs +++ b/compiler/types/Unify.lhs @@ -24,7 +24,6 @@ module Unify ( -- Side-effect free unification tcUnifyTy, tcUnifyTys, BindFlag(..), - niFixTvSubst, niSubstTvSet, UnifyResultM(..), UnifyResult, tcUnifyTysFG @@ -471,19 +470,52 @@ During unification we use a TvSubstEnv that is (a) non-idempotent (b) loop-free; ie repeatedly applying it yields a fixed point +Note [Finding the substitution fixpoint] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Finding the fixpoint of a non-idempotent substitution arising from a +unification is harder than it looks, because of kinds. Consider + T k (H k (f:k)) ~ T * (g:*) +If we unify, we get the substitution + [ k -> * + , g -> H k (f:k) ] +To make it idempotent we don't want to get just + [ k -> * + , g -> H * (f:k) ] +We also want to substitute inside f's kind, to get + [ k -> * + , g -> H k (f:*) ] +If we don't do this, we may apply the substitition to something, +and get an ill-formed type, i.e. one where typeKind will fail. +This happened, for example, in Trac #9106. + +This is the reason for extending env with [f:k -> f:*], in the +definition of env' in niFixTvSubst + \begin{code} niFixTvSubst :: TvSubstEnv -> TvSubst -- Find the idempotent fixed point of the non-idempotent substitution +-- See Note [Finding the substitution fixpoint] -- ToDo: use laziness instead of iteration? niFixTvSubst env = f env where - f e | not_fixpoint = f (mapVarEnv (substTy subst) e) - | otherwise = subst + f env | not_fixpoint = f (mapVarEnv (substTy subst') env) + | otherwise = subst where - range_tvs = foldVarEnv (unionVarSet . tyVarsOfType) emptyVarSet e - subst = mkTvSubst (mkInScopeSet range_tvs) e - not_fixpoint = foldVarSet ((||) . in_domain) False range_tvs - in_domain tv = tv `elemVarEnv` e + not_fixpoint = foldVarSet ((||) . in_domain) False all_range_tvs + in_domain tv = tv `elemVarEnv` env + + range_tvs = foldVarEnv (unionVarSet . tyVarsOfType) emptyVarSet env + all_range_tvs = closeOverKinds range_tvs + subst = mkTvSubst (mkInScopeSet all_range_tvs) env + + -- env' extends env by replacing any free type with + -- that same tyvar with a substituted kind + -- See note [Finding the substitution fixpoint] + env' = extendVarEnvList env [ (rtv, mkTyVarTy $ setTyVarKind rtv $ + substTy subst $ tyVarKind rtv) + | rtv <- varSetElems range_tvs + , not (in_domain rtv) ] + subst' = mkTvSubst (mkInScopeSet all_range_tvs) env' niSubstTvSet :: TvSubstEnv -> TyVarSet -> TyVarSet -- Apply the non-idempotent substitution to a set of type variables, diff --git a/testsuite/tests/polykinds/T9106.hs b/testsuite/tests/polykinds/T9106.hs new file mode 100644 index 0000000..eaf0364 --- /dev/null +++ b/testsuite/tests/polykinds/T9106.hs @@ -0,0 +1,14 @@ +{-# LANGUAGE MultiParamTypeClasses, DataKinds, FunctionalDependencies, + KindSignatures, PolyKinds, FlexibleInstances, FlexibleContexts, + UndecidableInstances #-} + +module T9106 where + +import GHC.TypeLits + +class FunctorN (n :: Nat) f (a :: *) (fa :: *) | n f a -> fa where + +instance FunctorN 0 f a a where + +instance FunctorN n f a (f fa) + diff --git a/testsuite/tests/polykinds/T9106.stderr b/testsuite/tests/polykinds/T9106.stderr new file mode 100644 index 0000000..0b239f2 --- /dev/null +++ b/testsuite/tests/polykinds/T9106.stderr @@ -0,0 +1,8 @@ + +T9106.hs:13:10: + Illegal instance declaration for ?FunctorN n f a (f fa)? + The liberal coverage condition fails in class ?FunctorN? + for functional dependency: ?n f a -> fa? + Reason: lhs types ?n?, ?f?, ?a? + do not jointly determine rhs type ?f fa? + In the instance declaration for ?FunctorN n f a (f fa)? diff --git a/testsuite/tests/polykinds/all.T b/testsuite/tests/polykinds/all.T index 3634d83..96faa67 100644 --- a/testsuite/tests/polykinds/all.T +++ b/testsuite/tests/polykinds/all.T @@ -100,3 +100,4 @@ test('T8566a', expect_broken(8566), compile,['']) test('T7481', normal, compile_fail,['']) test('T8705', normal, compile, ['']) test('T8985', normal, compile, ['']) +test('T9106', normal, compile_fail, ['']) From git at git.haskell.org Fri May 23 06:49:28 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 23 May 2014 06:49:28 +0000 (UTC) Subject: [commit: ghc] master: Better pretty-printing for ClsInst (d41aa76) Message-ID: <20140523064929.0DF942406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/d41aa765327b26339526e722c2bcf14912832e72/ghc >--------------------------------------------------------------- commit d41aa765327b26339526e722c2bcf14912832e72 Author: Simon Peyton Jones Date: Fri May 23 07:48:06 2014 +0100 Better pretty-printing for ClsInst >--------------------------------------------------------------- d41aa765327b26339526e722c2bcf14912832e72 compiler/typecheck/Inst.lhs | 3 ++- compiler/types/InstEnv.lhs | 14 ++++++-------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/compiler/typecheck/Inst.lhs b/compiler/typecheck/Inst.lhs index 6ec39a2..2bcf981 100644 --- a/compiler/typecheck/Inst.lhs +++ b/compiler/typecheck/Inst.lhs @@ -477,7 +477,8 @@ traceDFuns :: [ClsInst] -> TcRn () traceDFuns ispecs = traceTc "Adding instances:" (vcat (map pp ispecs)) where - pp ispec = ppr (instanceDFunId ispec) <+> colon <+> ppr ispec + pp ispec = hang (ppr (instanceDFunId ispec) <+> colon) + 2 (ppr ispec) -- Print the dfun name itself too funDepErr :: ClsInst -> [ClsInst] -> TcRn () diff --git a/compiler/types/InstEnv.lhs b/compiler/types/InstEnv.lhs index e7fcab0..176f189 100644 --- a/compiler/types/InstEnv.lhs +++ b/compiler/types/InstEnv.lhs @@ -166,15 +166,13 @@ pprInstanceHdr :: ClsInst -> SDoc -- Prints the ClsInst as an instance declaration pprInstanceHdr (ClsInst { is_flag = flag, is_dfun = dfun }) = getPprStyle $ \ sty -> - let theta_to_print - | debugStyle sty = theta - | otherwise = drop (dfunNSilent dfun) theta + let dfun_ty = idType dfun + (tvs, theta, res_ty) = tcSplitSigmaTy dfun_ty + theta_to_print = drop (dfunNSilent dfun) theta -- See Note [Silent superclass arguments] in TcInstDcls - in ptext (sLit "instance") <+> ppr flag - <+> sep [pprThetaArrowTy theta_to_print, ppr res_ty] - where - (_, theta, res_ty) = tcSplitSigmaTy (idType dfun) - -- Print without the for-all, which the programmer doesn't write + ty_to_print | debugStyle sty = dfun_ty + | otherwise = mkSigmaTy tvs theta_to_print res_ty + in ptext (sLit "instance") <+> ppr flag <+> pprSigmaType ty_to_print pprInstances :: [ClsInst] -> SDoc pprInstances ispecs = vcat (map pprInstance ispecs) From git at git.haskell.org Fri May 23 06:49:31 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 23 May 2014 06:49:31 +0000 (UTC) Subject: [commit: ghc] master: More debug info for failures in typeKind and kindFunResult (02437a1) Message-ID: <20140523064931.80F102406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/02437a144ea16116d60f045a2a56664aed7505e8/ghc >--------------------------------------------------------------- commit 02437a144ea16116d60f045a2a56664aed7505e8 Author: Simon Peyton Jones Date: Fri May 23 07:48:40 2014 +0100 More debug info for failures in typeKind and kindFunResult >--------------------------------------------------------------- 02437a144ea16116d60f045a2a56664aed7505e8 compiler/types/Kind.lhs | 25 ++++++++++++++++--------- compiler/types/Type.lhs | 45 +++++++++++++++++++++++++-------------------- 2 files changed, 41 insertions(+), 29 deletions(-) diff --git a/compiler/types/Kind.lhs b/compiler/types/Kind.lhs index 61239bc..b82556e 100644 --- a/compiler/types/Kind.lhs +++ b/compiler/types/Kind.lhs @@ -63,6 +63,7 @@ import PrelNames import Outputable import Maybes( orElse ) import Util +import FastString \end{code} %************************************************************************ @@ -97,14 +98,19 @@ during type inference. Hence cmpTc treats them as equal. \begin{code} -- | Essentially 'funResultTy' on kinds handling pi-types too -kindFunResult :: Kind -> KindOrType -> Kind -kindFunResult (FunTy _ res) _ = res -kindFunResult (ForAllTy kv res) arg = substKiWith [kv] [arg] res -kindFunResult k _ = pprPanic "kindFunResult" (ppr k) - -kindAppResult :: Kind -> [Type] -> Kind -kindAppResult k [] = k -kindAppResult k (a:as) = kindAppResult (kindFunResult k a) as +kindFunResult :: SDoc -> Kind -> KindOrType -> Kind +kindFunResult _ (FunTy _ res) _ = res +kindFunResult _ (ForAllTy kv res) arg = substKiWith [kv] [arg] res +#ifdef DEBUG +kindFunResult doc k _ = pprPanic "kindFunResult" (ppr k $$ doc) +#else +-- Without DEUBG, doc becomes an unsed arg, and will be optimised away +kindFunResult _ _ _ = panic "kindFunResult" +#endif + +kindAppResult :: SDoc -> Kind -> [Type] -> Kind +kindAppResult _ k [] = k +kindAppResult doc k (a:as) = kindAppResult doc (kindFunResult doc k a) as -- | Essentially 'splitFunTys' on kinds splitKindFunTys :: Kind -> ([Kind],Kind) @@ -128,7 +134,8 @@ splitKindFunTysN n k = pprPanic "splitKindFunTysN" (ppr n <+> ppr k) -- Actually this function works fine on data types too, -- but they'd always return '*', so we never need to ask synTyConResKind :: TyCon -> Kind -synTyConResKind tycon = kindAppResult (tyConKind tycon) (map mkTyVarTy (tyConTyVars tycon)) +synTyConResKind tycon = kindAppResult (ptext (sLit "synTyConResKind") <+> ppr tycon) + (tyConKind tycon) (map mkTyVarTy (tyConTyVars tycon)) -- | See "Type#kind_subtyping" for details of the distinction between these 'Kind's isOpenTypeKind, isUnliftedTypeKind, diff --git a/compiler/types/Type.lhs b/compiler/types/Type.lhs index 7ddd45a..e65a1c7 100644 --- a/compiler/types/Type.lhs +++ b/compiler/types/Type.lhs @@ -1636,26 +1636,31 @@ type SimpleKind = Kind \begin{code} typeKind :: Type -> Kind -typeKind (TyConApp tc tys) - | isPromotedTyCon tc - = ASSERT( tyConArity tc == length tys ) superKind - | otherwise - = kindAppResult (tyConKind tc) tys - -typeKind (AppTy fun arg) = kindAppResult (typeKind fun) [arg] -typeKind (LitTy l) = typeLiteralKind l -typeKind (ForAllTy _ ty) = typeKind ty -typeKind (TyVarTy tyvar) = tyVarKind tyvar -typeKind _ty@(FunTy _arg res) - -- Hack alert. The kind of (Int -> Int#) is liftedTypeKind (*), - -- not unliftedTypKind (#) - -- The only things that can be after a function arrow are - -- (a) types (of kind openTypeKind or its sub-kinds) - -- (b) kinds (of super-kind TY) (e.g. * -> (* -> *)) - | isSuperKind k = k - | otherwise = ASSERT2( isSubOpenTypeKind k, ppr _ty $$ ppr k ) liftedTypeKind - where - k = typeKind res +typeKind orig_ty = go orig_ty + where + + go ty@(TyConApp tc tys) + | isPromotedTyCon tc + = ASSERT( tyConArity tc == length tys ) superKind + | otherwise + = kindAppResult (ptext (sLit "typeKind 1") <+> ppr ty $$ ppr orig_ty) + (tyConKind tc) tys + + go ty@(AppTy fun arg) = kindAppResult (ptext (sLit "typeKind 2") <+> ppr ty $$ ppr orig_ty) + (go fun) [arg] + go (LitTy l) = typeLiteralKind l + go (ForAllTy _ ty) = go ty + go (TyVarTy tyvar) = tyVarKind tyvar + go _ty@(FunTy _arg res) + -- Hack alert. The kind of (Int -> Int#) is liftedTypeKind (*), + -- not unliftedTypKind (#) + -- The only things that can be after a function arrow are + -- (a) types (of kind openTypeKind or its sub-kinds) + -- (b) kinds (of super-kind TY) (e.g. * -> (* -> *)) + | isSuperKind k = k + | otherwise = ASSERT2( isSubOpenTypeKind k, ppr _ty $$ ppr k ) liftedTypeKind + where + k = go res typeLiteralKind :: TyLit -> Kind typeLiteralKind l = From git at git.haskell.org Fri May 23 06:49:34 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 23 May 2014 06:49:34 +0000 (UTC) Subject: [commit: ghc] master: White space only (427e205) Message-ID: <20140523064934.2D8C12406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/427e205b68d166cc99bd71ed7077b40bcf20e53c/ghc >--------------------------------------------------------------- commit 427e205b68d166cc99bd71ed7077b40bcf20e53c Author: Simon Peyton Jones Date: Fri May 23 07:48:52 2014 +0100 White space only >--------------------------------------------------------------- 427e205b68d166cc99bd71ed7077b40bcf20e53c compiler/typecheck/FunDeps.lhs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/typecheck/FunDeps.lhs b/compiler/typecheck/FunDeps.lhs index 09e143c..e5cd356 100644 --- a/compiler/typecheck/FunDeps.lhs +++ b/compiler/typecheck/FunDeps.lhs @@ -561,7 +561,7 @@ if s1 matches \begin{code} checkFunDeps :: (InstEnv, InstEnv) -> ClsInst -> Maybe [ClsInst] -- Nothing <=> ok - -- Just dfs <=> conflict with dfs + -- Just dfs <=> conflict with dfs -- Check wheher adding DFunId would break functional-dependency constraints -- Used only for instance decls defined in the module being compiled checkFunDeps inst_envs ispec From git at git.haskell.org Fri May 23 08:41:51 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 23 May 2014 08:41:51 +0000 (UTC) Subject: [commit: ghc] master: Bump bytes-allocated for T3064 (4dea15a) Message-ID: <20140523084154.3820F2406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/4dea15a05c6d8425c09a7d8530826f8568321bb0/ghc >--------------------------------------------------------------- commit 4dea15a05c6d8425c09a7d8530826f8568321bb0 Author: Simon Peyton Jones Date: Fri May 23 09:41:27 2014 +0100 Bump bytes-allocated for T3064 I'm not sure why this has increased, but it seems small >--------------------------------------------------------------- 4dea15a05c6d8425c09a7d8530826f8568321bb0 testsuite/tests/perf/compiler/all.T | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/testsuite/tests/perf/compiler/all.T b/testsuite/tests/perf/compiler/all.T index bd9a08f..56417ea 100644 --- a/testsuite/tests/perf/compiler/all.T +++ b/testsuite/tests/perf/compiler/all.T @@ -227,7 +227,7 @@ test('T3064', # 2012-10-30: 111189536 (x86/Windows) # 2013-11-13: 146626504 (x86/Windows, 64bit machine) # 2014-01-22: 162457940 (x86/Linux) - (wordsize(64), 308422280, 5)]), + (wordsize(64), 324022680, 5)]), # (amd64/Linux) (28/06/2011): 73259544 # (amd64/Linux) (07/02/2013): 224798696 # (amd64/Linux) (02/08/2013): 236404384, increase from roles @@ -235,6 +235,7 @@ test('T3064', # (amd64/Linux) (22/11/2013): 308300448, GND via Coercible and counters for constraints solving # (amd64/Linux) (02/12/2013): 329795912, Coercible refactor # (amd64/Linux) (11/02/2014): 308422280, optimize Coercions in simpleOptExpr + # (amd64/Linux) (23/05/2014): 324022680, unknown cause compiler_stats_num_field('max_bytes_used', [(wordsize(32), 11202304, 20), From git at git.haskell.org Fri May 23 13:37:01 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 23 May 2014 13:37:01 +0000 (UTC) Subject: [commit: ghc] branch 'wip/T9136' created Message-ID: <20140523133701.EB48E2406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/T9136 Referencing: 115fd8b04364a962c348510b7c65c1e0d603ebf9 From git at git.haskell.org Fri May 23 13:37:05 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 23 May 2014 13:37:05 +0000 (UTC) Subject: [commit: ghc] wip/T9136: Add a test case for #9136 (d408191) Message-ID: <20140523133705.9523D2406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T9136 Link : http://ghc.haskell.org/trac/ghc/changeset/d4081919e78b994a9520b89187bb6ab83ffee306/ghc >--------------------------------------------------------------- commit d4081919e78b994a9520b89187bb6ab83ffee306 Author: Joachim Breitner Date: Fri May 23 15:34:46 2014 +0200 Add a test case for #9136 The example code is set up so that if the constant folding works, no literal 8 is left in the code. >--------------------------------------------------------------- d4081919e78b994a9520b89187bb6ab83ffee306 testsuite/tests/simplCore/should_compile/Makefile | 4 ++++ testsuite/tests/simplCore/should_compile/T9136.hs | 14 ++++++++++++++ testsuite/tests/simplCore/should_compile/all.T | 4 ++++ 3 files changed, 22 insertions(+) diff --git a/testsuite/tests/simplCore/should_compile/Makefile b/testsuite/tests/simplCore/should_compile/Makefile index ca0d552..9c21325 100644 --- a/testsuite/tests/simplCore/should_compile/Makefile +++ b/testsuite/tests/simplCore/should_compile/Makefile @@ -119,3 +119,7 @@ T8221: T5996: $(RM) -f T5996.o T5996.hi '$(TEST_HC)' $(TEST_HC_OPTS) -O -c T5996.hs -ddump-simpl -dsuppress-uniques -dsuppress-all | grep y2 + +T9136: + '$(TEST_HC)' $(TEST_HC_OPTS) -O -c T9136.hs -ddump-simpl -dsuppress-uniques -dsuppress-all > T9136.simpl + ! grep -v 'Result size' T9136.simpl | grep -q -F 8 diff --git a/testsuite/tests/simplCore/should_compile/T9136.hs b/testsuite/tests/simplCore/should_compile/T9136.hs new file mode 100644 index 0000000..4b6aed7 --- /dev/null +++ b/testsuite/tests/simplCore/should_compile/T9136.hs @@ -0,0 +1,14 @@ +module T9136 where + +-- In all these example, no 8 should be found in the final code +foo1 :: Int -> Int +foo1 x = (x + 8) - 1 + +foo2 :: Int -> Int +foo2 x = (8 + x) - 2 + +foo3 :: Int -> Int -> Int +foo3 x y = ((8 + x) + y) - 2 + +foo4 :: Int -> Int -> Int +foo4 x y = (8 + x) + (y - 3) diff --git a/testsuite/tests/simplCore/should_compile/all.T b/testsuite/tests/simplCore/should_compile/all.T index 616b6cc..3277771 100644 --- a/testsuite/tests/simplCore/should_compile/all.T +++ b/testsuite/tests/simplCore/should_compile/all.T @@ -203,3 +203,7 @@ test('T8832', ['$MAKE -s --no-print-directory T8832']) test('T8848', only_ways(['optasm']), compile, ['-ddump-rule-firings']) test('T8848a', only_ways(['optasm']), compile, ['-ddump-rules']) +test('T9136', + extra_clean(['T9136.hi', 'T9136.o', 'T9136.simpl']), + run_command, + ['$MAKE -s --no-print-directory T9136']) From git at git.haskell.org Fri May 23 13:37:08 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 23 May 2014 13:37:08 +0000 (UTC) Subject: [commit: ghc] wip/T9136: Work on smarter constant folding (115fd8b) Message-ID: <20140523133709.1843C2406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T9136 Link : http://ghc.haskell.org/trac/ghc/changeset/115fd8b04364a962c348510b7c65c1e0d603ebf9/ghc >--------------------------------------------------------------- commit 115fd8b04364a962c348510b7c65c1e0d603ebf9 Author: Joachim Breitner Date: Fri May 23 15:35:44 2014 +0200 Work on smarter constant folding Which finds constants further apart like in (x + 8) - 1 or (8 + x) + (y - 3). This is #9136. Currently it only works for + and may need more thought; I?m currently in a hurry... >--------------------------------------------------------------- 115fd8b04364a962c348510b7c65c1e0d603ebf9 compiler/prelude/PrelRules.lhs | 43 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) diff --git a/compiler/prelude/PrelRules.lhs b/compiler/prelude/PrelRules.lhs index d2e648f..2bbf26a 100644 --- a/compiler/prelude/PrelRules.lhs +++ b/compiler/prelude/PrelRules.lhs @@ -83,9 +83,15 @@ primOpRules nm DataToTagOp = mkPrimOpRule nm 2 [ dataToTagRule ] -- Int operations primOpRules nm IntAddOp = mkPrimOpRule nm 2 [ binaryLit (intOp2 (+)) - , identityDynFlags zeroi ] + , identityDynFlags zeroi + , assocBinaryLit IntAddOp (intOp2 (+)) + , litsToRight IntAddOp + , treesToLeft IntAddOp + , litsGoUp IntAddOp + ] primOpRules nm IntSubOp = mkPrimOpRule nm 2 [ binaryLit (intOp2 (-)) , rightIdentityDynFlags zeroi + , minusToPlus IntAddOp , equalArgs >> retLit zeroi ] primOpRules nm IntMulOp = mkPrimOpRule nm 2 [ binaryLit (intOp2 (*)) , zeroElem zeroi @@ -678,6 +684,34 @@ binaryLit op = do [Lit l1, Lit l2] <- getArgs liftMaybe $ op dflags (convFloating dflags l1) (convFloating dflags l2) +assocBinaryLit :: PrimOp -> (DynFlags -> Literal -> Literal -> Maybe CoreExpr) -> RuleM CoreExpr +assocBinaryLit primop op = do + dflags <- getDynFlags + [(Var primop_id `App` t) `App` Lit l1, Lit l2] <- getArgs + matchPrimOpId primop primop_id + Just r <- return $ op dflags (convFloating dflags l1) (convFloating dflags l2) + return $ Var primop_id `App` t `App` r + +litsToRight :: PrimOp -> RuleM CoreExpr +litsToRight op = do + [Lit l, t] <- getArgs + return $ Var (mkPrimOpId op) `App` t `App` Lit l + +treesToLeft :: PrimOp -> RuleM CoreExpr +treesToLeft op = do + [t1, (Var primop_id `App` t2) `App` t3] <- getArgs + matchPrimOpId op primop_id + return $ Var (mkPrimOpId op) `App` (Var (mkPrimOpId op) `App` t1 `App` t2) + `App` t3 + +litsGoUp :: PrimOp -> RuleM CoreExpr +litsGoUp op = do + [(Var primop_id `App` t1) `App` Lit l, t2] <- getArgs + matchPrimOpId op primop_id + return $ Var (mkPrimOpId op) `App` (Var (mkPrimOpId op) `App` t1 `App` t2) + `App` Lit l + + binaryCmpLit :: (forall a . Ord a => a -> a -> Bool) -> RuleM CoreExpr binaryCmpLit op = do dflags <- getDynFlags @@ -734,6 +768,13 @@ equalArgs = do nonZeroLit :: Int -> RuleM () nonZeroLit n = getLiteral n >>= guard . not . isZeroLit +minusToPlus :: PrimOp -> RuleM CoreExpr +minusToPlus op = do + [x, Lit (MachInt y)] <- getArgs + dflags <- getDynFlags + Just r <- return $ intResult dflags (-y) + return $ Var (mkPrimOpId op) `App` x `App` r + -- When excess precision is not requested, cut down the precision of the -- Rational value to that of Float/Double. We confuse host architecture -- and target architecture here, but it's convenient (and wrong :-). From git at git.haskell.org Fri May 23 17:05:08 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 23 May 2014 17:05:08 +0000 (UTC) Subject: [commit: ghc] master: Typos in comments (b33f321) Message-ID: <20140523170509.19DC12406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/b33f321a57fd75c89c2daffb4d207fee1fb26fee/ghc >--------------------------------------------------------------- commit b33f321a57fd75c89c2daffb4d207fee1fb26fee Author: Gabor Greif Date: Fri May 23 19:04:12 2014 +0200 Typos in comments >--------------------------------------------------------------- b33f321a57fd75c89c2daffb4d207fee1fb26fee compiler/types/Kind.lhs | 2 +- compiler/types/Type.lhs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/types/Kind.lhs b/compiler/types/Kind.lhs index b82556e..e4dc783 100644 --- a/compiler/types/Kind.lhs +++ b/compiler/types/Kind.lhs @@ -104,7 +104,7 @@ kindFunResult _ (ForAllTy kv res) arg = substKiWith [kv] [arg] res #ifdef DEBUG kindFunResult doc k _ = pprPanic "kindFunResult" (ppr k $$ doc) #else --- Without DEUBG, doc becomes an unsed arg, and will be optimised away +-- Without DEBUG, doc becomes an unsed arg, and will be optimised away kindFunResult _ _ _ = panic "kindFunResult" #endif diff --git a/compiler/types/Type.lhs b/compiler/types/Type.lhs index e65a1c7..13ceb44 100644 --- a/compiler/types/Type.lhs +++ b/compiler/types/Type.lhs @@ -1653,7 +1653,7 @@ typeKind orig_ty = go orig_ty go (TyVarTy tyvar) = tyVarKind tyvar go _ty@(FunTy _arg res) -- Hack alert. The kind of (Int -> Int#) is liftedTypeKind (*), - -- not unliftedTypKind (#) + -- not unliftedTypeKind (#) -- The only things that can be after a function arrow are -- (a) types (of kind openTypeKind or its sub-kinds) -- (b) kinds (of super-kind TY) (e.g. * -> (* -> *)) From git at git.haskell.org Fri May 23 19:42:35 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 23 May 2014 19:42:35 +0000 (UTC) Subject: [commit: ghc] wip/T9136: Add a note about Reassociation (8a8e10b) Message-ID: <20140523194236.0BC202406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T9136 Link : http://ghc.haskell.org/trac/ghc/changeset/8a8e10be0b3c60cfbafce34036b70e2659487904/ghc >--------------------------------------------------------------- commit 8a8e10be0b3c60cfbafce34036b70e2659487904 Author: Joachim Breitner Date: Fri May 23 18:19:23 2014 +0200 Add a note about Reassociation >--------------------------------------------------------------- 8a8e10be0b3c60cfbafce34036b70e2659487904 compiler/prelude/PrelRules.lhs | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/compiler/prelude/PrelRules.lhs b/compiler/prelude/PrelRules.lhs index 2bbf26a..77e5671 100644 --- a/compiler/prelude/PrelRules.lhs +++ b/compiler/prelude/PrelRules.lhs @@ -678,12 +678,16 @@ unaryLit op = do [Lit l] <- getArgs liftMaybe $ op dflags (convFloating dflags l) +-- Simple constant folding binaryLit :: (DynFlags -> Literal -> Literal -> Maybe CoreExpr) -> RuleM CoreExpr binaryLit op = do dflags <- getDynFlags [Lit l1, Lit l2] <- getArgs liftMaybe $ op dflags (convFloating dflags l1) (convFloating dflags l2) + +-- The next four functions perform reassociation +-- See Note [Reassociation] assocBinaryLit :: PrimOp -> (DynFlags -> Literal -> Literal -> Maybe CoreExpr) -> RuleM CoreExpr assocBinaryLit primop op = do dflags <- getDynFlags @@ -818,6 +822,28 @@ strengthReduction two_lit add_op = do -- Note [Strength reduction] -- x * 2.0 into x + x addition, because addition costs less than multiplication. -- See #7116 +-- Note [Reassociation] +-- ~~~~~~~~~~~~~~~~~~~~ +-- +-- We can simplify expressions like "(x + 8) - 1" and "((8 + x) + y) - 2" and +-- "(8 + x) + (y - 3)", by collecting all the constants and folding them. +-- +-- We do so by normalising the expressions: +-- * treesToLeft ensures that we have a linear tree with subtress on the left +-- * litsToRight commutes literals to the right +-- * litsGoUp sorts lits to the top of the tree +-- * assocBinaryLit then folds the literals. +-- +-- Example: +-- +-- x + (2 + (y + 3)) +-- = ((x + 2) + y) + 3 -- using treesToLeft +-- = ((x + y) + 2) + 3 -- using litsGoUp +-- = (x + y) + 5 -- using assocBinaryLit +-- +-- An expression like "x -# 2" is turned into "x +# (-2)" (minusToPlus) and +-- then also takes part in this scheme. + -- Note [What's true and false] -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- From git at git.haskell.org Fri May 23 19:42:38 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 23 May 2014 19:42:38 +0000 (UTC) Subject: [commit: ghc] wip/T9136: Also perform reassociation for Word (cc2e4e2) Message-ID: <20140523194238.A61C92406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T9136 Link : http://ghc.haskell.org/trac/ghc/changeset/cc2e4e2db6eba4d05317ad71b2c691826ad435c5/ghc >--------------------------------------------------------------- commit cc2e4e2db6eba4d05317ad71b2c691826ad435c5 Author: Joachim Breitner Date: Fri May 23 18:25:53 2014 +0200 Also perform reassociation for Word >--------------------------------------------------------------- cc2e4e2db6eba4d05317ad71b2c691826ad435c5 compiler/prelude/PrelRules.lhs | 11 ++++++++--- testsuite/tests/simplCore/should_compile/T9136.hs | 14 ++++++++++++++ 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/compiler/prelude/PrelRules.lhs b/compiler/prelude/PrelRules.lhs index 77e5671..8a0569a 100644 --- a/compiler/prelude/PrelRules.lhs +++ b/compiler/prelude/PrelRules.lhs @@ -130,9 +130,14 @@ primOpRules nm ISrlOp = mkPrimOpRule nm 2 [ binaryLit (intOp2 shiftRightLog -- Word operations primOpRules nm WordAddOp = mkPrimOpRule nm 2 [ binaryLit (wordOp2 (+)) - , identityDynFlags zerow ] + , identityDynFlags zerow + , assocBinaryLit WordAddOp (wordOp2 (+)) + , litsToRight WordAddOp + , treesToLeft WordAddOp + , litsGoUp WordAddOp ] primOpRules nm WordSubOp = mkPrimOpRule nm 2 [ binaryLit (wordOp2 (-)) , rightIdentityDynFlags zerow + , minusToPlus WordSubOp , equalArgs >> retLit zerow ] primOpRules nm WordMulOp = mkPrimOpRule nm 2 [ binaryLit (wordOp2 (*)) , identityDynFlags onew ] @@ -841,8 +846,8 @@ strengthReduction two_lit add_op = do -- Note [Strength reduction] -- = ((x + y) + 2) + 3 -- using litsGoUp -- = (x + y) + 5 -- using assocBinaryLit -- --- An expression like "x -# 2" is turned into "x +# (-2)" (minusToPlus) and --- then also takes part in this scheme. +-- For Ints, an expression like "x -# 2" is turned into "x +# (-2)" +-- (minusToPlus) and then also takes part in this scheme. -- Note [What's true and false] -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/testsuite/tests/simplCore/should_compile/T9136.hs b/testsuite/tests/simplCore/should_compile/T9136.hs index 4b6aed7..37ad1ae 100644 --- a/testsuite/tests/simplCore/should_compile/T9136.hs +++ b/testsuite/tests/simplCore/should_compile/T9136.hs @@ -1,5 +1,7 @@ module T9136 where +import Data.Word + -- In all these example, no 8 should be found in the final code foo1 :: Int -> Int foo1 x = (x + 8) - 1 @@ -12,3 +14,15 @@ foo3 x y = ((8 + x) + y) - 2 foo4 :: Int -> Int -> Int foo4 x y = (8 + x) + (y - 3) + +word1 :: Word -> Word +word1 x = (x + 8) + 1 + +word2 :: Word -> Word +word2 x = (8 + x) + 2 + +word3 :: Word -> Word -> Word +word3 x y = ((8 + x) + y) + 2 + +word4 :: Word -> Word -> Word +word4 x y = (8 + x) + (y + 3) From git at git.haskell.org Fri May 23 19:42:41 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 23 May 2014 19:42:41 +0000 (UTC) Subject: [commit: ghc] wip/T9136: Refactor reassociation (1c6d937) Message-ID: <20140523194241.B46182406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T9136 Link : http://ghc.haskell.org/trac/ghc/changeset/1c6d93770c075ff002f6eac67d6baf8b56d9a44d/ghc >--------------------------------------------------------------- commit 1c6d93770c075ff002f6eac67d6baf8b56d9a44d Author: Joachim Breitner Date: Fri May 23 20:22:33 2014 +0200 Refactor reassociation by putting all the steps in one function. This way, the code is readable, and it is easier to cater for the different combinations of ?am I being called for + or -? and ?am I being called for Int or Word?. >--------------------------------------------------------------- 1c6d93770c075ff002f6eac67d6baf8b56d9a44d compiler/prelude/PrelRules.lhs | 155 ++++++++++++++-------- testsuite/tests/simplCore/should_compile/Makefile | 2 +- testsuite/tests/simplCore/should_compile/T9136.hs | 6 + 3 files changed, 106 insertions(+), 57 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 1c6d93770c075ff002f6eac67d6baf8b56d9a44d From git at git.haskell.org Fri May 23 21:39:25 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 23 May 2014 21:39:25 +0000 (UTC) Subject: [commit: ghc] master: test.mk: Be liberal in accepting GHC_PKG output (864759c) Message-ID: <20140523213925.3FF142406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/864759cbf7061849ce93123ebb15a3bb6ae06111/ghc >--------------------------------------------------------------- commit 864759cbf7061849ce93123ebb15a3bb6ae06111 Author: Joachim Breitner Date: Fri May 23 22:27:58 2014 +0200 test.mk: Be liberal in accepting GHC_PKG output When the tree is not built, GHC_PKG refers to ghc-pkg in the patth, which may not yet support --simple-output to suppress the field name. So we strip the fieldname when parsing the output, to avoid annoying warnings. >--------------------------------------------------------------- 864759cbf7061849ce93123ebb15a3bb6ae06111 testsuite/mk/test.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testsuite/mk/test.mk b/testsuite/mk/test.mk index 0cc3f21..d6e550f 100644 --- a/testsuite/mk/test.mk +++ b/testsuite/mk/test.mk @@ -55,7 +55,7 @@ else RUNTEST_OPTS += -e ghc_with_native_codegen=0 endif -GHC_PRIM_LIBDIR := $(shell "$(GHC_PKG)" field ghc-prim library-dirs --simple-output) +GHC_PRIM_LIBDIR := $(subst library-dirs: ,,$(shell "$(GHC_PKG)" field ghc-prim library-dirs --simple-output)) HAVE_VANILLA := $(shell if [ -f $(subst \,/,$(GHC_PRIM_LIBDIR))/GHC/PrimopWrappers.hi ]; then echo YES; else echo NO; fi) HAVE_DYNAMIC := $(shell if [ -f $(subst \,/,$(GHC_PRIM_LIBDIR))/GHC/PrimopWrappers.dyn_hi ]; then echo YES; else echo NO; fi) HAVE_PROFILING := $(shell if [ -f $(subst \,/,$(GHC_PRIM_LIBDIR))/GHC/PrimopWrappers.p_hi ]; then echo YES; else echo NO; fi) From git at git.haskell.org Sun May 25 06:15:24 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 25 May 2014 06:15:24 +0000 (UTC) Subject: [commit: ghc] wip/pattern-synonyms: Store IfExtNames for PatSyn matchers and wrappers in interface file, and reconstruct PatSyn type from the corresponding matcher function's type. (bbe9e7c) Message-ID: <20140525061524.684DC2406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/pattern-synonyms Link : http://ghc.haskell.org/trac/ghc/changeset/bbe9e7c9209f0571411d7fecfc82ed9ebfcc3b8d/ghc >--------------------------------------------------------------- commit bbe9e7c9209f0571411d7fecfc82ed9ebfcc3b8d Author: Dr. ERDI Gergo Date: Fri Apr 18 19:21:37 2014 +0800 Store IfExtNames for PatSyn matchers and wrappers in interface file, and reconstruct PatSyn type from the corresponding matcher function's type. This way, the Ids for the matchers/wrappers are reused by importing modules, and thus unfoldings are kept. >--------------------------------------------------------------- bbe9e7c9209f0571411d7fecfc82ed9ebfcc3b8d compiler/basicTypes/PatSyn.lhs | 83 +++++++++++++++++++++++++++++++-------- compiler/coreSyn/CorePrep.lhs | 1 + compiler/iface/BuildTyCl.lhs | 83 ++++++++++----------------------------- compiler/iface/IfaceSyn.lhs | 60 ++++++---------------------- compiler/iface/LoadIface.lhs | 3 +- compiler/iface/MkIface.lhs | 22 ++++------- compiler/iface/TcIface.lhs | 47 ++++++---------------- compiler/main/HscTypes.lhs | 20 +++++----- compiler/main/TidyPgm.lhs | 2 +- compiler/typecheck/TcPat.lhs | 2 +- compiler/typecheck/TcPatSyn.lhs | 87 +++++++++-------------------------------- utils/haddock | 2 +- 12 files changed, 155 insertions(+), 257 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc bbe9e7c9209f0571411d7fecfc82ed9ebfcc3b8d From git at git.haskell.org Sun May 25 06:15:45 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 25 May 2014 06:15:45 +0000 (UTC) Subject: [commit: ghc] wip/pattern-synonyms's head updated: Store IfExtNames for PatSyn matchers and wrappers in interface file, and reconstruct PatSyn type from the corresponding matcher function's type. (bbe9e7c) Message-ID: <20140525061545.EC4AB2406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc Branch 'wip/pattern-synonyms' now includes: 4fb94ae [project @ 2001-06-28 14:15:04 by simonmar] First cut of the Haskell Core Libraries ======================================= d4514dc [project @ 2001-06-29 09:41:37 by simonmar] merge fptools/hslibs/lang/ST.lhs rev. 1.4 dfbab25 [project @ 2001-06-29 09:44:03 by simonmar] merge ghc/lib/std/CPUTime.hsc rev. 1.7 d5fe1da [project @ 2001-07-03 09:02:05 by simonmar] add paragraph about capitalisation of module names b5925b0 [project @ 2001-07-03 09:21:46 by simonmar] Add a paragraph on when to pluralize(*) a module name b4358ba [project @ 2001-07-03 11:37:49 by simonmar] Latest round of changes, incorporating: 900b4a1 [project @ 2001-07-03 11:38:07 by simonmar] add new file 020857d [project @ 2001-07-03 14:13:32 by simonmar] Move generic Maybe and Either definitions from GHC.Maybe to Data.Maybe and Data.Either, and remove GHC.Maybe. a335549 [project @ 2001-07-03 14:17:23 by simonmar] GHC.Maybe isn't used any more (contents moved to Data.Maybe and Data.Either). 5760684 [project @ 2001-07-04 10:48:16 by simonmar] bugfix in yesterday's changes. 38cfe4f [project @ 2001-07-04 10:48:39 by simonmar] Add 4 new libraries b7dc61f [project @ 2001-07-04 10:51:09 by simonmar] oops, better import Prelude bca479a [project @ 2001-07-04 11:06:39 by simonmar] Add Generics library 4fd8a5f [project @ 2001-07-04 11:29:26 by simonmar] need to import Data.Tuple explicitly to get dependencies right. 5743073 [project @ 2001-07-04 11:30:52 by simonmar] Add Prelude imports. eb7eff6 [project @ 2001-07-04 12:06:33 by simonmar] Add showListWith :: (a -> ShowS) -> [a] -> ShowS d69a177 [project @ 2001-07-04 12:07:27 by simonmar] Add Numeric library here for the time being. This is a combination of the H98 Numeric library and a few functions from GHC's NumExts. f9dc6de [project @ 2001-07-05 10:38:33 by simonmar] Makefile for the document. c5175d4 [project @ 2001-07-05 13:52:49 by simonmar] Latest revisions: 6d51c89 [project @ 2001-07-31 11:51:09 by simonmar] Catch up with changes in the main tree. ba4d349 [project @ 2001-07-31 11:59:08 by simonmar] merge fptools/ghc/lib/std/PrelHandle.hsc rev. 1.11 a9a4106 [project @ 2001-07-31 12:46:17 by simonmar] merge fptools/ghc/lib/std/IO.hsc rev. 1.6 60ca3a6 [project @ 2001-07-31 12:47:13 by simonmar] merge fptools/ghc/lib/std/PrelHandle.hsc rev. 1.12 6b8b2ca [project @ 2001-07-31 12:48:13 by simonmar] merge fptools/ghc/lib/std/PrelPosix.hsc rev. 1.8 c165440 [project @ 2001-07-31 12:48:55 by simonmar] merge fptools/ghc/lib/std/PrelHandle.hsc rev. 1.13 2c885c9 [project @ 2001-07-31 12:50:18 by simonmar] merge fptools/ghc/lib/std/CPUTime.hsc rev. 1.8 f33325e [project @ 2001-07-31 12:51:37 by simonmar] merge ghc/lib/std/PrelTopHandler.lhs rev. 1.3 447dad3 [project @ 2001-07-31 12:52:37 by simonmar] add file from main tree. d6acc44 [project @ 2001-07-31 12:58:00 by simonmar] merge ghc/lib/std/PrelInt.lhs rev. 1.16-1.18 5224e42 [project @ 2001-07-31 12:59:30 by simonmar] merge ghc/lib/std/PrelCError.lhs rev. 1.10 79d5bed [project @ 2001-07-31 13:00:26 by simonmar] merge ghc/lib/std/PrelGHC.hi-boot rev. 1.57 2935d84 [project @ 2001-07-31 13:03:28 by simonmar] merge ghc/lib/std/PrelHandle.hsc rev. 1.15 123fb75 [project @ 2001-07-31 13:05:02 by simonmar] merge ghc/lib/std/Time.hsc rev. 1.17 a177664 [project @ 2001-07-31 13:05:33 by simonmar] merge ghc/lib/std/Time.hsc rev. 1.18 5800c82 [project @ 2001-07-31 13:06:09 by simonmar] merge ghc/lib/std/Time.hsc rev. 1.19 a5c9e37 [project @ 2001-07-31 13:06:51 by simonmar] merge ghc/lib/std/PrelEnum.lhs rev. 1.14 fbabc47 [project @ 2001-07-31 13:09:11 by simonmar] merge ghc/lib/std/Num.lhs rev. 1.40 82840a5 [project @ 2001-07-31 13:10:01 by simonmar] merge ghc/lib/std/PrelStorable.lhs rev. 1.8 018bd0f [project @ 2001-07-31 13:11:07 by simonmar] merge ghc/lib/std/PrelErr.lhs rev. 1.20 8448667 [project @ 2001-07-31 13:11:40 by simonmar] merge ghc/lib/std/PrelErr.lhs rev. 1.21 354e601 [project @ 2001-07-31 13:14:01 by simonmar] merge ghc/lib/std/PrelList.lhs rev. 1.25 1e81784 [project @ 2001-07-31 13:28:58 by simonmar] merge hslibs/lang/ArrayBase.lhs rev. 1.17-1.18 7c9589c [project @ 2001-07-31 13:31:44 by simonmar] merge hslibs/lang/ST.lhs rev. 1.14 911ea3e [project @ 2001-07-31 13:38:10 by simonmar] merge hslibs/lang/ArrayBase.lhs rev. 1.19 17f3053 [project @ 2001-07-31 14:34:23 by simonmar] add a couple of useful variants of catch & catchJust: 4528993 [project @ 2001-07-31 14:36:19 by simonmar] add missing #include 250b405 [project @ 2001-07-31 16:35:29 by simonmar] use the eqForeignPtr primop cd9ef85 [project @ 2001-07-31 16:41:32 by simonmar] Add the template package config, and move some of the makefile code out into ../mk/target.mk. 316a7d2 [project @ 2001-08-01 13:53:07 by simonmar] Add Andy Gill's HTML combinator library. d65df60 [project @ 2001-08-02 11:20:50 by simonmar] Add a POSIX regular expression binding as Text/Regex/Posix. POSIX regexps are provided virtually everywhere (except Windows, but there's always pcre), and this means we won't have to ship the a copy of GNU regex.c, which is GPL'ed. 45c5a17 [project @ 2001-08-02 13:30:36 by simonmar] Don't export non-H98 functions 6906afe [project @ 2001-08-07 15:25:04 by simonmar] Remove 'fork' (unsafe, and not used), and don't export 'seq' and 'par'. d1ddd69 [project @ 2001-08-17 12:44:54 by simonmar] Add FiniteMap from package data. 2be6368 [project @ 2001-08-17 12:45:27 by simonmar] Move System.IO.Directory to System.Directory c4ed33b [project @ 2001-08-17 12:46:16 by simonmar] Add default pretty printing library (Text.PrettyPrint.HughesPJ). da7d6b7 [project @ 2001-08-17 12:46:40 by simonmar] Add default pretty printing library. da8fe7b [project @ 2001-08-17 12:47:10 by simonmar] Copy from ghc/lib/std/cbits 8adea3a [project @ 2001-08-17 12:47:47 by simonmar] Add a Makefile (for installing the includes) 0f54f44 [project @ 2001-08-17 12:48:38 by simonmar] Add QuickCheck from package util. a0aef53 [project @ 2001-08-17 12:50:34 by simonmar] Track updates to ghc/lib/std and hslibs. 3cc3816 [project @ 2001-08-30 13:36:00 by simonmar] fix a few typos and add some clarifications d06189a [project @ 2001-09-13 11:35:09 by simonmar] Add System.Mem directory 2194ef4 [project @ 2001-09-13 11:36:52 by simonmar] make this compile 10fd991 [project @ 2001-09-13 11:37:08 by simonmar] add missing import; make it compile fd2801a [project @ 2001-09-13 11:37:43 by simonmar] remove a couple of unused imports 3f12694 [project @ 2001-09-13 11:38:54 by simonmar] cosmetic only: separate the IOErrorType declaration into Haskell 98 and non-Haskell 98 sections. da78e1e [project @ 2001-09-13 11:39:14 by simonmar] Fix the module header 81d1634 [project @ 2001-09-13 11:39:58 by simonmar] Use withForeignPtr rather than passing ForeignPtrs directly to foreign imported functions. 078953f [project @ 2001-09-13 11:40:28 by simonmar] remove get_prog_arg{c,v} prototypes bdbc6e0 [project @ 2001-09-13 11:50:35 by simonmar] Add Set (from package data) 09c1852 [project @ 2001-09-13 15:34:17 by simonmar] remove unused import 9866830 [project @ 2001-09-14 11:25:23 by simonmar] - replace PackedString implementation with one based on UArray. It hasn't been tuned for performance yet, and it seems that not enough fusion is happening yet, but in theory it should be nearly as fast as the old implementation (modulo the fact that the new packed string representation used 32-bit chars vs. 8-bit chars in the old implementation). 0bdbe8b [project @ 2001-09-14 11:25:57 by simonmar] Remove inline functions from GHC.Handle and GHC.IO, and declare them as 'extern inline' in HsCore.h. 4cb5bac [project @ 2001-10-18 11:10:19 by rrt] Remove STGHUGSery. b83cfb9 [project @ 2001-10-18 11:14:17 by rrt] Remove comment that was for STGHUGS. ceb68b9 [project @ 2001-12-21 15:07:20 by simonmar] Merge up to the ghc/lib/std on the HEAD (tagged as new-libraries-last-merged). 56d4524 [project @ 2002-01-02 14:40:09 by simonmar] Make this compile again, and update with latest changes from hslibs/lang. 2a42c35 [project @ 2002-01-02 15:01:27 by simonmar] import Prelude explicitly (this is necessary in libraries/core so that ghc --make can infer correct dependencies). 19bf2f2 [project @ 2002-01-02 15:01:44 by simonmar] Fix the names of some foreign imports. ec3d22d [project @ 2002-01-02 15:13:23 by simonmar] We need GHC/Prim.hi for when the package is built, although we only use GHC/Prim.hi-boot during building. aadbf09 [project @ 2002-02-05 17:32:24 by simonmar] - Merging from ghc/lib/std - Add System.IO.Error - Now builds without --make, so we can do -split-objs c89b528 [project @ 2002-02-06 10:14:26 by simonmar] There's no need for this to be a .hsc file. I'm moving towards libraries/core being .hsc-free, so eventually this can be used for bootstrapping. 8fbb1c4 [project @ 2002-02-06 10:40:26 by simonmar] Building the cbits library is simpler with UseGhcForCC=YES. 14bd795 [project @ 2002-02-06 11:49:32 by simonmar] #include 9b7636b [project @ 2002-02-06 11:50:31 by simonmar] Back off: don't use UseGhcForCc as a magic way to get the right include paths, because we still need to tell mkdependC about them. c42e3e7 [project @ 2002-02-06 11:51:12 by simonmar] - change package name to "base" - make GHC/PrimopWrappers work. 91890c6 [project @ 2002-02-07 11:13:29 by simonmar] Various updates after rearranging the directory structure in the repository (there wasn't any history worth keeping, and it's better to do this now before we go 'live'). 91ceefe [project @ 2002-02-11 12:27:34 by simonmar] These files aren't necessary any more. 81759ad [project @ 2002-02-11 12:28:04 by simonmar] Final part of QuickCheck from hslibs/utils. 8294089 [project @ 2002-02-11 12:28:31 by simonmar] Export the various memcpy functions (following ghc/lib/std/PrelIO.hs) 812e0e5 [project @ 2002-02-11 12:28:57 by simonmar] Export runMain (following ghc/lib/std/PrelTopHandler.lhs) 82009cd [project @ 2002-02-11 12:29:13 by simonmar] HsCore ==> HsBase 2e98b12 [project @ 2002-02-11 12:31:30 by simonmar] - Don't forget System/Console - Add -fglasgow-exts and -cpp here rather than mk/target.mk 2b944de [project @ 2002-02-11 16:11:38 by simonmar] Add missing Show instance for Ptr. 3be5332 [project @ 2002-02-11 17:10:56 by simonmar] don't forget -funbox-strict-fields for GHC.IOBase 1d2fd05 [project @ 2002-02-11 17:11:12 by simonmar] New module from ghc/lib/std. 4a8a7df [project @ 2002-02-11 17:30:57 by simonmar] Add code to build/install the split version of this library on Windows (untested). It may be that the base library has grown sufficiently to warrant being split into 3 now, or we may need to orgnise the splitting criteria a little better. Feedback from someone with a Win32 build would be welcome (once I've checked the rest of the changes in). 93c7ce3 [project @ 2002-02-12 09:39:19 by simonmar] Merge rev. 1.61 of ghc/lib/std/PrelBase.lhs 30f1170 [project @ 2002-02-12 10:50:03 by simonmar] The new home for performGC. 0280956 [project @ 2002-02-12 10:50:37 by simonmar] Make this build: OPTIONS -fparr and place it above the Prelude in the dependency tree. 4ab1eb1 [project @ 2002-02-12 10:51:06 by simonmar] Export h{Get,Set}Echo, and hIsTerminalDevice 7dca863 [project @ 2002-02-12 10:52:18 by simonmar] Place this below the Prelude in the dependency tree, so we can import it in Foreign.Ptr without creating a loop. 2eb8067 [project @ 2002-02-12 10:52:47 by simonmar] wibbles d6db874 [project @ 2002-02-12 15:17:34 by simonmar] Switch over to the new hierarchical libraries --------------------------------------------- a5aeb37 [project @ 2002-02-12 15:51:26 by simonmar] Remove fromInt/toInt 6a5400d [project @ 2002-02-13 10:17:29 by simonmar] include to get PATH_MAX aadca45 [project @ 2002-02-13 10:43:15 by simonpj] Use C comments not Haskell comments; ghc-pkg doesnt understand the latter a06ba1a [project @ 2002-02-13 11:51:40 by simonmar] - Detect presence of a POSIX-compatible regex interface in configure, and omit Text.Regex.Posix (and hence Text.Regex) if it is missing. ToDo: pull in a suitably-licensed implementation of POSIX regex to be used in the event that the system doesn't supply one. 3807ed7 [project @ 2002-02-13 11:52:42 by simonmar] Remove a ToDo 462a416 [project @ 2002-02-13 12:12:08 by simonmar] Make this build on mingw32 (hopefully) 6fba759 [project @ 2002-02-13 12:17:14 by simonmar] import Prelude 940f32e [project @ 2002-02-13 12:21:21 by simonmar] Merge inputReady.c from ghc/lib/std 14e3ec8 [project @ 2002-02-13 14:26:01 by simonmar] Move c_unlink foreign import outside #ifdef mingw32_TARGET_OS d171497 [project @ 2002-02-14 07:31:03 by sof] Time stubs (for mingw) 2623394 [project @ 2002-02-14 07:31:34 by sof] hook in timeUtils.h fb2142f [project @ 2002-02-14 07:32:17 by sof] mingw: support timezone and tzname (as before) 53fee2b [project @ 2002-02-14 07:33:09 by sof] move half a dozen non-mingw f-imports into approp. ifdef section 284990d [project @ 2002-02-14 13:59:20 by simonmar] Import FreeBSD's regex library 097df6a [project @ 2002-02-14 13:59:21 by simonmar] Initial revision 1315c81 [project @ 2002-02-14 14:01:38 by simonmar] ==> "regex.h" dd0df11 [project @ 2002-02-14 14:03:25 by simonmar] Remove support for "collate" which appears to be a locale-independent way of interpreting character ranges like [a-z]. Anyway it relies on stuff internal to FreeBSD's libc which doesn't appear to be easy to extract, so just disable it. a64abb7 [project @ 2002-02-14 14:05:12 by simonmar] FreeBSD regex library requires reallocf(), a FreeBSD-specific flavour of realloc(), so include it here. 653ce69 [project @ 2002-02-14 14:05:48 by simonmar] Include regex stuff if $(HavePosixRegex) == "NO" cf20c1f [project @ 2002-02-14 14:07:16 by simonmar] Also import FreeBSD's regex.h 29f017b [project @ 2002-02-14 14:08:25 by simonmar] Use cbits/regex if the system doesn't have a POSIX-compatible regular expression library. 94f887f [project @ 2002-02-14 14:08:50 by simonmar] Catch up with changes to the foreign import syntax. 96e0216 [project @ 2002-02-14 15:14:02 by simonmar] Fixes to 'make install' in fptools/libraries. We have to maintain the directory structure when installing the .hi files, rather than just dumping them in a single directory as we do for packages in fptools/hslibs. 9668657 [project @ 2002-02-15 11:26:02 by simonpj] mingw32 doesn't define _POSIX2_RE_DUP_MAX, it seems d3e0af2 [project @ 2002-02-15 11:27:03 by simonpj] - include rather than non-std - remove use of __P-style prototypes a6c2f10 [project @ 2002-02-15 11:28:47 by simonpj] Remove __P from prototypes 2f68fca [project @ 2002-02-16 18:04:28 by simonmar] Must #include before regex.h ac8a1df [project @ 2002-02-17 15:22:11 by panne] Synch import_dirs with the result of "make install". It could have been fixed the other way round, but fixing the config files makes more sense to me. Furthermore, I've got a 50% chance of taking the correct route by pure accident... ;-) fc84d36 [project @ 2002-02-17 20:05:35 by panne] Install GHC.Prim interface file, too... *sigh* 3d4cbc2 [project @ 2002-02-17 20:08:56 by panne] Add missing commas... >:-( 73fd86e [project @ 2002-02-26 18:19:17 by ross] New Control.Arrow module, plus Arrow stub (in lang) for compatability. 850446d [project @ 2002-02-27 14:31:44 by simonmar] remove unnecessary import of GHC.Prim de74d2e [project @ 2002-02-27 14:32:23 by simonmar] Define hTell in GHC.Handle, and export it from System.IO 8dc326e [project @ 2002-02-27 14:33:09 by simonmar] Move the Float/Double constant folding rules from GHC.Float to GHC.Base, thus returning GHC.Float to its non-orphan status. a88f4e3 [project @ 2002-03-04 17:02:43 by simonmar] - generate GHC/Prim.hi from GHC/Prim.hi-boot using ghc --compile-iface - compile the whole lot with -funbox-strict-fields fc033a9 [project @ 2002-03-04 17:25:36 by panne] Export modifySTRef, too b05d975 [project @ 2002-03-05 14:31:47 by simonmar] The interface file for GHC.Prim is now built-in to the compiler, and mostly automatically generated. aa8f96f [project @ 2002-03-11 14:53:51 by simonmar] Use updated FFI syntax 9cd0f82 [project @ 2002-03-14 12:09:49 by simonmar] Eliminate some orphan-instance modules to speed up compilation. 9295636 [project @ 2002-03-14 16:26:40 by simonmar] Add class Splittable that accidentally got dropped on the floor when we moved over to the new libraries. 3b376f0 [project @ 2002-03-15 12:42:39 by simonmar] Convert to new syntax 25f91cb [project @ 2002-03-15 12:45:12 by simonmar] This doesn't appear to be used 6141dee [project @ 2002-03-18 14:03:20 by simonmar] Fix silly bug I noticed unpackAcc, which apparently is not triggered. 079e705 [project @ 2002-03-19 10:59:01 by simonmar] Use new form of FFI declarations 4a7079b [project @ 2002-03-19 11:24:51 by simonmar] Fix 64-bit shift operations. 1fc6ee2 [project @ 2002-03-20 15:38:36 by simonmar] convert to new-style FFI declarations 531934f [project @ 2002-03-22 10:20:24 by simonmar] This module now lives above the Prelude in the dependency tree. 9e18cb4 [project @ 2002-03-25 05:23:53 by sof] provide isblank() for Win32 282a245 [project @ 2002-03-25 05:25:27 by sof] make splitting of HSbase.o work (mingw only) ddce1d0 [project @ 2002-03-25 15:49:26 by sof] make HSbase splitting a mingw-only affair (and a sorry one, at that.) 9b78160 [project @ 2002-03-26 10:44:32 by simonmar] sigaddset returns a CInt, not () b7db2ac [project @ 2002-03-26 10:53:03 by simonmar] sigaddset() can be a macro, so add an wrapper around it (inlined in via-C mode). I didn't bother with the #ifdef darwin_TARGET_OS around this change since it doesn't hurt on other architectures. 7751d5d [project @ 2002-03-26 17:03:08 by simonmar] Add type signatures for isAlreadyExistsErrorType & friends 3294e5f [project @ 2002-03-26 17:06:32 by simonmar] Add some missing type signatures 0c19e67 [project @ 2002-03-26 17:09:52 by simonmar] Update foreign import declaration to new syntax 517c086 [project @ 2002-03-26 17:11:15 by simonmar] Update to new FFI syntax 8babd81 [project @ 2002-03-26 20:18:28 by sof] mingw32: drop msvcrt from extra_libraries list 77f9723 [project @ 2002-03-26 21:02:19 by sof] cygwin: stick with system() bd0e9f9 [project @ 2002-03-26 21:07:06 by sof] make it work with cygwin again e580c66 [project @ 2002-03-26 23:50:56 by sof] To make cygwin/mingw interworking a little bit simpler, use the __MINGW32__ define rather than config.h's mingw32_TARGET_OS d5cce22 [project @ 2002-03-27 17:55:26 by simonmar] Fix cut-n-pasto (the testsuite actually showed up something useful!) a133f05 [project @ 2002-04-01 09:19:18 by simonpj] Remove Ix context from STArray data type. Data type contexts are evil. H98 says they even apply for pattern matching, which GHC didn't implement till now --- and that forces Ix even on equality of STArrays. No, no, no. 85e5a42 [project @ 2002-04-02 10:19:21 by simonmar] Add foldl', the strict version of foldl. 6ba6fe1 [project @ 2002-04-02 15:33:34 by sof] don't bother defining __hscore_sigaddset() on mingw b77afa8 [project @ 2002-04-10 11:43:49 by stolz] Two new scheduler-API primops: 36d4430 [project @ 2002-04-10 15:57:16 by simonmar] Update to newer FFI definition style 76a82fd [project @ 2002-04-11 12:03:43 by simonpj] ------------------- Mainly derived Read ------------------- 16bc668 [project @ 2002-04-13 05:08:55 by sof] readIEEENumber: support reading IEEE-754 'special' values (NaN,Inf) 6d3da36 [project @ 2002-04-13 14:59:06 by panne] Ugly hack to make `lex' H98-compliant again: lex "" should return [("","")], not []. This should probably be fixed elsewhere... 0549a06 [project @ 2002-04-18 23:32:56 by sof] re-added Show instance for ThreadId 8421673 [project @ 2002-04-24 11:17:53 by simonpj] "\Oxxx" and "\Xyyy" are not octal or hexadecimal escapes in Haskell 98, and should not be lexed as such. 27c5dda [project @ 2002-04-24 15:47:10 by sof] Directory.Permissions.searchable: True iff S_ISDIR() and X bit set (was : !S_ISREG() and X) -- falls into line with what nhc98 and Hugs does c1253ce [project @ 2002-04-24 15:47:34 by simonmar] Update foreign import syntax bd0c347 [project @ 2002-04-24 16:01:51 by simonmar] Update foreign import syntax ea1718d [project @ 2002-04-24 16:09:12 by simonmar] Update foreign import syntax 0183707 [project @ 2002-04-24 16:10:21 by simonmar] Omit the generic declarations when processing with Haddock, since the Haddock parser doesn't understand them (yet). 13a593f [project @ 2002-04-24 16:13:26 by simonmar] Makefile rules for building HTML documentation using Haddock. It's a bit rough around the edges so far, and I haven't added any actual documentation yet, but you can build Haddock (in fptools/haddock) and then say f014372 [project @ 2002-04-24 16:31:37 by simonmar] Add the single character '|' to the header comment of each module so that Haddock will parse it as the module documentation. 63a85e7 [project @ 2002-04-24 17:57:55 by ross] haddock food. cf1acc8 [project @ 2002-04-26 12:31:06 by simonmar] Add a LICENSE f478c5a [project @ 2002-04-26 12:48:16 by simonmar] - Add proper module headers to these guys - Remove \$Id\$ - Update copyrights - Int.lhs and Word.lhs were just wrapped in \begin{code}..\end{code}, so make them .hs files instead. 1d53e7e [project @ 2002-04-26 12:58:45 by simonmar] doc string wibble 8b348ed [project @ 2002-04-26 13:26:39 by simonmar] We can cope with Control.Monad.Reader & friends now (Haddock can parse fundeps). 6aa094d [project @ 2002-04-26 13:33:10 by simonmar] - Remove \$Id\$ - Fix comments that confuse Haddock 1eb49e8 [project @ 2002-04-26 13:34:05 by simonmar] Remove \$Id\$ from all files: it isn't particularly useful (see previous discussion on cvs-ghc at haskell.org), and it confuses Haddock. c38c0d0 [project @ 2002-04-26 15:39:50 by lewie] Fix broken def of fixST. 0fe6b08 [project @ 2002-04-28 02:01:00 by sof] \\begin{code} prefix missing ea54d6c [project @ 2002-05-02 15:20:02 by sof] extra_libraries(mingw): The Return of MSVCRT d33f77b [project @ 2002-05-03 08:39:17 by simonmar] Fix the build on Sparc-Solaris, hopefully without breaking it on Windows. 5af37c0 [project @ 2002-05-06 06:51:00 by sof] timezone mingw fix, making this module resemble even more of a dog's dinner 246a1e7 [project @ 2002-05-09 10:43:26 by simonmar] Omit the imports in Haddock, to avoid module recursion e9a4da6 [project @ 2002-05-09 10:43:42 by simonmar] We can process GHC.Err with Haddock now c427a78 [project @ 2002-05-09 13:05:46 by simonmar] Fix comments that are misinterpreted by Haddock f9efc41 [project @ 2002-05-09 13:09:30 by simonmar] singletonSet has been deprecated for a while; remove it now d66534a [project @ 2002-05-09 13:13:28 by simonmar] Add documentation Haddock-style 6c9f614 [project @ 2002-05-09 13:14:42 by simonmar] tweak the module comment 961034a [project @ 2002-05-09 13:15:07 by simonmar] Various tweaks needed to get the source processed cleanly with Haddock. cbe4350 [project @ 2002-05-09 13:16:29 by simonmar] Rename libraries/core to libraries/base in the module headers. 95b47f8 [project @ 2002-05-09 13:28:30 by simonmar] Add a type signature for getClockTime ba4af98 [project @ 2002-05-10 08:35:05 by simonmar] import GHC.Ptr instead of Foreign.Ptr (I fixed the latter to export Ptr abstractly yesterday). b647b00 [project @ 2002-05-10 08:38:53 by simonmar] import GHC.Ptr to get the representation of Ptr. This module should really be split into compiler-dep and indep. parts. 8678a54 [project @ 2002-05-10 08:58:34 by simonmar] Convert these files from .lhs to .hs, and give them proper headers to match the style used in the rest of the libraries. d4fdc8b [project @ 2002-05-10 13:16:55 by simonmar] Add GHC/PrimopWrappers to EXTRA_SRCS 6d89b63 [project @ 2002-05-10 13:17:27 by simonmar] - Add documentation to Control.Concurrent and friends - Other documentation tweaks 6f9702f [project @ 2002-05-10 13:42:07 by simonmar] Add documentation 17d7506 [project @ 2002-05-10 14:51:14 by simonmar] Add some documentation for IORef 329155d [project @ 2002-05-10 14:52:00 by simonmar] give slurpFile, hGetBuf and hPutBuf reasonable behaviour for zero-sized files 75f4492 [project @ 2002-05-10 15:41:33 by simonmar] More documentation bcb5a52 [project @ 2002-05-10 16:18:28 by simonmar] More documentation d84005c [project @ 2002-05-11 08:59:08 by panne] Now that Int is exported, it might be a good idea to import it first... 88915b4 [project @ 2002-05-14 13:22:37 by simonmar] Replace qsort by mergesort, which is more reliable performance-wise. From: Ian Lynagh 3a440b1 [project @ 2002-05-14 21:08:59 by sof] lexNumberBase: support negative exponents f9650ca [project @ 2002-05-15 09:00:00 by chak] * Added the options `-ffi' and `-fffi', which switch on FFI support (`-fglasgow-exts' implies `-fffi'). 1b5a6b0 [project @ 2002-05-15 12:16:11 by simonmar] Fix non-Haddockish comments 1d0511c [project @ 2002-05-15 12:17:18 by simonmar] Fix comment to avoid confusing Haddock 1ce999f [project @ 2002-05-16 11:39:36 by simonmar] Happy -g currently requires GlaExts, which means it can't be used inside fptools/libraries (GlaExts comes from lang, and lang isn't built yet). So, until I've fixed Happy and everyone has built & installed the vnew version... e1e5818 [project @ 2002-05-27 14:30:49 by simonmar] Define __HADDOCK__ for .hs files as well as .lhs files. 7801cb1 [project @ 2002-05-27 14:31:06 by simonmar] Document Control.Exception and Data.Dynamic 4529737 [project @ 2002-05-27 14:36:51 by simonmar] Documentation 45c786b [project @ 2002-05-27 14:54:27 by simonmar] Add documentation af9b642 [project @ 2002-05-27 15:43:44 by simonmar] Documentation for System.Mem.Weak 8b2db71 [project @ 2002-05-27 15:57:01 by simonmar] Documentation, such as it is aedfb63 [project @ 2002-05-28 10:38:50 by simonmar] Document Text.Regex.Posix and Text.Regex 464de01 [project @ 2002-05-28 11:21:03 by simonmar] Add documentation 1b8ad7d [project @ 2002-05-28 11:21:56 by simonmar] tweak documentationa 119d39f [project @ 2002-05-28 11:41:29 by simonmar] Documentation tweaks cfd85d6 [project @ 2002-05-28 11:43:59 by simonmar] Export list tweak ca58f27 [project @ 2002-05-28 12:00:17 by simonmar] typo 59d3cc6 [project @ 2002-05-28 12:03:06 by simonmar] Document d5f23e5 [project @ 2002-05-28 14:04:18 by simonmar] Fix mistake in 'evaluate'. 47351d7 [project @ 2002-05-28 14:06:01 by simonmar] Add (minimal) documentation d9e75d6 [project @ 2002-05-28 15:04:54 by simonmar] Documentation b7e39d2 [project @ 2002-05-28 16:32:45 by simonmar] Documentation 34352f3 [project @ 2002-05-28 16:33:46 by simonmar] Documentation for the overloaded array interfaces (currently a bit flaky due to a couple of shortcomings in Haddock). a155a4f [project @ 2002-05-28 19:22:04 by sof] make it compile edd63fd [project @ 2002-05-29 13:22:10 by simonmar] Don't need to escape single quotes 99fb1fd [project @ 2002-05-29 13:27:04 by simonmar] fix case of markup inside bird tracks. 79f4ce8 [project @ 2002-05-29 13:28:36 by simonmar] doc fixes 6e681bc [project @ 2002-05-31 09:43:04 by panne] Added Show instance for FunPtr a85886b [project @ 2002-05-31 12:22:33 by panne] Moved Parsec to its new home 13a70d1 [project @ 2002-06-03 13:19:37 by simonmar] IO.hGetContents ==> System.IO.hGetContents (in docs) 7fa4fa4 [project @ 2002-06-04 19:12:53 by sof] PEi(x86) backends: The addition of Parsec to libraries/ put us over the limit for splitting HSbase into two parts (at least I couldn't find a good paritioning), we now need three. Fun and games. 2bf1f14 [project @ 2002-06-04 19:13:31 by sof] Adjust to three-way split of HSbase + accommodate cygwin. a734568 [project @ 2002-06-05 11:30:38 by ross] documentation adjustments. 62cf41f [project @ 2002-06-05 14:08:24 by simonpj] ------------------------------------------------ Fix the (new) lexer, and make the derived read and show code work according to the new H98 report ------------------------------------------------ 704ce13 [project @ 2002-06-06 16:01:37 by simonpj] Win32 comment c2841cb [project @ 2002-06-06 16:03:16 by simonpj] Read instance for Array, plus some documentation 72104bf [project @ 2002-06-08 13:11:27 by panne] Install HSbase3.o, too. NOTE: This is untested, but probably corrects the previous commit. 27473ce [project @ 2002-06-08 14:14:08 by panne] Minor doc formatting improvement 85947b6 [project @ 2002-06-09 14:20:06 by panne] Use :%, not % for Inf/NaN, the latter would immediately lead to a runtime error. Note that 6a18f39 [project @ 2002-06-11 10:53:03 by simonmar] typo in email address (noticed by J?n Fairbairn, thanks J?n). 37e6bac [project @ 2002-06-13 10:41:31 by simonmar] Some extra docs, from Jon Fairbairn 326ca1a [project @ 2002-06-13 23:26:55 by sof] Provide STRefs over both lazy and strict ST monads as, 38ef02a [project @ 2002-06-14 08:17:08 by simonpj] Add comment 85e48ad [project @ 2002-06-18 09:31:05 by simonpj] -------------------------- Deal with NaN and Infinity -------------------------- 23e923d [project @ 2002-06-18 13:01:43 by simonmar] Fix bug in the implementation of hGetLine: on finding the EOF when we have a partial line in our hands, we weren't resetting the state of the buffer to empty, so the same partial line would be returned for each subsequent call to hGetLine. 301802f [project @ 2002-06-18 13:58:22 by simonpj] --------------------------------------- Rehash the handling of SeqOp --------------------------------------- 238e58e [project @ 2002-06-19 14:33:24 by simonmar] Remove this hack. Happy 1.13 is now required to build GHC. b3f7a16 [project @ 2002-06-20 13:54:40 by simonmar] Add license from Andy Gill's HTML library 26b212c [project @ 2002-06-20 14:56:11 by malcolm] Remove spurious comma in export list. b32e15d [project @ 2002-06-20 16:11:45 by simonmar] use $(includedir) and INSTALL_INCLUDES rather than overriding $(datadir) 73210e5 [project @ 2002-06-20 16:12:58 by simonmar] Haddock stuff has moved to ../../mk/package.mk 0da7603 [project @ 2002-06-21 09:12:37 by simonmar] Andy Gill asked me to remove his license to keep things simple. 555ccfc [project @ 2002-06-21 14:00:32 by simonmar] Mention the package name in the Haddock title ea25fea [project @ 2002-06-24 14:40:02 by simonmar] Makefile updates for generating docs with Haddock: 56b5187 [project @ 2002-06-26 08:18:45 by stolz] - Make TSO "stable" again: The thread label was changing the size of the TSO if you were building a debugging-RTS, leading to binary incompatibility. Now we map TSOs to strings using Hash.c. 7158d54 [project @ 2002-06-27 13:40:37 by stolz] - forkProcess[Prim] wrapper - document forkProcess[Prim] & labelThread 4e7a0c7 [project @ 2002-06-27 15:38:58 by simonmar] Finally fix foreign export and foreign import "wrapper" so that exceptions raised during the call are handled properly rather than causing the RTS to bomb out. 92b386e [project @ 2002-06-27 17:19:01 by sof] theStdGen: initialise it via mkStdRNG (as was done in <= 5.02) 0ca4afd [project @ 2002-07-01 11:37:35 by simonmar] Replace divInt# with a version which doesn't suffer from overflow problems (thanks to Dylan Thurston for the code). 8a59647 [project @ 2002-07-01 18:50:54 by sof] closesocket() is stdcall-based b86afd9 [project @ 2002-07-02 10:28:54 by simonmar] Documentation for hSetBinaryMode 8ea1560 [project @ 2002-07-02 10:31:35 by simonmar] Documentation for system 42df532 [project @ 2002-07-02 10:33:23 by simonmar] Documentation for getProgName. eb74c19 [project @ 2002-07-02 10:34:52 by simonmar] Point the punters to the online report at haskell.org until the documentation for the Prelude is up to scratch. 3f4ad5d [project @ 2002-07-02 13:13:36 by simonmar] Add descriptions to the top level of each package documentation be5e68d [project @ 2002-07-03 13:05:28 by simonmar] Export dynApply and dynApp a79716a [project @ 2002-07-04 10:42:32 by simonmar] Explicitly import the Prelude, and add a few types signatures to make these modules produce better documentation. ab6d22d [project @ 2002-07-04 12:57:39 by simonmar] We have to define _POSIX_PTHREAD_SEMANTICS on Solaris in order to get the right versions of the _r functions. Otherwise we get Solaris-specific versions of these, which puts a spanner in the works. 2b24ca8 [project @ 2002-07-04 13:33:24 by simonmar] Sigh, enabling _POSIX_PTHREAD_SEMANTICS causes the Solaris header files to drop several silly little C functions into the source code. We don't want these duplicated in every Haskell-compiled object. 99abeb9 [project @ 2002-07-04 16:22:02 by simonmar] Flesh out the documentation a bit. cbfc311 [project @ 2002-07-08 10:43:10 by simonmar] Fix a bug in getDirectoryEntries where the directory stream wasn't always being closed. This one shows up on Solaris as a "too many open files" failure when trying to run the test suite. 21101cc [project @ 2002-07-15 12:25:24 by simonmar] Remove duplication in the extra_libraries list for mingw32 54be0e0 [project @ 2002-07-15 16:02:11 by simonmar] Remove for extra commas in export lists (GHC is a little too lenient). Patch from Ross Paterson. 2726d8d [project @ 2002-07-15 16:15:14 by simonmar] extra comma in export list 2fc64f6 [project @ 2002-07-16 15:47:25 by ross] First stage of making the new libraries work with Hugs: 62fbfbb [project @ 2002-07-16 16:08:58 by ross] Add imports of Hugs.* modules (wrapped in #ifdef __HUGS__) to make these modules work with Hugs. 1c817f8 [project @ 2002-07-16 22:42:28 by sof] handleFinalizer: (also) use the handle's type/state to decide whether or not go ahead with close()ing. 3440daa [project @ 2002-07-17 09:22:20 by simonmar] Need to #include now that Stg.h doesn't. f471318 [project @ 2002-07-17 10:47:01 by ross] Make the libraries' Numeric module usable by Hugs. Also deleted a chunk of code inside #ifdef __HUGS__ -- this was unused, and the copy in Hugs (now Hugs.Numeric) has since been improved. (Since these functions are portable, ideally they would be merged with the versions in GHC.Float) f9b1dab [project @ 2002-07-18 22:01:07 by sof] helper functions for mucking about with Win32 consoles 7c948d6 [project @ 2002-07-18 22:01:50 by sof] win32 console-based implementations of setCooked, {get,set}Echo 674f4cc [project @ 2002-07-22 11:37:38 by ross] Make Data.Array.{IArray,MArray,IO,ST} work with Hugs, splitting off the IOArray part of Hugs.IOExts into Hugs.IOArray and (sadly) adding Hugs.Array.Base, a cut-down version of Data.Array.Base. c22589f [project @ 2002-07-22 13:30:43 by simonmar] Make the new mergesort stable. 4edbab6 [project @ 2002-07-23 10:46:27 by ross] Make Data.Unique work with Hugs. 5e3b441 [project @ 2002-07-23 14:52:46 by simonpj] Various precedence errors in the code for read and show. A couple (the show instances for Ratio and Array) were actually errors in the Library Report. A couple more were to do with whether the precedence of application is 9 (wrong) or 10 (right). f212d46 [project @ 2002-07-23 18:50:54 by sof] gmtoff: MS CRT implementation of _tzset() (and _timezone) assumes that >0 represent positions west of the Prime Meridian. This module assumes the opposite, so flip the sign of 'timezone' when compiling for mingw. 1089f6c [project @ 2002-07-23 22:04:36 by sof] inputReady(): using MsgWaitForMultipleObjects() instead of WaitForMultipleObjects() on file handles is nicer from within a message pump, but here it is less confusing to use the latter (and simply just block message delivery for its duration.) edb47ef [project @ 2002-07-24 09:57:21 by simonmar] tiny doc fixes 244cd16 [project @ 2002-07-25 14:14:36 by simonmar] Fix comment typos, from Reuben Thomas. f4692eb [project @ 2002-07-26 02:36:57 by sof] gmtoff: according to the (POSIX / Single Unix and MSVC) documentation of tzset(), 'timezone' is > 0 west of the Prime Meridian, so extend prev. commit to apply to all platforms, not just Win32. 0f3b6b1 [project @ 2002-07-26 10:05:04 by stolz] Add some references. Requires upgrade to current haddock version (>2002-7-25)! e75e1bb [project @ 2002-07-26 12:12:33 by stolz] Fix typo. 35d3afc [project @ 2002-07-26 13:23:38 by malcolm] Must start tweaking the libraries for NHC soon. 74bb702 [project @ 2002-07-29 09:54:40 by ross] Tweaked imports and includes for compatibility. 8a3d33f [project @ 2002-07-29 09:57:17 by simonmar] Remove non-existent and empty dirs from $(ALL_DIRS) 3be2ff0 [project @ 2002-08-01 12:50:31 by simonpj] Add parens to make precence clear 92a3d30 [project @ 2002-08-02 12:24:36 by simonmar] I can get away without -monly-3-regs for this file, now that GHC is passing -fno-builtin to gcc. 45e4c5f [project @ 2002-08-02 12:25:30 by simonmar] Don't need -monly-3-regs now. 7b56e9f [project @ 2002-08-02 12:26:36 by simonmar] Don't need -monly-3-regs now 1d084ab [project @ 2002-08-03 19:32:16 by reid] Changes to make libs work with Hugs/FFI. 823938f [project @ 2002-08-03 19:32:49 by reid] Oops f8650f2 [project @ 2002-08-03 20:14:23 by reid] oops again 71c1629 [project @ 2002-08-03 21:01:26 by reid] Final bout of changes to make things work with Hugs. a62c4c6 [project @ 2002-08-03 21:33:15 by reid] Directives like this a312934 [project @ 2002-08-05 08:29:17 by simonmar] Add missing GHC imports c49948b [project @ 2002-08-05 08:44:53 by simonmar] Move the import of System.IO.Unsafe into the #else part of #ifdef __GLASGOW_HASKELL__, because it was causing an import loop. (Alastair: that #else should probably be #elif __HUGS__, right?) 61b9f39 [project @ 2002-08-05 08:48:07 by simonmar] Remove the literate bits from this file: I'm trying to keep .lhs out of the non-GHC parts of the libraries tree, we don't use it any more and it clutters up the code. 56800ce [project @ 2002-08-07 12:17:59 by ross] Renamed HugsStorable -> Hugs.Storable (copy of lib/exts/HugsStorable.hs) b271ab1 [project @ 2002-08-08 06:25:05 by ross] Add hTell to Hugs. 535df85 [project @ 2002-08-08 22:29:28 by reid] Hugs provides makeForeignPtr instead of newForeignPtr. f379522 [project @ 2002-08-16 11:38:04 by simonmar] Data.Array.IArray should export Array too 70c3686 [project @ 2002-08-16 11:38:57 by simonmar] Some extra docs for addFinalizer, describing why using addFinalizer on a ForeignPtr isn't the same as using addForeignPtrFinalizer. 166a9e1 [project @ 2002-08-20 10:03:05 by simonmar] The Typeable instances were missing in the __GLASGOW_HASKELL__ case; add them. 0d287e0 [project @ 2002-08-21 10:43:22 by simonmar] Oops, unpackCStringUtf8# had rotted at some point, and no-one noticed. Some parentheses are required because the relative precedences of uncheckIShiftL# and +# (the default precedences, AFAICT) give the wrong meaning to some expressions. 8479863 [project @ 2002-08-23 22:10:43 by sof] ioeGetErrorString: don't "show" the string from a user error. 80972f6 [project @ 2002-08-25 09:16:07 by panne] Fixed bug in documentation introduced by "Mr. Haddock" himself. :-) 5c3189f [project @ 2002-08-27 14:44:31 by simonmar] We really should export the representations of Ptr and FunPtr from here. 1d36d59 [project @ 2002-08-28 13:59:19 by simonmar] - Move rawSystem from SystemExts to System.Cmd. - Move withArgv and withProgName from SystemExts to System.Environment 9efe433 [project @ 2002-08-28 14:30:12 by simonpj] Fix a lexing bug: "\SOH" could mean "\SO" followed by "H" or "\SOH". The Report specifies the latter. 5634a8a [project @ 2002-08-29 05:11:41 by ross] The functions rawSystem, withArgs and withProgName aren't supported by Hugs yet. 3250e7a [project @ 2002-08-29 09:24:21 by simonmar] Move library-project documentation to a better place, and add the current hierarchy spec. c50828c [project @ 2002-08-29 11:29:40 by simonmar] Foreign.C.TypesISO has been merged into Foreign.C.Types now. a0dfc75 [project @ 2002-08-29 11:49:10 by simonmar] Make the readline binding into a hierarchical library and put it in its own package (for licensing reasons). f5515f7 [project @ 2002-08-29 16:03:57 by stolz] Add replicateM[_] and foldM_ e2e8a57 [project @ 2002-08-29 16:05:59 by stolz] Haddock-ise with comments from library report 88a5df2 [project @ 2002-08-29 16:39:42 by stolz] - Haddock-ise with comments from library report - The chapter "Deriving Instances of Ix" doesn't end up in the "Contents" section (yet), although it should. 24a67b4 [project @ 2002-08-30 07:56:48 by stolz] Fix sample way of expressing 'killThread' in docs. 4471d43 [project @ 2002-08-30 10:46:10 by stolz] Haddock-ised. The previous version already did contain a lot of documentation which just wasn't in the right shape. The current documentation diverges slightly from the Library Report. 51cf67a [project @ 2002-08-30 12:25:15 by stolz] Express 'killThread' in terms of 'throwTo' 5988a17 [project @ 2002-08-30 12:32:44 by stolz] - Haddock-ise with comments from library report - FIXME: Haddock doesn't support nested enumerations. 5e2bb8f [project @ 2002-08-30 13:00:31 by simonpj] Remove bogus parError; MERGE TO STABLE e9e064d [project @ 2002-08-30 13:27:42 by stolz] Haddock-ise. a11109e [project @ 2002-08-30 13:43:57 by stolz] Haddock-ise with comments from library report cd4a2f2 [project @ 2002-08-30 14:19:18 by simonpj] Extra space after $ to avoid conflict with Template Haskell 45d3a3a [project @ 2002-08-30 14:29:51 by simonpj] * Do not export built-in syntax (H98 conformance) * Add 'assert' to GHC.Base a0e9e3e [project @ 2002-08-30 14:54:58 by simonpj] Move defn of hs_fileno inside ifdef ca2e48f [project @ 2002-08-31 08:37:56 by simonpj] Remove GHC.Base.assert until I can figure out what happened 2e44135 [project @ 2002-09-02 11:20:50 by ross] Minor rearrangement: the implementation of System.Exit.exitWith is GHC-specific, while exitFailure is portable. 44aa638 [project @ 2002-09-02 16:33:31 by ross] non-GHC compilers should also import Numeric. e7478d9 [project @ 2002-09-02 16:40:55 by simonpj] Un-break head build due to (:) export 5f7d567 [project @ 2002-09-03 00:15:45 by mthomas] Mingw32 has no fcntl() - use _setmode() (twice) instead. 2ba2065 [project @ 2002-09-03 09:40:51 by simonmar] (%) should be infixl 7 (thanks to Jon Fairbairn for pointing out the omission) 465fec0 [project @ 2002-09-04 15:52:20 by simonmar] Remove some unnecessary imports db34f07 [project @ 2002-09-04 16:05:29 by simonmar] GHC can derive arbitrary instances for newtypes, so derive Storable for the types in Foreign.C.Types, rather than using CPP trickery to define the instances. 03d4d61 [project @ 2002-09-04 16:46:40 by ross] Fix typo. 054a65b [project @ 2002-09-04 16:51:33 by ross] Foreign.C.TypesISO needs to import Foreign.Storable. Also added some imports for non-GHC platforms. 6bcd915 [project @ 2002-09-06 14:08:45 by simonmar] Implement 700db30 [project @ 2002-09-06 14:34:15 by simonmar] Partial rewrite of the POSIX library. aaa77a2 [project @ 2002-09-06 14:38:15 by simonmar] Make it build on mingw32, with a cut-down set of types 8fb5d72 [project @ 2002-09-06 15:00:04 by simonmar] Disable the whole contents on mingw32. At some point we might be able to provide cut-down signal support, but I'll leave that for later. 049c328 [project @ 2002-09-08 02:35:33 by sof] Hugs updates + fixes eea0c94 [project @ 2002-09-09 03:50:38 by sof] (hugs only): PrelImpl -> Hugs.Prelude 0a678e9 [project @ 2002-09-09 15:13:47 by simonmar] Comments only a97b83b [project @ 2002-09-09 15:30:58 by ross] Hugs-only changes: explicit imports + use approxRational. 39e7414 [project @ 2002-09-09 16:04:10 by ross] More imports for non-GHC platforms. 2d8cdf6 [project @ 2002-09-10 09:06:07 by simonmar] Remove CBlkCnt and add it to the ToDo list; it clearly isn't present on several systems yet. Fortunately we weren't using it. c7f1b29 [project @ 2002-09-10 09:13:52 by ross] H98 conformance: fill out (..)'s, and make the [] export GHC-only. bd2c070 [project @ 2002-09-10 10:50:28 by malcolm] Export the builtin syntax for []((:),[]), ()(()), and (->) in nhc98 as well as ghc. bf8e196 [project @ 2002-09-10 11:07:23 by ross] #ifdef's for Hugs, which only allows one import in the Prelude at the moment. 6fb52f7 [project @ 2002-09-10 11:36:04 by ross] non-GHC: import Control.Monad (needed by INSTANCE_STORABLE). d0b54cd [project @ 2002-09-10 20:45:50 by panne] Fixed slashification in Haddock comment 9f63d16 [project @ 2002-09-11 11:06:05 by simonpj] Add documentation about unsafePerformIO d7fd415 [project @ 2002-09-13 18:21:46 by panne] It looks like we need assert again...?! f8df252 [project @ 2002-09-13 18:25:07 by panne] Not quite sure about this one: Export builtin stuff like [], (), and (->) only for NHC, not for GHC anymore. e90d876 [project @ 2002-09-14 09:27:21 by panne] Make Haddock happy 976f582 [project @ 2002-09-16 11:24:20 by simonpj] Comments only d7827d3 [project @ 2002-09-16 11:24:36 by simonpj] Fix bug in Read instance for Maybe 9415bd4 [project @ 2002-09-16 11:29:39 by ross] Moved some stuff from Hugs.Prelude to Hugs.Char. a938d52 [project @ 2002-09-18 11:32:43 by simonmar] Sort out the divide-by-zero situation. c4f6fb9 [project @ 2002-09-19 10:47:21 by simonmar] re-export unsafePerformIO c43c694 [project @ 2002-09-19 13:24:52 by simonmar] Put this below the Prelude in the dependency tree. I accidentally created a loop with the latest change to Foreign.hs; this fixes it. 4e07ae0 [project @ 2002-09-20 13:15:07 by ross] Make Data.Array.Base more portable (no semantic changes, I hope) by f50294a [project @ 2002-09-23 09:19:53 by ross] remove unnecessary #ifndef __HUGS__ 05b3352 [project @ 2002-09-24 16:07:50 by sof] ioeGetErrorType(error case): don't pose as ioeGetHandle. 5d5f213 [project @ 2002-09-24 19:01:55 by sof] userErrors: don't barf on non-IOExceptions. 835f33e [project @ 2002-09-25 15:16:30 by simonpj] Remove readList__ 06f1b3b [project @ 2002-09-25 15:24:07 by simonmar] Re-instate the checking for the values of errno constants at configure time. The problem with doing it using foreign calls is simply that this tickles a bad case in the code gen machinery, which in this case results in an extra 10-20k of goop ending up in pretty much every binary, and it impacts GC performance too. 466552f [project @ 2002-09-25 22:49:17 by ross] Hugs only (but being considered for the ffi spec): added finalizerFree, a pointer to a foreign function equivalent to free, for use as a finalizer. e31ee99 [project @ 2002-09-25 22:55:41 by ross] Switch to mallocForeignPtr. 205cbfc [project @ 2002-09-25 23:01:11 by ross] (Hugs only) conform to the current FFI spec. This code makes the additional assumption that a finalizer added with addForeignPtrFinalizer runs before any existing finalizers on the same object. dee5fa3 [project @ 2002-09-25 23:06:30 by ross] (Hugs only) use StorableArray as a poor man's IOUArray. 22c5ce6 [project @ 2002-09-26 09:16:33 by simonpj] Comments 888c28e [project @ 2002-09-27 23:10:23 by erkok] The MonadRec.hs library, stolen from the Hugs release. 718505a [project @ 2002-09-29 20:24:00 by panne] Warning police #1: Nuke duplicate export of CSsize(..) f41af17 [project @ 2002-09-30 10:27:49 by simonmar] s/rm -f/$(RM)/ 51f335d [project @ 2002-09-30 14:31:02 by ross] Portability tweak. 911cbab [project @ 2002-10-01 10:32:11 by ross] Hugs only: reinstate infix declarations. It seems the Hugs limitation this was working around no longer exists. aee388f [project @ 2002-10-01 15:58:11 by erkok] Merge Fix.hs with MonadRec.hs, and remove the latter. ae10d00 [project @ 2002-10-01 16:29:47 by ross] Removed the strict ST instance (already in Control.Monad.ST) and moved the lazy ST instance to Control.Monad.ST.Lazy, so Control.Monad.Fix contains only instances for Prelude types, and is portable. cef863d [project @ 2002-10-03 12:43:50 by panne] Warning police #4: To use uname, we should try to #include . f511a7a [project @ 2002-10-03 12:57:42 by panne] Warning police #5: Nuked duplicate exports, simplifying (i.e. nuking :-) the export list on the way. The deep and arcane reasons for the strange #ifdef-ery in this module are not clear to me, so I hope no damage is done by this commit. :-} 5b0420b [project @ 2002-10-03 13:04:58 by panne] Warning police #6: Add prototype for writeErrString__, which is used by GHC.TopHandler. 849b1ed [project @ 2002-10-03 13:29:07 by panne] Warning police #7: Improved typing of TSOs a bit, getting rid of a bunch of C compiler warnings. 0ea562e [project @ 2002-10-03 13:41:35 by panne] Warning police #8: Exporting Foo(..) exports Foo's field selector functions, too, so let's nuke the latter from the export list. e9443b3 [project @ 2002-10-03 13:56:12 by panne] Warning police #9: Nuked modules from the export list which are already implied by other exported modules. Still quite a few warnings left here, though... >:-( ea49782 [project @ 2002-10-03 15:19:15 by ross] Reinstate the exports of the function names, because the module must export them, even though Hugs doesn't define them here. The old module export they overlapped with was there to pick up the tuple definitions for GHC, but that probably isn't necessary with the recent GHC changes. 4f5dbdf [project @ 2002-10-08 08:03:01 by wolfgang] Make the new Posix bindings compile on Mac OS X. Most notable, Mac OS X lacks *) lchown *) SIGPOLL I don't know of a replacement of either, so they are just left out when they are not detected by configure. 325f7ec [project @ 2002-10-09 16:55:30 by malcolm] Add a little infrastructure for building the hierarchical libraries with nhc98. 5704a5d [project @ 2002-10-09 17:08:18 by malcolm] Add #ifdefs for nhc98. e3dec53 [project @ 2002-10-09 17:24:12 by malcolm] Add #ifdefs for nhc98. 3d893a1 [project @ 2002-10-11 11:05:20 by malcolm] Make some more libraries buildable with nhc98. b8d2aa7 [project @ 2002-10-11 12:23:41 by stolz] Add even more #ifdefs for nhc98. 1d28f2f [project @ 2002-10-11 14:33:58 by simonpj] Fix cpp syntax 461576b [project @ 2002-10-14 10:06:28 by ross] #ifdef tweaks a9a5413 [project @ 2002-10-16 13:48:24 by ross] Remove special treatment of Hugs. 490c1b8 [project @ 2002-10-18 09:51:04 by simonmar] Add atomicModifyIORef, as discussed on the FFI list. 52b26ba [project @ 2002-10-18 12:28:38 by ross] Hugs only: simple version of atomicModifyIORef, relying on the absence of preemption from Hugs. If Hugs gets Haskell finalizers, they'll have to be blocked during this operation. a1a1efb [project @ 2002-10-18 13:32:56 by simonpj] Move Typable IORef instance to Dynamic; stops IORef.hs being an oprhan module 8995f70 [project @ 2002-10-18 16:29:18 by malcolm] Implement atomicModifyIORef for nhc98. 3bdd406 [project @ 2002-10-22 10:59:40 by simonmar] Don't bogusly cast ThreadId# to Ptr (). The right way to fix these warnings is to change the type signatures of cmp_thread and rts_getThreadId to take StgPtr rather than StgTSO *, since the compiler now has no internal distinction between the two in the backend (it used to, but recent simplifications removed the distinction). cae97a5 [project @ 2002-10-24 07:49:40 by mthomas] Unchecked quick fix. Hope to test tonight after getting home. 2819cfe [project @ 2002-10-25 13:07:41 by sof] Only interested in a subset when used in w/ Hugs eaceaff [project @ 2002-10-30 14:53:39 by ross] #ifdef's for Hugs 95bf297 [project @ 2002-10-30 18:21:25 by ross] (Hugs only) fix silly slip in last commit. ca950ea [project @ 2002-11-02 11:56:30 by ross] Hugs only: export throwIO :: Exception -> IO a instead of a generalized ioError. This is an interim measure to keep Hugs working until it's decided what to do about IOError. ad6af6a [project @ 2002-11-06 10:38:16 by simonmar] - Add a Show instance for ForeignPtr 546ca2b [project @ 2002-11-06 20:30:26 by ross] Hugs only: move the dummy implementation of evaluate here, to avoid ambiguity. 508314c [project @ 2002-11-06 23:47:16 by ross] Minor #elif adjustment (__HUGS__ vs __NHC__). 2ca778b [project @ 2002-11-07 10:41:59 by stolz] - Explicitely document order of parameters in addToFM_C. fe0bb42 [project @ 2002-11-08 09:04:35 by simonpj] --------------------------------- Tiny H98 fix to numericEnumFromThenTo --------------------------------- b57bb87 [project @ 2002-11-13 10:35:18 by simonmar] Remove superfluous escaping of quotation marks in the example code (Haddock interprets bird-tracked code literally). 6952eca [project @ 2002-11-19 11:28:51 by simonmar] Doc fix for unsafeInterleaveIO 28d31e7 [project @ 2002-11-20 13:44:41 by simonmar] Allow opening a character special device; we treat it as a stream, even though it might be seekable. This allows opening /dev/stdin, /dev/null, etc. 5d7f1de [project @ 2002-11-20 13:45:20 by simonmar] Add experimental hDuplicate and hDuplicateTo. 8e0ccdb [project @ 2002-11-22 10:52:23 by stolz] Add 'mapException' as proposed in "A semantics for imprecise exceptions" 2d18757 [project @ 2002-11-26 17:32:33 by ross] added missing _ == _ = False to Eq Exception. 0f9d7cc [project @ 2002-12-03 14:30:12 by simonmar] Eeek! A nasty bug has been lurking in waitQSemN, which as far as I can make out has been there for ever. Presumably no-one uses this abstraction... a277cae [project @ 2002-12-05 09:49:38 by simonmar] annotateIOError was somehow missing from the export list... 69ee5e6 [project @ 2002-12-05 14:20:56 by stolz] Add SA_RESETHAND (aka SA_ONESHOT) support. Requested by: John Meacham 92aa54d [project @ 2002-12-05 14:44:02 by stolz] Don't forget peeking signal handlers (nothing to see here, please move along) 731590a [project @ 2002-12-11 15:55:17 by simonmar] Obj type must be forall a.a now, to avoid confusing GHC's new tail-calling scheme. 166bb30 [project @ 2002-12-11 16:12:22 by ross] non-GHC: keep the old definition of Obj. 8a2c46b [project @ 2002-12-12 13:29:07 by ross] Hugs only: add an import. 052e3a7 [project @ 2002-12-12 13:32:06 by ross] Add an import for Hugs, and change some #ifdef __GLASGOW_HASKELL__ to #ifndef __NHC__ 455d1bb [project @ 2002-12-12 13:42:46 by ross] Changes to the exception interface, as discussed on the libraries list. 20d5d21 [project @ 2002-12-13 13:36:36 by malcolm] Add #ifdef around import Control.Exception, which does not exist in nhc98. f757f3c [project @ 2002-12-13 14:23:42 by simonmar] Fix bugs caused by missing casts in arithmetic expressions in stg_integerToInt64 and stg_integerToWord64. 308112b [project @ 2002-12-16 11:00:53 by malcolm] Un-break for nhc98. `bracket' now comes from IO, not System.IO. 74357f5 [project @ 2002-12-18 10:34:28 by malcolm] Add a bunch more libraries to the nhc98 build. ec173cb [project @ 2002-12-18 10:42:09 by malcolm] Make it work with nhc98. 8f36daa [project @ 2002-12-18 10:42:54 by malcolm] With nhc98, avoid overlap between Prelude defns and Control.Monad defns. 215aa25 [project @ 2002-12-18 10:43:38 by malcolm] Make it compilable with nhc98, although for now it omits all instances. b7a79db [project @ 2002-12-18 10:45:31 by malcolm] Now compiles with nhc98. 233ac57 [project @ 2002-12-18 16:29:25 by simonmar] "Auto" packages. 661c373 [project @ 2002-12-19 15:23:29 by ross] #ifdef's for Hugs. 538a7bc [project @ 2002-12-19 22:04:41 by malcolm] Make it work with nhc98. 962cbf5 [project @ 2002-12-19 22:06:20 by malcolm] Add a couple more libraries for nhc98. 86c6983 [project @ 2002-12-20 09:31:11 by simonmar] Oops, forgot to commit this with the "auto packages" changes. We now have to -#include "HsBase.h" explicitly. As far as I can tell it was happening by accident before, as a result of the base package being enabled by default. dda6705 [project @ 2002-12-20 09:41:20 by simonmar] Remove c_uname from here, it isn't required in the base package baf09e2 [project @ 2002-12-20 17:56:21 by ross] Make Hugs use all of System.IO.Error. e05ec88 [project @ 2002-12-20 18:43:53 by ross] Hugs only: use new version of evaluate. b5d7f55 [project @ 2002-12-23 13:33:16 by malcolm] Ensure all the Storable instances are available in nhc98. 15abba8 [project @ 2003-01-02 23:49:32 by ross] Hugs only: #ifndef out the bits Hugs can't do. a9b8e21 [project @ 2003-01-06 14:30:12 by ross] Consolidate to a single version of trace (except that GHC has the post-hook). This version adds a newline, which the old Hugs and NHC versions didn't. da0b599 [project @ 2003-01-08 13:06:30 by simonmar] Alter the order of the argument to annotateIOError to match mkIOError and the FFI spec. 69c7fbf [project @ 2003-01-08 14:08:29 by simonmar] Fix annotateIOError (bug noticed by Ross Paterson). 7b028df [project @ 2003-01-13 11:32:00 by simonmar] Fix off-by-one in splitWithPS. 9a0eab7 [project @ 2003-01-13 11:42:16 by simonmar] UArrays should always be initialized with known elements, otherwise we can lose referential transparency: ad1956e [project @ 2003-01-16 14:38:40 by ross] remove spurious #ifdef __HUGS__ 68ca3cb [project @ 2003-01-17 14:52:17 by ross] Exchange some functions between System.Mem.Weak (portable) and GHC.Weak (not). 481069c [project @ 2003-01-21 16:33:20 by ross] add local definitions of unsafeIOToST and stToIO 7d7ea76 [project @ 2003-01-22 10:55:56 by ross] add mallocForeignPtrArray and mallocForeignPtrArray0 as per latest FFI draft. 82c232f [project @ 2003-01-22 10:56:27 by ross] use mallocForeignPtrArray from Foreign.ForeignPtr 35cb996 [project @ 2003-01-22 14:44:50 by ross] simpler swapMVar (like readMVar): no need to unblock for a return. 64d3b39 [project @ 2003-01-23 11:46:57 by ross] add Ord instance, as per FFI spec 8e100c7 [project @ 2003-01-23 17:45:40 by ross] Hugs now uses most of Control.Exception. 746c210 [project @ 2003-01-23 18:06:01 by panne] Added (not-so-standard ;-) support for pooled memory management. No GHC-specifics like the use of arenas yet... 91b17a6 [project @ 2003-01-24 14:04:41 by simonmar] - Generalise seq to allow an unlifted type in its second argument. This works because seq is *always* inlined and replaced by a case. af7bb6a [project @ 2003-01-24 15:18:46 by malcolm] Move the 'shiftL/R' and 'rotateL/R' variants to become methods of the Bits class. This gives an instance the choice of which methods (directional, or unified) to implement directly. (This change was agreed in Sept 2002, but is only being committed now.) 0c37c76 [project @ 2003-01-25 15:54:51 by wolfgang] This commit fixes many bugs and limitations in the threaded RTS. There are still some issues remaining, though. f37e84a [project @ 2003-01-28 11:07:39 by simonmar] Hand-optimised versions of pokeArray and pokeArray0 (selected via #ifdef __GLASGOW_HASKELL__). 69a9b1f [project @ 2003-01-28 11:09:41 by simonmar] Provide hand-optimised versions of all the functions herein, protected by #ifdef __GLASGOW_HASKELL__. 2d32e3a [project @ 2003-01-28 21:38:30 by panne] After trying out re-exporting Foreign.Marshal.Pool from Marshal, it became obvious that -fno-implicit-prelude would be a good idea. :-} Otherwise one gets cirular dependencies to the Prelude. Alas, fixing this resulted in some uglification of the code in some places... e9eab4b [project @ 2003-01-28 21:48:23 by panne] As agreed (= no riots after the proposal :-) on the FFI list, introduce a re-exporting module Foreign.Marshal 129756c [project @ 2003-01-29 07:54:46 by panne] Ooops, unbreak non-GHC targets... 79c99f2 [project @ 2003-01-29 14:28:47 by ross] fix typo that broke non-GHC impls. ee0c867 [project @ 2003-01-30 12:51:05 by ross] fix for non-GHC 5d6dd6b [project @ 2003-01-30 20:41:10 by panne] * Fixed the comment breakage of the previous commit (Haddock failure) * Synched signature comments in header with reality * Added default implementation of 'rotate' in terms of 'rotateL'/'rotateR' * Removed spurios "signed": What's a signed rotate or a signed left shift?? 7c070f2 [project @ 2003-02-04 11:55:54 by simonmar] Add support for using vfork, which I apparently removed when this file was moved over from ghc/lib/std/cbits. Using vfork on Linux makes quite a big difference - eg. when building GHC.Base with -split-objs , I saw a 2.5s reduction in system time. 36f5c2d [project @ 2003-02-06 10:41:10 by ross] Hugs-only: special definitions of fromInt & fromDouble. df20eb8 [project @ 2003-02-06 10:41:13 by simonmar] Aargh! We were setting the VMIN and VTIME values in the termios structure when the terminal is in non-raw mode, rather than raw mode, because I had a test round the wrong way. cd2140e [project @ 2003-02-14 13:01:32 by simonpj] Fix for deriving of records with leading underscore, and corresponding lex e561eac [project @ 2003-02-14 17:11:59 by sof] - add missing config.h include to Handle.hs - Handle.hSetBuffering: don't bother putting the handle's FD into 'raw' mode under Win32. 'raw' mode is just too specialised and potentially confusing (see comments.) 399d175 [project @ 2003-02-17 11:43:21 by simonmar] Comment wibble 7634c8a [project @ 2003-02-17 15:13:09 by simonpj] Type sig for getTag 0ea018d [project @ 2003-02-17 15:13:56 by simonpj] Wibbles to ST Monad methods; I forget why 73bcd44 [project @ 2003-02-18 20:15:15 by panne] * Fixed bug #687034 (GetOpt overly ambiguous) * Reformatted comment * Synch example with reality 341b99a [project @ 2003-02-18 20:39:56 by panne] Guerrilla tactics: Re-export Foreign.Marshal.Pool >:-) 418d748 [project @ 2003-02-19 13:54:19 by malcolm] Oops, the "directory-collecting" modules Foreign and Foreign.Marshal were accidentally omitted from the nhc98 build. 2b90d5e [project @ 2003-02-20 09:36:40 by malcolm] Add Foreign.Marshal.Pool to the nhc98 build. cb266c1 [project @ 2003-02-21 05:34:12 by sof] Asynchronous / non-blocking I/O for Win32 platforms. 08e5613 [project @ 2003-02-26 10:22:14 by simonmar] Add a note about the problem with forkProcess, for the time being. a3d4b34 [project @ 2003-02-28 12:34:43 by stolz] - Rename System.Posix.Process.forkProcess to forkProcessAll - Move GHC.Conc.forkProcess to System.Posix with type 'Maybe ProcessID' 6005584 [project @ 2003-03-04 11:09:15 by simonmar] Split Data.Array.IO into Data.Array.IO.Internals (which defines and exports the concrete representations of IOArray and IOUArray) and Data.Array.IO which exports the user-visible API. 49bd7a3 [project @ 2003-03-04 13:36:39 by ross] add an #ifdef __GLASGOW_HASKELL__ 5b12681 [project @ 2003-03-05 15:53:10 by malcolm] Build the hierarchical libraries from .hc files when building nhc98 from .hc's. 46738fd [project @ 2003-03-05 15:54:59 by malcolm] For nhc98, use nullPtr rather than 0 as the argument to time(). 05657aa [project @ 2003-03-06 09:51:03 by simonmar] Add Data/Array/IO to list of directories f3fdb22 [project @ 2003-03-08 19:02:39 by panne] Fixed some broken/redirected/canonicalized links found by a very picky link checker. 6690828 [project @ 2003-03-08 23:03:47 by panne] More markup fixes... a04d391 [project @ 2003-03-09 20:19:27 by panne] Fixed markup confusion ("" vs. '') 73e53bb [project @ 2003-03-11 18:41:43 by panne] Fixed link to getArgs c486ae0 [project @ 2003-03-12 16:42:27 by ijones] * Added more Haddock documentation to functions / classes / types * Added section headings for classes / types * Added an Examples section 2f9a2ea [project @ 2003-03-14 13:08:04 by simonmar] Attach the finalizer to the write side of a duplex handle, where it should have been. Otherwise finalization of duplex handles doesn't work properly. daf54e0 [project @ 2003-03-26 12:35:34 by simonmar] Add getrlimit()/setrlimit() suppport 640bba6 [project @ 2003-03-26 15:25:46 by simonmar] Change our ForeignPtr implementation to match the spec: finalizers must now be foreign functions. b5a75c9 [project @ 2003-03-27 10:24:43 by simonmar] [ oops, forgot to commit this with the rest of the changes yesterday... ] 7fdfbbd [project @ 2003-03-30 12:20:16 by ross] withForeignPtr is portable. So is some other stuff, though only Hugs uses the portable versions at present. b08edd6 [project @ 2003-03-31 13:58:03 by simonmar] - Add ioeSet{ErrorType,ErrorString,Handle,FileName} to match the existing ioeGet* functions. 789daa6 [project @ 2003-03-31 13:58:43 by simonmar] Get the filename right in IOErrors generated by several functions in here. 2bb2c9c [project @ 2003-03-31 15:36:24 by ross] remove a GHC-ism 26d6e1e [project @ 2003-04-01 16:30:37 by simonpj] Use INLINE rather than SPECIALISE for ceiling, floor, truncate c44d034 [project @ 2003-04-01 16:32:04 by simonpj] Fix bogus implementation of readLitChar, lexLitChar fb462ef [project @ 2003-04-03 16:46:59 by ross] Graph and Tree modules, from GHC's Digraph (actually the Haddock version, which looks more recent). 0c03a60 [project @ 2003-04-04 14:36:31 by simonpj] lexChar wibblifications 6af0d63 [project @ 2003-04-04 16:12:01 by ross] Added a list of the modules in the package that don't work with Hugs. Such modules are skipped by the conversion script. Packages in which everything works with Hugs don't need such a file. d436ec4 [project @ 2003-04-08 14:52:26 by ross] import tweak da40a2b [project @ 2003-04-08 16:02:05 by simonpj] New ReadP module from Koen, featuring <++ combinator b5a2ffd [project @ 2003-04-08 16:14:29 by simonpj] add fixity for +++, <++ f5331a7 [project @ 2003-04-09 08:17:39 by simonpj] Remove redundant Prelude import a7eeab6 [project @ 2003-04-09 08:18:13 by simonpj] ------------------------------------- Fix the lexer so that it does the right thing for floating point and hexadecimal numbers ------------------------------------- 1d9d3df [project @ 2003-04-09 10:21:09 by simonpj] Typo baa562c [project @ 2003-04-11 10:11:24 by ross] rename GHC.Posix as System.Posix.Internals 7572369 [project @ 2003-04-11 10:41:23 by ross] move #hide to where it works f191210 [project @ 2003-04-11 11:10:57 by ross] rename Control.Monad.Monoid as Data.Monoid cfd486f [project @ 2003-04-11 11:43:09 by ross] Hugs only: use the whole thing now e1e8556 [project @ 2003-04-11 14:24:07 by simonmar] Plug a file descriptor leak: when finalizing a handle, we should ignore errors in the flushing operation and go ahead and close the handle anyway. 8612742 [project @ 2003-04-11 23:39:43 by ross] Hugs only: add a CBITS "pragma" to tell the Hugs conversion script which files from /cbits should be linked with the module by ffihugs, e.g. {-# CBITS HsNet.c initWinSock.c ancilData.c #-} cd9fc2f [project @ 2003-04-15 10:41:14 by simonmar] Re-instate joinPS which appears to have been accidentally left out of this revised version of PackedString, and add unlinesPS and unwordsPS which are the analogs of Data.List.unlines and Data.List.unwords respectively. c5fba01 [project @ 2003-04-15 12:42:13 by malcolm] Add unlinesPS, unwordsPS, joinPS, and splitWithPS, to the nhc98 version of the code. b4d32d3 [project @ 2003-04-16 15:12:02 by sof] hGetArray: wrong result length returned. b3e4120 [project @ 2003-04-17 07:01:27 by simonpj] Start on better Typeable aa5e82f [project @ 2003-04-17 07:26:12 by simonpj] Better Haddock documentation 709486e [project @ 2003-04-17 10:44:59 by simonmar] Add a hash table implementation. This is an implementation of Dynamic Hash Tables, transliterated from the code in GHC's RTS into Haskell. I'd like to say it looks nicer, and well, maybe it does a little. a650a9f [project @ 2003-04-17 12:58:14 by mthomas] Fix "System/Posix/Internals.hs:273: Malformed entity string". cc08a0a [project @ 2003-04-17 13:26:59 by simonmar] Doc wibbles c6e4ceb [project @ 2003-04-17 15:17:07 by simonpj] Comments and imports 7e51e8b [project @ 2003-04-17 15:23:37 by simonpj] ---------------------------------- Implement Typeable properly ---------------------------------- 230207a [project @ 2003-04-17 16:51:43 by simonpj] Add lots of new generics stuff ba88be2 [project @ 2003-04-21 16:32:05 by ross] Hugs only: Key is defined in Hugs.Prelude (because it needs Dynamic) e9526a4 [project @ 2003-04-21 16:32:39 by ross] adjust imports for Hugs's benefit. 534944a [project @ 2003-04-22 09:19:24 by ross] remove an ifdef'd out commented out import. 2cccdd0 [project @ 2003-04-22 09:21:34 by ross] Hugs only: minor re-arrangement of ifdefs. 19d4641 [project @ 2003-04-22 10:20:30 by malcolm] Exclude Data.Dynamic from the nhc98 build now that it no longer compiles. (Need to investigate getting Data.HashTable to work.) 0782b94 [project @ 2003-04-23 10:27:53 by simonmar] hGetArray/hPutArray with a count argument of zero now just return doing nothing. This brings them into line with hGetBuf/hPutBuf and fixes a bug in Data.PackedString.hPutPS which fails on an empty string. 1276f4a [project @ 2003-04-23 13:22:16 by simonmar] Doc wibble. 5af9479 [project @ 2003-04-23 14:29:51 by malcolm] Tweak #ifdefs to make it compile with nhc98. 4bae1fc [project @ 2003-04-23 14:36:26 by malcolm] Add Data.HashTable, Data.Monoid, and Data.Tree to the nhc98 build, and re-instate Data.Dynamic, which now uses Data.HashTable. 9ac18b6 [project @ 2003-04-24 12:25:26 by malcolm] Add instances of Data.Bits.Bits for Int/Word[8,16,32,64] in a different way. The module Data.Bits is only available from the base package, which is normally added to the link line *before* the standard libraries, hence if the instances are in the latter, you get link errors. So move the instances into the base package where they belong, in NHC.SizedTypes. 062c551 [project @ 2003-04-25 10:23:29 by simonmar] doc fixes 304f7fe [project @ 2003-04-25 10:24:20 by ross] non-GHC: remove instances for Word ceed85a [project @ 2003-04-25 10:24:58 by ross] add Data.Array.Diff to Hugs d270f3d [project @ 2003-04-25 17:42:26 by ross] add System.Info to Hugs 492be53 [project @ 2003-04-25 17:43:06 by ross] tiny haddock fix 9d76081 [project @ 2003-04-28 09:16:47 by ross] portability fixes, plus marking these as non-portable (uses forall). 63c961b [project @ 2003-04-28 09:18:29 by ross] add Text.ParserCombinators.ReadP, Text.ParserCombinators.ReadPrec and Text.Read.Lex to Hugs. (But they're not used by Read, because that would make the Prelude non-H98). 27242f9 [project @ 2003-04-30 08:36:21 by simonmar] When doing hGetChar on a block-buffered handle, don't wait for the buffer to be completely full before returning a character. This behaviour seems more useful, and matches what hGetLine and hGetContents do. 11a8412 [project @ 2003-05-05 19:44:28 by ross] non-GHC: fill out the Bits instances for Int and Integer, and make them work with Hugs. c212e87 [project @ 2003-05-08 16:06:41 by ross] avoid a C compiler warning about arithmetic with void * 0327389 [project @ 2003-05-12 08:48:09 by ross] some re-arrangement for the benefit of Hugs. 01f10fd [project @ 2003-05-12 08:54:21 by ross] add Haddock markers e36cd23 [project @ 2003-05-12 08:55:53 by ross] remove #ifndef __HUGS__ f443dbb [project @ 2003-05-12 08:57:55 by ross] cosmetic change 0d3f287 [project @ 2003-05-12 10:12:52 by ross] Hugs only (I hope): add unboxed arrays to Hugs 165eca2 [project @ 2003-05-12 10:15:00 by ross] mark Text.Read as non-portable, and make a bit more available in Hugs. f93d66f [project @ 2003-05-12 10:16:22 by ross] documentation only: tag some things as "GHC only". 996fa5f [project @ 2003-05-13 11:42:47 by simonpj] Generalise the type of listens slightly; a suggestion from Tom Pledger 7af82b0 [project @ 2003-05-14 09:11:43 by ross] hide Foreign.Concurrent from Hugs a67cd92 [project @ 2003-05-14 09:12:27 by ross] comments 8210474 [project @ 2003-05-14 17:31:47 by ross] doc tweaks b2d709a [project @ 2003-05-16 10:14:22 by simonmar] Now that we have auto packages, it makes sense to keep all the interfaces for hierarchical libraries in the same directory tree. So now, instead of putting interfaces for package P in $libdir/imports/P, we put them all in $libdir/imports. af8613c [project @ 2003-05-17 00:11:29 by ross] Rename per-package configuration files from $(PACKAGE).conf.* to package.conf.*, making them easier to find (since each package is in a separate directory anyway). b839129 [project @ 2003-05-19 16:48:18 by ross] non-GHC (and non-NHC): simplistic implementation of byte array I/O. cf6f87d [project @ 2003-05-20 09:44:08 by stolz] Add missing 'Constr' for conOf/consOf in examples 78cf79f [project @ 2003-05-21 16:31:59 by ross] add finalizerFree :: FunPtr (Ptr a -> IO ()) ef702f5 [project @ 2003-05-22 06:37:08 by chak] The FFI Addendum requires `Foreign' to re-export `Data.Bits'. 66d09d1 [project @ 2003-05-22 08:20:38 by ross] trim import fa38f9c [project @ 2003-05-22 08:21:49 by ross] add Eq instance (explicit, so Haddock won't be confused) 69c5373 [project @ 2003-05-22 08:24:32 by chak] Added a `FinalizerPtr' synonym as in the FFI Addendum (RC 10). f597503 [project @ 2003-05-22 09:40:04 by ross] export architecture-dependent types opaquely. 5d58c57 [project @ 2003-05-22 09:55:56 by simonmar] Commit an off-by-one fix that I forgot about. bef202f [project @ 2003-05-22 10:59:47 by ross] unbreak for Hugs 7bbc1da [project @ 2003-05-23 08:59:46 by simonmar] Remove the words "A cool hack..." from the documentation of this module, since they refer to the implementation, not the API :-) 4a7c3de [project @ 2003-05-23 10:12:28 by ross] hide GHC.PrimopWrappers from Haddock. a24461b [project @ 2003-05-23 10:13:33 by ross] fix header comment 1bf8174 [project @ 2003-05-23 10:21:27 by simonmar] Hide this module in the Haddock docs. 5561861 [project @ 2003-05-23 10:48:55 by ross] replace deriving Eq with explicit instance (twice) because Haddock's limited understanding of derived instances can't figure out these two. 3f88528 [project @ 2003-05-27 08:03:46 by stolz] GCC 3.3 cpp wibbles fdabd46 [project @ 2003-05-27 08:46:38 by malcolm] For nhc98, like hugs, re-export sum and product from the Prelude. e18c72b [project @ 2003-05-27 09:48:13 by ralf] Simplified type of gunfold (removed last arg.) And cosmetics. 9ab599d [project @ 2003-05-27 16:57:09 by malcolm] Unbreak for nhc98, after the addition of FinalizerPtr as a type synonym, and the change of Foreign.C.Types to export all newtypes abstract. 252a50d [project @ 2003-05-29 14:39:31 by sof] Support for interop'ing with .NET via FFI declarations along the lines of what Hugs98.NET offers, see 1f36871 [project @ 2003-05-29 17:37:17 by malcolm] For nhc98 only, export the basic C types non-abstractly. This is due to a deficiency in the way newtypes are handled in interface files - the compiler needs full information about the newtype in order to pass values across the FFI. 0a86d61 [project @ 2003-05-30 09:19:39 by simonpj] Stop omitting Data.Generics from Haddockising, now that suitable #ifdefs make it go through. 100b8c8 [project @ 2003-05-30 21:59:44 by ralf] Major clean-up; would have been nice in GHC 6.00 86d21b4 [project @ 2003-06-01 17:20:02 by ralf] Minor revision; extension. (customised gread/gshow for String; add a generic count to be used in the definition gtypecount, gnodecount; added a mkF to use const mzero as default and not as in the case of mkM; added a gmapF which is monadic but tries to recover from failure while stile insisting on at least one successful immediate subterm; cosmetics) b75c2ff [project @ 2003-06-02 14:32:14 by simonpj] Add (<++) 1d32e8c [project @ 2003-06-03 22:26:44 by diatchki] Added a first version of the new monad library (experimental). Hopefully one day the "X" will disappear. 4b4a82f [project @ 2003-06-04 14:52:09 by ralf] Made gread a bit more robust; some renaming of new stuff; add more comments to implementations; added a bit more illustration of gunfold; added or/choice operators 0ed1528 [project @ 2003-06-05 00:49:31 by diatchki] a huge commit. 47dbfb0 [project @ 2003-06-05 13:42:51 by ralf] Add listify; other minor revisions. d5f6e0d [project @ 2003-06-12 10:31:29 by malcolm] For nhc98, temporarily make foreignPtrToPtr an alias for unsafeForeignPtrToPtr until ghc and hugs catch up. 86380ee [project @ 2003-06-12 10:53:15 by simonmar] Update to latest revision of the FFI spec: 3a3ce8e [project @ 2003-06-12 10:55:57 by malcolm] For nhc98, define mallocForeignPtr and friends. 3e0b191 [project @ 2003-06-12 10:59:00 by malcolm] ... and add newForeignPtr_ for nhc98. 5220c9a [project @ 2003-06-12 12:55:27 by ross] move portable newForeignPtr from GHC.ForeignPtr to Foreign.ForeignPtr a997117 [project @ 2003-06-12 15:15:23 by simonmar] exitWith should be using throwIO not throw. b915bd0 [project @ 2003-06-12 16:06:06 by simonmar] Change the type of System.Cmd.rawSystem: 31a8fed [project @ 2003-06-16 08:02:09 by simonpj] Add Haddock docs, courtesy of Hal Daume 5ab0e8f [project @ 2003-06-18 08:06:00 by stolz] fork() never returns with EINTR 35e9537 [project @ 2003-06-19 09:32:04 by wolfgang] fix misleading typo in comment 7b825a4 [project @ 2003-06-19 10:38:15 by simonmar] Fix Windows build 074974b [project @ 2003-06-19 10:42:26 by simonmar] Add raiseIO# primop. 172fb88 [project @ 2003-06-19 12:55:09 by simonmar] Fix typo in doc string c566c0a [project @ 2003-06-19 13:04:49 by simonmar] Following near-silence on the libraries list, add 586cebc [project @ 2003-06-19 13:20:37 by simonmar] Fix reallocBytes: when size is zero, it is supposed to act like free. Which it did, except that we were complaining about the NULL return value from C's realloc and reporting it as an error. 8fc7c0a [project @ 2003-06-20 14:42:03 by ross] Hugs only: no hSetBinaryMode 305fb87 [project @ 2003-06-21 20:21:04 by malcolm] Exclude openBinaryFile etc from nhc98 build until we implement it. b233cd1 [project @ 2003-06-22 09:24:23 by ross] Hugs only: import throwIO 722b66b [project @ 2003-06-24 09:40:51 by stolz] Pick up openFileEx/openBinaryFile change in error message 48b38fa [project @ 2003-06-30 14:08:24 by stolz] Duplex Handles are writeable. 6994bc1 [project @ 2003-07-02 13:27:35 by stolz] fork() never returns with EINTR 7c521d9 [project @ 2003-07-03 15:22:04 by sof] [mingw only] asyncDoProc :: FunPtr (Ptr a -> IO ()) -> Ptr a -> IO () cfe0bae [project @ 2003-07-08 15:46:40 by panne] Fixed some Haddock links. f09bc1c [project @ 2003-07-08 16:04:54 by panne] Export TestResult, too 022b889 [project @ 2003-07-08 16:22:52 by panne] Fixed some more Haddock links. 75131ee [project @ 2003-07-10 19:25:58 by sof] For System.Directory.renameFile on Win32 platforms, implement the Haskell98 semantics of replacing the target file if it already exists (i.e., file/directory renaming is now done by dirUtils.c:__hscore_renameFile().) 897b35b [project @ 2003-07-16 10:46:29 by panne] Build Control.Monad before Data.HashTable, the latter depends on the former. Shouldn't the build system know about that automatically? 78662c8 [project @ 2003-07-16 10:55:20 by simonmar] - Make showHex and showOct match the report (don't add leading "Ox" or "Oo"). 1825139 [project @ 2003-07-16 17:46:52 by sof] [win32]asyncDoProc :: FunPtr (Ptr a -> IO Int) -> Ptr a -> IO Int cafacc0 [project @ 2003-07-21 09:26:23 by simonmar] Fix showIntAtBase to match the report. Its signature was previously 24a1332 [project @ 2003-07-21 13:21:02 by malcolm] > Build Control.Monad before Data.HashTable, the latter depends on the > former. Shouldn't the build system know about that automatically? 5b50727 [project @ 2003-07-21 16:50:20 by simonmar] GHC's instance Show Handle is wrong, because it is impure. This commit makes the Show instance pure by restricting what it shows to just the filename. 989ce50 [project @ 2003-07-22 09:55:05 by ross] jiggle to make System.Posix.Directory work for Hugs 8bd5462 [project @ 2003-07-22 12:55:50 by simonmar] Export hShow (GHC only for now). c064f2f [project @ 2003-07-22 14:38:02 by simonpj] Remove out-of-date apology about mkTyConApp; merge to stable c625c89 [project @ 2003-07-23 10:27:49 by wolfgang] Fix regular expressions for Mac OS X. e8f520f [project @ 2003-07-23 15:39:54 by simonmar] GHC/PrimopWrappers.hs fix for BootingFromHc 94ddad9 [project @ 2003-07-24 07:49:33 by simonpj] A gross hack to stop the pretty-printer going into an infinite loop. What happens is that 'indent' is given a negative number, and that made it loop. This patch checks for the negative case, so at least it doesn't loop -- but I don't understand why the indent ever goes negative, so there's still something wrong here. 0c3ad5b [project @ 2003-07-24 10:41:38 by simonpj] Add more comments b0d6404 [project @ 2003-07-24 12:05:42 by panne] GCC 3.3 is a bit picky about macros with a varying number of arguments, even when they are skipped. Strange... 88738f0 [project @ 2003-07-24 12:19:57 by ralf] Major refactoring of Data/Generics. This also affects the compiler (because of deriving issues). This is an intermediate commit. The library is supposed to compile fine. But the deriving stuff for Data needs to be revised. The testsuite for Data/Generics will not pass. gread is broken at the moment. So it is strongly recommended not to cvs upd for a few hours or a day. 02c4a38 [project @ 2003-07-24 13:53:20 by simonmar] Make pre-processing primops.txt from this directory work properly. 97630a1 [project @ 2003-07-24 14:20:23 by panne] Quick fix from Ross to get the Hugs builds working again. I'm not sure what the right fix is, e.g. is moving sameType to Data.Types enough? f08ff98 [project @ 2003-07-24 15:13:44 by ross] exclude Data.Generics.* from Hugs 0e0f869 [project @ 2003-07-24 15:28:06 by simonpj] Minor bugs in generics 10e9834 [project @ 2003-07-24 16:24:21 by ralf] Addressed Ross' concerns as follows: Included all of Data/Types.hs into Data/Typeable.hs. It really makes sense there anyway. 4a111aa [project @ 2003-07-25 10:03:51 by simonmar] regcomp: don't attach the regfree finalizer if c_regcomp failed. 4d056a8 [project @ 2003-07-25 14:36:38 by ralf] Data.Generics is up and running again! 0ee5e70 [project @ 2003-07-25 15:03:38 by simonpj] Wibbles to gread; Ralf to check d10c94c [project @ 2003-07-26 12:43:58 by ralf] Renamed Data/Generics/Strings to .../Text. Implemented generic read by using Text/ParserCombinators/ReadP. This is now how it really should look like. Did some more refactoring in the modules of Data/Generics. I consider the library relatively stable by now. Very experimental stuff is only in Data/Generics/Reify.hs 4ce37be [project @ 2003-07-28 12:11:46 by malcolm] Use new Data.Dynamic/Data.Typeable story in nhc98. e7a4f9e [project @ 2003-07-28 15:03:05 by panne] Markup fixes 9b454a7 [project @ 2003-07-29 12:03:13 by ross] trim imports e6b1378 [project @ 2003-07-29 12:36:52 by ross] exclude Data.Generics.* 6d7174b [project @ 2003-07-30 08:13:16 by ralf] Rolled back to newtype now that the compiler does not panic anymore for the module Data/Generics/Text.hs. 62ae5db [project @ 2003-07-31 09:28:47 by ralf] Cosmetic changes. Documentation of Data.Generics at http://www.cs.vu.nl/boilerplate/ is now also again well in line with the major revision of Data.Generics from last week. 593d4c8 [project @ 2003-07-31 10:48:50 by panne] Merge Foreign.C.TypesISO into Foreign.C.Types 4621466 [project @ 2003-07-31 17:45:22 by ross] move Parsec out of base into a package parsec (no code changes) a846994 [project @ 2003-08-01 09:59:04 by ross] tiny doc fix 4aa9bf5 [project @ 2003-08-01 10:00:48 by ross] Swapped argument order of `newForeignPtr' and `addForeignPtrFinalizer' to track FFI spec. (Maybe the Conc ones should do the same?) c8c0f59 [project @ 2003-08-01 15:56:11 by panne] Warning police 601e1a8 [project @ 2003-08-04 10:05:32 by ross] docs copied from the report 2cbd887 [project @ 2003-08-04 13:49:28 by panne] Fixed hyperlink for exitWith a66e620 [project @ 2003-08-04 14:41:55 by simonmar] Make a bunch of foreign imports "unsafe". f8581c1 [project @ 2003-08-04 14:47:37 by panne] Fixed hyperlink 7d58a6f [project @ 2003-08-04 17:30:53 by panne] Fixed hyperlink (at least for GHC docs :-) a8f1379 [project @ 2003-08-04 17:52:33 by panne] Synched comments with reality dcf4c0d [project @ 2003-08-04 18:07:49 by panne] Export ReadS from Text.ParserCombinators.ReadP, curing CPP trickery a bit 624f829 [project @ 2003-08-04 18:20:44 by panne] Ooops, forgot one link in the last commit... eddc275 [project @ 2003-08-04 18:40:47 by panne] Export HandlePosition 2526ab0 [project @ 2003-08-05 12:13:29 by panne] Moved QuickCheck into separate package 0d10d74 [project @ 2003-08-05 17:16:16 by ross] adjust exclusions for Hugs bdf2b17 [project @ 2003-08-05 17:24:40 by ross] add type signatures for Haddock's benefit 8c6764c [project @ 2003-08-05 17:25:30 by ross] fix some identifier links 9233f90 [project @ 2003-08-08 10:55:22 by malcolm] Adjust the default search path for building library packages with nhc98. 748af71 [project @ 2003-08-11 13:18:22 by ross] expose unsafeInterleaveIO to Hugs 73e2796 [project @ 2003-08-11 18:39:56 by ross] rename the cute presentations and use derived instances of Read and Show, as suggested by Tomasz Zielonka. d052d71 [project @ 2003-08-18 12:46:21 by panne] Revamped altzone detection. Note that we test only for successful compilation now, not for successful linking, but this is what most autoconf macros do. 49cf969 [project @ 2003-08-19 16:33:03 by simonmar] Fix incorrect Haddock syntax 70cce88 [project @ 2003-08-19 16:34:11 by simonmar] Fix reversed flag in mkRegexWithOpts fbf9b82 [project @ 2003-08-19 16:39:13 by simonmar] Use the wide-char classifications from the C library if available. This gives us Unicode-aware isLower, isUpper, isAlpha etc. 7c64b6c [project @ 2003-08-20 10:22:44 by simonmar] Use the wide-char classifications from the C library if available. This gives us Unicode-aware isLower, isUpper, isAlpha etc. 7c8d57b [project @ 2003-08-20 15:44:19 by panne] * Cleaned up FP_CHECK_ALIGNMENT test a bit. d054690 [project @ 2003-08-20 15:54:45 by panne] Nuked FPTOOLS_O_BINARY test and use FP_CHECK_CONST instead, which is shorter and better (e.g. cross compilation). 217cc5b [project @ 2003-08-22 08:58:30 by panne] Added a workaround for the Haddock problems introduced by the circular module dependencies regarding Unicode handling. cb45254 [project @ 2003-08-22 22:11:03 by sof] [GHC only]: Added missing 'config.h' #include ; needed by getProgName dae31cb [project @ 2003-08-22 23:44:40 by sof] pin better location info on IOErrors 3848b26 [project @ 2003-08-23 00:08:02 by sof] [win32]renameFile: Try bridging between GetLastError() error values and the errno-based error handling code in System.Directory. As was, errors ended up being reported as 'no errors'. 63c2b2f [project @ 2003-08-23 10:25:52 by ross] non-GHC only: hide functions defined in the Prelude f14d763 [project @ 2003-08-26 10:39:55 by ross] Document Data.Char from the H98 Report. 11d035d [project @ 2003-08-26 20:41:46 by ross] Hugs only: remove unused argument from toClockTimePrim ab2c656 [project @ 2003-08-27 08:41:07 by simonmar] Remove duplicate type signature d25661c [project @ 2003-08-27 11:03:44 by simonmar] isSpace should only recognise Latin-1 whitespace characters, according to the report. 59ad9e9 [project @ 2003-08-30 12:26:56 by ross] docs for System.IO.Error 0522e14 [project @ 2003-08-30 22:55:42 by ross] docs for System.Environment & System.Exit 785b037 [project @ 2003-08-30 23:01:48 by ross] minor haddock fixes e72a1e9 [project @ 2003-08-31 18:41:28 by ross] doc tweaks cb41e77 [project @ 2003-09-01 09:12:02 by ross] H98 docs for Data.List f0be11e [project @ 2003-09-02 15:31:02 by malcolm] For nhc98, take the corrected (thanks to Ross Paterson) version of fixIO from NHC.IOExtras. 03bef66 [project @ 2003-09-02 16:07:08 by ross] Deal with systems on which PATH_MAX is undefined, e.g. systems with unlimited path length, like the Hurd (also faulty installations of gcc on Solaris). In fact getCurrentDirectory only needs a long path size to use as a first approximation, so give it that. c4723c7 [project @ 2003-09-03 10:49:19 by simonmar] inputReady(): the time calculation for select() was wrong, forgetting to multiply the milliseconds value by 1000 to get microseconds. da79ff3 [project @ 2003-09-05 15:06:48 by ross] doc tweaks cd0aded [project @ 2003-09-05 17:36:40 by ross] minimal docs 82ea78e [project @ 2003-09-08 14:14:37 by simonmar] Doc wibbles 1a92b1b [project @ 2003-09-08 16:23:57 by ross] ST doc adjustments 012b14c [project @ 2003-09-10 11:46:58 by simonmar] The finalizer for a ForeignPtr created with mallocForeignPtr better "touch#" the MutableByteArray# after running the other finalizers, otherwise the memory might be garbage collected before we've finished running the finalizers. d223107 [project @ 2003-09-10 14:45:24 by simonmar] Quick hack to work around the dynamic exception crashes in GHCi. The problem is this: the Data.Typeable library (Data.Dymamic in previous versions of GHC) maintains an internal cache mapping type names to unique numbers, and this cache is used for fast comparisons on TypeReps. In GHCi, there are actually two versions of the Data.Typeable library loaded: one linked to GHCi itself, and the other dynamically loaded, so there are two copies of the hash tables. 5d16c9d [project @ 2003-09-12 12:29:43 by simonmar] Move setChildStopFlag and queryChildStopFlag to System.Posix.Signals. a6d8ea6 [project @ 2003-09-12 13:05:19 by simonmar] Implement pathconf()/fpathconf() wrappers. e62ca65 [project @ 2003-09-16 13:03:37 by simonmar] Legacy Removal ~~~~~~~~~~~~~~ aabd697 [project @ 2003-09-16 13:46:36 by simonmar] Don't strip the trailing slash from the filename '/'. 5aef5c6 [project @ 2003-09-21 22:20:57 by wolfgang] Bound Threads ============= f1e5fdd [project @ 2003-09-22 10:20:06 by wolfgang] fix some embarassing typos in the previous commit 5515cef [project @ 2003-09-22 11:11:54 by ross] cosmetic: move comments inside #ifdefs to avoid confusing people (like Hugs users) who look at the preprocessed output. 0e2b2bf [project @ 2003-09-22 13:27:19 by wolfgang] Really make the bound threads stuff compile this time (sorry). 8b0d04d [project @ 2003-09-23 10:09:17 by panne] Unbreak Show instance for Ptr caused by the changes to showHex d06f918 [project @ 2003-09-23 13:23:58 by simonmar] micro-optimisation 506eb20 [project @ 2003-09-23 13:26:30 by simonmar] - Add h{Get,Put}BufNonBlocking a02e72d [project @ 2003-09-23 16:13:59 by simonmar] Haddock fix. 354c8c0 [project @ 2003-09-23 16:18:03 by sof] [win32]: make it compile 140476b [project @ 2003-09-23 17:33:12 by sof] createPipe, createPipeEx: commented out exports (doesn't appear to be defined anywhere) de444f6 [project @ 2003-09-23 18:59:43 by sof] h{Get,Put}NonBlocking: win32 impl 82fbd98 [project @ 2003-09-24 10:32:12 by simonmar] If we change the terminal settings as a result of hSetBuffering or hSetEcho, then restore them again in hs_exit(). This is just good citizenship on Unixy platforms. 706c3d6 [project @ 2003-09-24 10:41:11 by simonmar] Add non-blocking versions of hGetBuf, hPutBuf. 65b1bac [project @ 2003-09-24 11:06:54 by simonmar] Move forkOS_createThread into the RTS so its implementation can be dependent on RTS_SUPPORTS_THREADS, which means we can provide a stub implementation in the !RTS_SUPPORTS_THREADS case, and hence not depend on pthread_create, which requires -lpthread. The upshot is that GHCi now works again when !RTS_SUPPORTS_THREADS. d25f4b7 [project @ 2003-09-24 11:36:24 by simonmar] Add some realToFrac rules for CFloat,CDouble and CLDouble, so that eg. realToFrac :: CDouble -> Double turns into a no-op. cb04045 [project @ 2003-09-24 13:26:08 by malcolm] Missing dependency. 0f9f2a0 [project @ 2003-09-24 14:01:18 by simonmar] Add foldFM_GE, fmToList_GE, keysFM_GE, eltsFM_GE. (contributed by Tomasz Zielonka via George Russell). 37335cc [project @ 2003-09-25 14:44:36 by sof] [win32]getCPUTime: comments + reduce fromIntegral use. No change in functionality. 01bb943 [project @ 2003-09-25 15:14:44 by panne] To fix dynamic linking issues with Hugs, access saved_termios via getter/setter. 08ef45e [project @ 2003-09-26 09:26:13 by panne] Saving/restoring termios is only done for GHC a6ae0a4 [project @ 2003-10-01 10:57:44 by wolfgang] New implementation & changed type signature of forkProcess fb390bd [project @ 2003-10-01 11:00:20 by wolfgang] Add runInUnboundThread to the export list 922351c [project @ 2003-10-06 13:14:36 by simonpj] MERGE TO STABLE bc90621 [project @ 2003-10-07 16:56:33 by sof] peekCString{Len}: tweak GHC impls (why are these provided anyway?) - Do as for Foreign.Marshal.Array.peekArray and read in length-bounded string back-to-front. - force evaluation of CChar->Char conversions. 3f6e3e9 [project @ 2003-10-09 13:59:33 by stolz] FreeBSD 4.X has an emtpy wctype.h, so test one of the affected functions in Unicode.hsc if it's really there. dfe9aca [project @ 2003-10-09 14:01:46 by stolz] Fix flipped arguments to sigprocmask in getSignalMask. b124662 [project @ 2003-10-13 03:19:48 by sof] make it useable with msvc + gcc-mingw 1562165 [project @ 2003-10-13 03:21:20 by sof] cope if regex.h isn't supported by target 1d94a68 [project @ 2003-10-13 05:09:40 by sof] prev commit too strict wrt mingw 871d9d9 [project @ 2003-10-13 05:20:37 by sof] extra_libraries: win32 CPP tweak d082af5 [project @ 2003-10-13 05:21:37 by sof] more mind-numbing CPP tweaking 98ca2df [project @ 2003-10-13 05:22:59 by sof] support CFoo iff HTYPE_FOO_T is defined 123b517 [project @ 2003-10-13 05:23:53 by sof] mingw tweaks + add cbits/consUtils.c to CBITS 9f1f843 [project @ 2003-10-16 00:18:34 by ross] add withArgs and withProgName to Hugs. 84f7e2f [project @ 2003-10-16 16:26:43 by ross] fix a couple of id references in haddock docs ef02902 [project @ 2003-10-17 16:48:43 by ross] Hugs only: add most of the rest of System.Posix e3abc99 [project @ 2003-10-20 12:31:00 by ross] add System.Posix.Signals to Hugs 7219399 [project @ 2003-10-20 13:16:58 by simonmar] Comment use of $(HavePosixRegex) 427485c [project @ 2003-10-20 15:56:52 by simonmar] Convert Unicode.hsc to a plain .hs file to fix bootstrapping problems. 2f1b654 [project @ 2003-10-20 20:00:25 by panne] Again: Fixed previous commit. Our QA department must really be on an extended vacation... :-] 41e6e6f [project @ 2003-10-21 13:24:31 by simonmar] Make the GHC implementation of peekCString run in constant stack-space by checking the length of the array first and then working backwards from the end. Interestingly, this version is faster than the original. e2b681a [project @ 2003-10-21 13:27:13 by simonmar] Make peekArray0 run in constant stack-space by testing the length of the array first, then calling peekArray (which works backwards from the end so it can be tail-recursive). ece4fc6 [project @ 2003-10-21 13:31:44 by simonmar] - Add _LE duals of the _GE functions - Add minFM and maxFM 05292e1 [project @ 2003-10-21 13:57:39 by simonmar] Fix bug in hGetBufNonBlocking that meant it would sometimes block. 381defa [project @ 2003-10-21 14:00:20 by simonmar] oops, revert parts of previous commit that weren't supposed to be included. c6a32b7 [project @ 2003-10-21 14:32:43 by sof] appease the GHC bigwigs 9d6a771 [project @ 2003-10-27 09:56:11 by ross] unswap UNBLOCK/SETMASK (merge to STABLE) b3911da [project @ 2003-10-27 12:09:44 by stolz] Avoid setting O_NONBLOCK when already set. e75b200 [project @ 2003-10-30 18:51:26 by sof] drop uses of __MINGW32__, no longer needed 4838ceb [project @ 2003-11-02 00:06:23 by panne] Added an extremely ugly workaround for the broken sigfillset macro on OpenBSD, which misses a cast. Is there a better way? 65b7479 [project @ 2003-11-02 16:30:16 by panne] * Added workaround for broken sigemptyset * Use #if, not #ifdef for feature tests * Nuked CVS keyword e0aa14e [project @ 2003-11-02 17:52:09 by ralf] Minor extension to enable rebuild of Strafunski. 93cbc6e [project @ 2003-11-04 21:59:23 by ross] Hugs only: add finalizers with environments, as per the latest FFI draft. 1c3d0af [project @ 2003-11-05 09:58:01 by simonmar] Fix a memory leak in __hscore_readdir() which meant that one struct dirent was leaked at the end of each directory read. c469c2c [project @ 2003-11-05 10:43:10 by simonmar] Better documentation for unsafeThaw, unsafeFreeze. cfa3827 [project @ 2003-11-05 15:05:12 by ross] doc updates for mallocForeignPtr and friends d93c042 [project @ 2003-11-06 12:50:22 by ross] import Prelude if haddocking bf6cd58 [project @ 2003-11-06 17:34:00 by simonmar] Doc wibbles 1cdfc00 [project @ 2003-11-10 15:32:43 by simonmar] Change the documentation title from "Haskell Core Libraries" to "Haskell Hierarchical Libraries". 1f7f519 [project @ 2003-11-10 15:54:55 by sof] brought into the hier-lib world; stripped away outdated code & comments c121d9e [project @ 2003-11-10 15:55:13 by sof] ALL_DIRS: added Control/Parallel 530afa3 [project @ 2003-11-11 11:50:52 by simonmar] Convert to use Haddock 0.6's combined contents/index functionality for the hierarchical library docs. 1422071 [project @ 2003-11-13 14:43:58 by ross] Hugs-only tweak 2657bd7 [project @ 2003-11-13 19:23:12 by panne] Markup fix 135ae7e [project @ 2003-11-15 22:31:16 by panne] Decouple packages a bit more again: The prologue of the combined index is now generated via shell magic from the package prologues. As a nice side effect, some autoconf magic is gone, so configure.ac is effectively empty now (but not for long... :-) eb4afe3 [project @ 2003-11-21 16:24:44 by sof] code tidyup d8b08f3 [project @ 2003-11-23 12:23:49 by ralf] Added some trivial observers for type representations. 51e8c92 [project @ 2003-11-23 12:25:02 by ralf] Refactored some alias for generic builders and readers. Worked out some interested stuff for reification of type structures. 60d0e4a [project @ 2003-11-23 22:19:35 by ralf] Added the missing Data instance for Either. 6721ead [project @ 2003-11-26 09:55:22 by simonmar] Declare some libraries to be "stable". 9129371 [project @ 2003-11-26 10:00:09 by simonmar] oops, revert accidental commit fb0fe86 [project @ 2003-11-28 11:08:54 by simonmar] Doc wibble ed3a760 [project @ 2003-12-04 18:25:51 by panne] Synched #ifdefs, but only 90% sure if I got it right... fa71932 [project @ 2003-12-06 17:48:49 by ralf] Added Data instances for triples and quadruples. f85e43a [project @ 2003-12-12 18:29:26 by sof] showIntAtBase: - implementation uses quotRem [where the remainder isn't always non-negative -- ditto for divMod, so there's no trivial fix], negative bases aren't supported; catch this. - separate argument validity checking from actual digitisation. e37f296 [project @ 2003-12-15 17:59:05 by panne] Fixed #ifdefs for Cygwin e8c6784 [project @ 2003-12-16 16:54:12 by simonmar] Add Show instance for FiniteMap ba05fd2 [project @ 2003-12-16 16:54:42 by simonmar] Add Show instance for Set d93ccac [project @ 2003-12-17 17:13:47 by sof] merge rev 1.48.2.4 ab2349b [project @ 2003-12-17 17:15:12 by sof] merge rev. 1.13.2.1 123af63 [project @ 2003-12-22 10:56:42 by simonmar] performGC should really do a major GC - this was broken at some point. f8c15cf [project @ 2003-12-22 12:23:35 by simonmar] - Fix hGetBuf & hGetBufNonBlocking. There were various bugs in these two functions, so I did a complete rewrite (again). They are quite hard to get right it seems, so I've put together a test case (shortly to be added to the test suite). c71586a [project @ 2003-12-22 12:41:52 by simonmar] add fillReadBufferWithoutBlocking (required for fixed hGetBufNonBlocking implementation in IO.hs rev. 1.20) 3e2fc9a [project @ 2003-12-23 12:35:34 by simonmar] Fix yet another bug in hGetBuf/hGetBufNonBlocking 546370a [project @ 2003-12-23 13:58:17 by simonmar] - Fix up mingw build after changes to hGetBuf etc. I don't think that hGetBufNonBlocking works correctly on Windows, because there doesn't seem to be a non-blocking read primitive. I haven't tested it, however. 43683aa [project @ 2003-12-29 17:16:42 by panne] Updated my email address b7d62ed [project @ 2004-01-02 19:03:14 by panne] Annual copyright update a5c83b2 [project @ 2004-01-05 10:07:25 by ross] doc tweak ab631b3 [project @ 2004-01-05 10:07:52 by ross] doc tidy-ups a585b70 [project @ 2004-01-05 16:03:34 by simonmar] Add runSTArray and runSTUArray, as suggested by John Meacham. runSTUArray showed up an interesting deficiency in the type system (see comments for details). 44f2077 [project @ 2004-01-05 16:47:09 by ross] Change the drawing of trees so that long labels work better. The new drawings are narrower but a little longer than before. e010c70 [project @ 2004-01-05 17:44:30 by ross] Make runST(U)Array work with Hugs. This includes explicitly using unsafeFreezeSTArray rather than unsafeFreeze, to avoid relying on rules. de519dc [project @ 2004-01-06 10:31:05 by ross] new Queue type, using Chris Okasaki's cute 3-list implementation. fb577d2 [project @ 2004-01-06 12:40:00 by simonmar] Fix, and simplify, the getting/setting of errno in Foreign.C.Error. 2a7b95f [project @ 2004-01-06 14:01:52 by ross] fix for Hugs d0241bc [project @ 2004-01-07 12:43:50 by simonmar] Mention that threadDelay rounds its argument down to a multiple of 0.02s. 575f0f2 [project @ 2004-01-08 15:27:29 by simonmar] update threadDelay docs: delay is rounded up. 6fb1d48 [project @ 2004-01-10 12:53:42 by panne] Haddock fixes e3ffd04 [project @ 2004-01-14 11:16:10 by malcolm] Unbreak for nhc98 after recent errno changes. f23b2ec [project @ 2004-01-14 14:19:41 by ross] (Hugs only) add hIsTerminalDevice, hGetEcho and hSetEcho. aa8a901 [project @ 2004-01-14 14:58:57 by ralf] Added gdepth to determine depth of a term. edcb5e4 [project @ 2004-01-15 14:43:24 by igloo] Split Template Haskell out to its own package and update docs and tests. 08f5dc7 [project @ 2004-01-20 13:57:25 by ross] use fields in Node 9889459 [project @ 2004-01-21 17:28:47 by simonmar] __hscore_set_errno() should return void, not int. a6cb0ec [project @ 2004-01-23 13:35:16 by ross] add a Functor instance for FiniteMap 35adccc [project @ 2004-01-26 11:24:54 by simonmar] - fix bug(s) in emptySampleVar - add isEmptySampleVar, with similar caveats on its use as isEmptyMVar ebe4fa4 [project @ 2004-01-27 09:52:37 by ross] generalize the type of minusFM 3d08503 [project @ 2004-01-28 10:04:25 by simonpj] --------------------------------------- Fix the WinME/98/95 double-backslash bug --------------------------------------- 26a0d9e [project @ 2004-02-02 11:54:32 by ross] add some unfolds (pure, monadic depth-first and monadic breadth-first) 2d9095f [project @ 2004-02-04 10:51:18 by malcolm] Exclude functions 'unfoldTreeM' and 'unfoldForestM' in nhc98. For some unknown reason they result in a type inference error: "No default for Prelude.Monad" b1f75e3 [project @ 2004-02-04 10:52:28 by malcolm] Plumb in Data.Queue for nhc98. 71bad3c [project @ 2004-02-04 17:00:00 by malcolm] Excluding 'unfoldTreeM' and 'unfoldForestM' is overkill for nhc98. A simpler workaround for the type inference bug is just to omit one type signature from the mutually recursive pair. edac88b [project @ 2004-02-04 17:13:53 by ross] plug a warning 55b084e [project @ 2004-02-05 11:45:59 by ross] Hugs only: use the configure-set variable INLINE_ONLY instead of `extern inline' (which works for gcc but not C99 compilers). 5e1b65f [project @ 2004-02-05 11:58:21 by malcolm] Fix definition of 'partition' to match the (non-)strictness mandated by the Haskell'98 Libraries Report version. a107e3d [project @ 2004-02-05 16:46:32 by igloo] Typo (Frue instead of False for falseName) found during discussion with Duncan. dfe7719 [project @ 2004-02-05 18:55:47 by ross] moved the monad transformer libraries into a separate mtl package. de871d5 [project @ 2004-02-11 14:01:06 by simonmar] Put double quotes around the -#include flag, so that command-lines can be cut-n-pasted. 6c4bbb5 [project @ 2004-02-12 14:54:19 by simonpj] Document non-std behaviour of array 87e3aab [project @ 2004-02-12 14:55:05 by simonpj] Explicit for-alls for Monad (so desugaring knows which order to give type args) 4daa9de [project @ 2004-02-12 14:55:31 by simonpj] Documentation for floatToDigits dd30d01 [project @ 2004-02-12 14:55:55 by simonpj] Comments f2c753f [project @ 2004-02-12 21:23:48 by krasimir] Added interface to set/get handler for uncatched exceptions. The handler is invoked from the GHC.TopHandler.topHandler or Control.Concurrent.childHandler when an exception is catched. 015ffda [project @ 2004-02-12 22:35:25 by krasimir] The UncatchedExceptionHandler is defined only for GHC a8be691 [project @ 2004-02-13 12:13:00 by simonmar] uncatched -> uncaught 8dc1e1a [project @ 2004-02-13 15:17:38 by ross] array doc updates 252660f [project @ 2004-02-13 17:46:32 by ross] make import Foreign.C.String GHC-only to unbreak Hugs build 7e9db43 [project @ 2004-02-14 18:18:46 by ralf] Refactored the approach to Twin Traversal. Added some illustrative treatment of polymorphic lists. aa52e1c [project @ 2004-02-15 13:04:47 by krasimir] Added support for tracers b03b6c5 [project @ 2004-02-15 13:24:42 by ralf] Another commit of boilerplate refactoring related to twin traversal and type introspection. Clean-up. After some reflection the list processing module was not regarded suitable for the library (see List.hs removed). 8b90cd0 [project @ 2004-02-16 11:08:58 by ross] adjust imports for portability 08df762 [project @ 2004-02-17 11:16:36 by malcolm] Exclude "config.h" inclusion for nhc98 as well as Hugs. 84d748e [project @ 2004-02-17 11:21:04 by simonmar] Remove unused argument from commitBuffer e4fa830 [project @ 2004-02-17 11:22:22 by simonmar] Use C wrappers for lseek() and open(). On Linux, these functions are macro'd to different versions when large file support is on, so to make the libraries compilable with the NCG we need to use C wrappers for these functions. 00734d0 [project @ 2004-02-17 11:59:16 by simonmar] Also need to wrap fstat(). 1782c4a [project @ 2004-02-18 15:07:03 by simonmar] stat() needs to be wrapped too 1afa490 [project @ 2004-02-19 10:42:50 by stolz] Preserve group/other bits in setPermissions. bb53111 [project @ 2004-02-20 10:55:09 by stolz] wibble (replace helper function with fromEnum) faf38bc [project @ 2004-02-20 17:46:38 by panne] Hugs has hSetBinaryMode, hPutBuf, and hGetBuf now. 74ddd4c [project @ 2004-02-24 12:39:12 by simonmar] New version of translate for mingw32, which correctly (allegedly) reverses the command-line translation done by the standard C runtime on Windows. e439a05 [project @ 2004-02-24 19:49:58 by ralf] Proliferation of unsafeCoerce in Data.Typeable stopped. (There is now just one cast0 which generalises on all previous forms: cast, castss, castarr.) Started classes Typeable1/2 for unary/binary type constructors. Added instances for lists, products, sums, functions, maybies. 20120b6 [project @ 2004-02-24 19:51:11 by ralf] Twin traversal is now based on accumulating maps. Added polymorphic type extension for type constructors. 9dbea19 [project @ 2004-02-25 19:21:20 by krasimir] Added finalizeForeignPtr function 5b4e35c [project @ 2004-02-25 20:10:18 by ralf] Thanks to Sven Panne. The module should be back to Haskell 98 or at least should not break hugs anymore. cafe1fc [project @ 2004-02-25 21:20:04 by ralf] Follow-up fix triggered by yesterday's major scrap your boilerplate commit. 519ca93 [project @ 2004-02-26 18:06:51 by ralf] Simplified kind-polymorphic boilerplate stuff. 6cab28c [project @ 2004-02-26 18:34:14 by ross] instances for Ordering and tuples (up to 5) a18a6fb [project @ 2004-02-27 10:27:41 by simonmar] Update the comments in here after changes in rev. 1.17. 89a8f1b [project @ 2004-02-27 14:48:16 by malcolm] To make it compile with nhc98, #ifdef out the Typeable[12] instances. d6f122d [project @ 2004-02-28 15:35:28 by ralf] Code that uses deriving (... Data ...) will require an updated *compiler* to be in line with these new boilerplate modules. d13284e [project @ 2004-03-01 14:47:30 by simonmar] small improvements from Ian Lynagh c54909e [project @ 2004-03-01 17:25:46 by malcolm] nhc98: ensure the Either type is identical with Prelude.Either. 53297f9 [project @ 2004-03-02 22:23:59 by ralf] Once more revised the Data class. You will need to cvs upd the compiler as well. 54b9d86 [project @ 2004-03-03 11:47:42 by ross] withObject -> with 960c6ae [project @ 2004-03-03 19:25:41 by malcolm] #ifdefs for nhc98. ce6a3ec [project @ 2004-03-04 17:48:27 by igloo] Add missing punctuate definition from Duncan Coutts. 040d7a9 [project @ 2004-03-05 18:00:35 by malcolm] Plumb System.Time and System.CPUTime into nhc98 libraries build. 537197d [project @ 2004-03-08 10:22:09 by malcolm] nhc98 (built by ghc/solaris) needs more stack to make System.Time. 5f93cd4 [project @ 2004-03-16 10:04:17 by ross] comment typo f1c55a9 [project @ 2004-03-16 13:46:07 by ralf] Some more refactoring and renaming to be aligned with the boilerplate II paper. Removed the weird module Generics.Reify, the code of which still lives in testsuite (see example reify.hs). One will also need to cvs upd the compiler which again changed slightly with regard to deriving Data. 16ac5f5 [project @ 2004-03-16 15:19:36 by ralf] I thought that I removed that one. 35eb22e [project @ 2004-03-17 23:22:51 by ralf] Installed genneric instances for Typeable1, ..., Typeable7. Updated Data/Generics/Instances.hs accordingly. 08bb853 [project @ 2004-03-19 10:45:42 by simonmar] Bugfix for insert (from the missing-prime class of bugs) f8e2916 [project @ 2004-03-19 11:00:02 by simonmar] - fix one performance bug: we weren't updating the bucket count when expanding the hash table, so too many expansions were happening. ca93edc [project @ 2004-03-19 20:31:50 by panne] HACK: Unbreak the Hugs build again, Typeable left the realm of Haskell98 one more time. I slowly doubt if this module belongs to the "base" package at all... If it stays there, things should better be tested with Hugs and nh98 before committing, the latter build probably breaks, too. 327619b [project @ 2004-03-20 02:37:18 by ross] clean up the TypeableN stuff a bit: GHC uses overlapping instances; everyone else uses explicit instances using provided defaults. Macros paper over the difference. c20a754 [project @ 2004-03-20 12:42:27 by ross] Comments (and deleted some of the blank lines Ralf is so fond of). 8ac0150 [project @ 2004-03-20 13:31:06 by ross] revert a couple of tcnames for greater consistency (fixes dynamic001). bb1bb04 [project @ 2004-03-20 18:26:40 by ross] change instances of Typeable to macros e367013 [project @ 2004-03-21 19:07:00 by ralf] Implemented renaming for Data.Typeable according to http://www.haskell.org//pipermail/libraries/2004-March/001846.html 0dd193b [project @ 2004-03-22 14:48:56 by malcolm] For nhc98, at last include the Typeable macros which define the instance decls. 58a05f6 [project @ 2004-03-24 16:59:51 by simonmar] Add caveat about finalizers (don't refer to Handles from finalizers). 4941f98 [project @ 2004-03-27 13:18:12 by panne] * Merged Martin Sj-A?gren's patch for multiline descriptions-b * Nuked some TABs in favour of space + some small reformatting * Updated copyright edde716 [project @ 2004-03-27 14:15:24 by panne] This package is named "base", not "core". d12525b [project @ 2004-03-30 07:05:46 by panne] Added withArrayLen and withArrayLen0 d69bb11 [project @ 2004-03-30 15:31:35 by ralf] We decided that we want the gunfold primitive back. This avoids some hassle with bottoms and strict datatypes. The compiler now also derives gunfold. 24646d8 [project @ 2004-03-30 17:02:59 by ross] track Data/Generics/* twists 7a1aff6 [project @ 2004-03-30 17:54:28 by ross] fix a warning 8b9443c [project @ 2004-04-02 02:39:29 by igloo] Add support for foreign imports inside quasi-quotes. Gave TH a few more uniques to play with and fixed a typo. 6cbff23 [project @ 2004-04-05 08:21:39 by simonpj] Use consistent capitalisation 6fc5861 [project @ 2004-04-06 08:54:02 by panne] Tiny fix in Haddock markup c6761cd [project @ 2004-04-06 12:03:05 by simonpj] * Add 'dyn' as an export of TH 73bf385 [project @ 2004-04-14 09:01:18 by simonmar] indent: don't use tab characters 5c92527 [project @ 2004-04-20 09:18:46 by simonmar] Fix a file descriptor leak in openFile: if openFd fails, then we weren't closing the newly created descriptor. a5b43a2 [project @ 2004-04-20 15:49:58 by simonmar] - comments on INLINability of unsafePerformIO 63fecf0 [project @ 2004-04-20 15:52:18 by simonmar] New version of fixIO which does eager blackholing. 58eb623 [project @ 2004-04-23 18:13:07 by ross] Hugs: use the same version of fixIO as GHC 311dd3b [project @ 2004-05-06 08:44:52 by simonmar] Move the definition of rawSystem into a separate file which we #include in the places it is needed. This is slightly better than copying the code, since we now need it in three places (ghc/utils/runghc is the 3rd). ef5fe77 [project @ 2004-05-06 12:27:47 by wolfgang] Make the documentation and the error messages match the way the threaded RTS is used nowadays (the -threaded flag to ghc rather than ./configure --enable-threaded-rts) a4d8708 [project @ 2004-05-09 01:36:32 by dons] When .hc bootstrapping, don't build the Concurrent_stubs 07cfdb5 [project @ 2004-05-10 09:22:59 by malcolm] RawSystem inclusion belongs inside the __GLASGOW_HASKELL__ ifdef. e4e04b3 [project @ 2004-05-19 07:46:20 by simonpj] Print constructor arg types in parens 5c0be5d [project @ 2004-05-25 09:11:57 by simonpj] Remove spaces around the "%" when showing ratios. 98c0e98 [project @ 2004-05-25 09:12:29 by simonpj] Fix comment 9eef5c0 [project @ 2004-05-25 09:27:16 by simonmar] Small performance hack in maxBound::Word. 15532cb [project @ 2004-05-27 11:32:03 by simonpj] Inline the default method for newArray; big perf boost; comments with the pragma b2df702 [project @ 2004-06-01 23:22:32 by igloo] Add missing functions to TH export list (mostly spotted by Duncan Coutts). 08a11a7 [project @ 2004-06-02 08:23:46 by simonpj] ------------------------------- Fix a grevious bug in DsMeta which caused a seg fault ------------------------------- 40078de [project @ 2004-06-02 12:35:11 by simonmar] The lock arrays are too small on Windows, leading to buffer overruns and crashes when a program opens too many files. c8e1c7f [project @ 2004-06-02 16:00:02 by simonmar] Add __hscore_PrelHandle_{send,recv} 5d55d8f [project @ 2004-06-02 16:07:17 by simonmar] - Win32: when using the threaded RTS, bypass the Async IO stuff and just make blocking calls to read()/write(). 72c2269 [project @ 2004-06-02 16:09:58 by simonmar] __hscore_PrelHandle_{send,recv}: make these mingw32-only 06b8d04e [project @ 2004-06-02 16:17:20 by simonmar] Add a comment about fdGetMode, which doesn't work properly on Windows 2f6c4a3 [project @ 2004-06-12 12:13:12 by panne] timezone fix by Antony Courtney 463eed2 [project @ 2004-06-13 17:16:40 by panne] The FFI report does not mention that CClock and CTime have instances for Bounded, Real, Integral, and Bits. c4ed8d8 [project @ 2004-06-13 20:26:03 by panne] Added missing dependencies of Haskell files to header files they include 67a040b [project @ 2004-06-13 21:03:46 by panne] Changes related to arithmetic types: c0cc013 [project @ 2004-06-14 13:28:52 by malcolm] Solaris/nhc98 fixes: HAVE_TZNAME rather than HAVE_TM_ZONE, and need a "time.h" specification on every foreign import. d0e3c12 [project @ 2004-06-15 10:20:05 by malcolm] Add missing instances of Data.Bits.Bits for nhc98. 509e791 [project @ 2004-06-15 10:29:12 by malcolm] Note dependency of Foreign.C on Foreign.C.* e52eabe [project @ 2004-06-15 21:07:23 by panne] Yet another fix for the fact that CTime is not an instance of Integral anymore, f75fa29 [project @ 2004-06-16 09:50:25 by malcolm] Typo. fc865a7 [project @ 2004-06-22 12:45:55 by ross] Change the interface (but not the implementation) to match the FFI spec: 870d29d [project @ 2004-06-23 09:47:47 by simonmar] Add documentation from the FFI spec. 845cb18 [project @ 2004-06-25 10:42:48 by ross] more Ptr/FunPtr documentation 26197c8 [project @ 2004-06-29 19:10:47 by panne] Centralized compiler differences for requesting additional heap/stack in a single place. Only tested for bootstrapping via hbc, and this needs 170M heap for Language/Haskell/Parser.hs. There seems to be a "small" space leak here... :-] c647a31 [project @ 2004-07-01 13:25:09 by malcolm] Revert from common heap/stack options to per-package options. Since hbc's runtime requirements are on occasion so much larger ghc/nhc98, break out EXTRA_HBC_FLAGS as a separate variable. b4c1b8e [project @ 2004-07-01 14:49:11 by malcolm] Heap-profiling build bootstrapped with nhc98 requires more heap. 618f167 [project @ 2004-07-01 18:05:00 by panne] Increase heap size and stack size when building via hbc c4919d4 [project @ 2004-07-11 09:20:07 by panne] Use "flat" names for the type constructors of Ptr/StablePtr/IORef. This might be debatable, but at least it is consistent with the rest of the types. 94e9096 [project @ 2004-07-19 11:29:39 by simonpj] Template Haskell improvements 8d20bc3 [project @ 2004-07-23 11:34:31 by ross] docs only 07ed441 [project @ 2004-07-23 13:24:04 by ross] docs only 803fb54 [project @ 2004-07-23 15:26:06 by ross] tweak comment 02a07c4 [project @ 2004-07-23 15:31:59 by ross] To make Text.Regex.Posix work with Hugs, move cbits/regex/regex.h under include, where Hugs can find it. 74f1415 [project @ 2004-07-26 13:26:41 by ross] docs only 43cbf96 [project @ 2004-07-26 17:22:41 by ross] a few odd docs 0caf196 [project @ 2004-07-27 10:35:54 by ross] haddock fodder 7684c3d [project @ 2004-07-28 10:32:11 by ross] haddock food 0d080ea [project @ 2004-07-30 06:16:00 by krasimir] add copyFile function 117f7f3 [project @ 2004-07-30 20:33:54 by krasimir] add copyFile to the export list c289c80 [project @ 2004-07-30 22:17:44 by krasimir] fix 143c726 [project @ 2004-07-30 23:29:41 by ross] copyFile is GHC-only at the moment ded9c50 [project @ 2004-08-03 19:36:41 by panne] Fixed spelling of "http-equiv" attribute c61e042 [project @ 2004-08-09 10:04:33 by simonmar] quotes: use an appostrophe at both ends rather than a grave accent at the front and an apostrophe at the end. 3b49acc [project @ 2004-08-09 12:00:34 by simonmar] whitespace changes to the header only, for new compatibility with new Haddock 0037574 [project @ 2004-08-10 11:35:24 by simonpj] Add a Haddock note about dynamic linking c03df89 [project @ 2004-08-13 08:50:32 by simonmar] work around stricter CPP in GCC 3.4.1 8c7d098 [project @ 2004-08-13 10:54:15 by simonmar] Update copyright date d029634 [project @ 2004-08-13 10:55:06 by simonmar] Add a Todo 69eb297 [project @ 2004-08-13 13:29:00 by simonmar] Changes required be merge of backend-hacking-branch. Mostly config.h ==> ghcconfig.h. 5d8d941 [project @ 2004-08-13 13:29:11 by simonmar] Changes required be merge of backend-hacking-branch. Mostly config.h ==> ghcconfig.h. 8ed5e5b [project @ 2004-08-16 09:31:15 by simonmar] #ifdefery to work around change in name of config.h 4cf1f19 [project @ 2004-08-16 11:07:31 by simonmar] More ugly hacks related to the config.h change. I'm beginning to think maybe this wasn't such a great idea. c9e42a8 [project @ 2004-08-16 11:08:47 by simonmar] wibble 33a5b0b [project @ 2004-08-17 16:48:09 by krasimir] Add getHomeDirectory and getAppUserDataDirectory functions 5343b0b [project @ 2004-08-18 09:23:19 by malcolm] Add versions of getHomeDirectory and getAppUserDataDirectory for nhc98. (Note: implementation still missing for Hugs.) 4ed190b [project @ 2004-08-18 09:34:02 by simonmar] Add Haddock comments for getHomeDirectory/getAppUserDataDirectory b1825fc [project @ 2004-08-18 17:48:44 by krasimir] add getUserDocumentsDirectory function 4fd3f0b [project @ 2004-08-19 08:23:01 by simonmar] Add a new Haddock section "Pre-defined directories" 08ff349 [project @ 2004-08-19 10:54:34 by malcolm] Missing import for nhc98. f98834d [project @ 2004-08-20 08:45:52 by simonpj] Better handling of overflow conditions for Enum Int. 72a29d8 [project @ 2004-08-21 10:56:59 by panne] Haddock fix 92a4127 [project @ 2004-08-23 11:53:08 by simonmar] Fix deadlock problem when the difference list for \\ refers recursively to the array. 511830f [project @ 2004-08-25 16:20:13 by sof] Be resistant to missing CSIDL_* defines 4ff2edf [project @ 2004-08-25 18:35:29 by sof] extrs_libraries{mingw32}: replace 'shell32' with 'shfolder'; standard, and more version-proof ccf0ddb [project @ 2004-08-25 18:42:47 by sof] __hscore_d_name(), __hscore_end_of_dir(): de-platformify and use feature #defines instead. 5a77cb7 [project @ 2004-08-31 09:07:26 by ross] make the new directory queries available to all implementations, though the mingw versions only work for GHC. aca3bd8 [project @ 2004-09-01 09:47:31 by simonmar] Win32 rawSystem: set errno to EINVAL on error. This is a gross hack, but is slightly better than the existing situation (errno not set at all, caller tries to report errno and draws a blank). c120549 [project @ 2004-09-01 15:57:13 by ross] devolve the recently added dirent checks to a new libraries/base/configure.ac aebf6b5 [project @ 2004-09-02 05:57:41 by dons] Trying to closedir the wrong pointer in "readdir sets errno" test. This caused test to dump core, leading to 'bogus' value of test result, which breaks the build. 585004a [project @ 2004-09-06 09:07:45 by ross] Text.Regex.Posix is portable (because it includes an implementation) 8283965 [project @ 2004-09-06 17:20:02 by ross] add some RULES d47eab1 [project @ 2004-09-07 15:35:41 by stolz] Add cpp-protected signals sigINFO & sigWINCH if available. (An autoconf-wizard might want to look at the bottom of configure.ac, the similarities between HAVE_SIGPOLL, HAVE_SIGINFO & HAVE_SIGWINCH can surely be factored out) e1f293d [project @ 2004-09-08 11:10:08 by ross] typos in comments 2de5944 [project @ 2004-09-08 15:13:20 by ross] remove unneeded #includes of ghcconfig.h a05881c [project @ 2004-09-10 08:29:14 by stolz] Fix build on Solaris: CTime is no longer an instance of Integral, so do the realToInteger-dance. 8138525 [project @ 2004-09-10 20:38:53 by ross] docs 095ff7a [project @ 2004-09-10 22:43:20 by ross] doc tweaks c9a7587 [project @ 2004-09-15 13:51:00 by stolz] - Remove configure tests for SIG{POLL,INFO,WINCH}: Testing via #ifdef SIGFOO should be sufficient. - Change #if HAVE_SIGPOLL to #ifdef SIGPOLL - Remove SIGINFO/WINCH from package base: they'll reappear in package unix in System/Posix/Signals.Exts. 9ff25c7 [project @ 2004-09-18 12:49:59 by panne] Make autoupdate 2.52 happy, mainly by using the new formats of AC_INIT and AC_OUTPUT. This has the nice side effect that all "packages" have now a name, a version, a bug-report address, and a tar name, yielding better output with "configure --help=recursive". Nuked an unused AC_STRUCT_ST_BLKSIZE test on the way. a8ab7a3 [project @ 2004-09-20 16:35:12 by sof] openFile: have Haddock comments mention openBinaryFile 0b31efa [project @ 2004-09-22 08:37:01 by panne] * Replace obsolete macro AC_TRY_RUN with AC_RUN_IFELSE * Same for AC_TRY_LINK and AC_LINK_IFELSE * Minor cleanup 3cf8ba9 [project @ 2004-09-27 09:04:15 by ross] update documentation of memory allocation c346bd4 [project @ 2004-09-28 09:02:13 by simonmar] - Move foldl1 to Data.List - Provide a strict version of foldl1, namely foldl1' - Move minimum, maximum to Data.List - Provide specialised versions of minimum & maximum for Int, which use foldl1' e0ed007 [project @ 2004-09-28 11:29:29 by simonmar] - export foldl1' - specialise minimum/maximum for Integer too 7ba52e7 [project @ 2004-09-28 12:38:55 by simonmar] Add update, and improve documentation of insert. 7b11673 [project @ 2004-09-28 23:34:26 by ross] unbreak for non-GHC implementations ee2d0b9 [project @ 2004-09-29 10:29:13 by ross] haddock markup c590df4 [project @ 2004-09-29 15:46:53 by simonmar] Move this to the Attic 7d8c46b [project @ 2004-09-29 15:50:51 by simonmar] Process reorganisation: the System.Process library moves into base, and System.Cmd is re-implemented in terms of it. 56e8e42 [project @ 2004-09-29 22:48:06 by krasimir] compile execvpe only under Unix. The mingw's process.h header also contains definition for execvpe which conflicts with our definition. 42522f7 [project @ 2004-09-29 22:49:36 by krasimir] Change file extension. We don't need hsc2hs here. 9fee399 [project @ 2004-09-30 08:54:00 by simonmar] Update the signature of execvpe() to match the one in HsBase. 79d7b55 [project @ 2004-09-30 09:42:17 by simonmar] Haddock fixes 87cd92d [project @ 2004-09-30 10:01:46 by malcolm] Add a type signature to help nhc98 out. 1169da6 [project @ 2004-10-02 07:14:38 by dons] Undef PACKAGE_NAME PACKAGE_STRING PACKAGE_BUGREPORT PACKAGE_TARNAME coming in from ghcconfig.h, so that we can use HsBaseConfig.h versions without screenfulls of cpp warnings. f5768c7 [project @ 2004-10-02 07:34:38 by dons] Bind raiseSignal to genericRaise, on OpenBSD only, atm. 0c3fe86 [project @ 2004-10-05 07:43:07 by mthomas] Nonexistent file stopped entire install for libraries. bba137b [project @ 2004-10-05 12:51:33 by simonmar] inputReady foreign import should be "safe. a708d56 [project @ 2004-10-05 15:56:17 by simonmar] If we try to use a finalized handle, then throw a useful exception. Before, the thread would just block forever on the MVar or get a BlockedOnDeadMVar exception. 51fb2f8 [project @ 2004-10-06 10:13:07 by ross] make the evil PACKAGE_* hacks consistent a3f5ade [project @ 2004-10-06 11:11:34 by ross] Add getEnvironment from hslibs/lang/SystemExts. This differs from the System.Posix.Env version in not failing if an entry lacks an '=' sign. e144dab [project @ 2004-10-06 15:02:41 by malcolm] Dummy implementations of openBinaryFile and hSetBinaryMode for nhc98. b30fe6b [project @ 2004-10-06 23:45:37 by dons] Fix order of PACKAGE_* #undefs. They must appear before HsBaseConfig.h 898d6ce [project @ 2004-10-07 09:42:28 by malcolm] Oops, fix impdecl/fundecl ordering. 91e09c5 [project @ 2004-10-07 13:13:22 by stolz] Bring declaration of runProcess back in line with prototype: pid_t (ProcHandle) isn't compatible with int on SunOS. 5556c65 [project @ 2004-10-08 10:28:37 by simonmar] - make sure we don't overflow the table - use a checked array index just in case we *do* try to overflow - fix a harmless off-by-one 58056a8 [project @ 2004-10-08 12:04:48 by ross] revert previous change, so now these includes don't define PACKAGE_* 763b37c [project @ 2004-10-08 12:07:02 by ross] Hugs can't handle System.Process yet 8721065 [project @ 2004-10-08 21:21:08 by malcolm] Fix layout to Haskell'98. 791c906 [project @ 2004-10-09 07:51:06 by panne] Unbreak Hugs by moving pPrPr_disableITimers and execvpe to System.Posix.Internals (base package) and use it from System.Posix.Process (unix package). 246a7e6 [project @ 2004-10-11 10:54:57 by simonmar] genericRaise() hack needed on FreeBSD too. 038160e [project @ 2004-10-12 17:45:44 by ross] unused line e4069c6 [project @ 2004-10-13 10:24:16 by simonpj] c_execvpe & pPrPr_disableITimers: remove these in a Windows build. 386b65b [project @ 2004-10-14 14:58:50 by simonmar] Threaded RTS improvements: 1dd73bc [project @ 2004-10-17 00:08:08 by ross] markup ee9344e [project @ 2004-10-17 00:09:58 by ross] move some GHC-specific implementations into GHC.* 0ab9041 [project @ 2004-10-17 00:22:03 by ross] tighten imports 45140ff [project @ 2004-10-25 13:40:08 by simonmar] Doc update: notes on finalization of Handles 83bfac0 [project @ 2004-10-25 13:47:34 by simonmar] hDuplicate, hDuplicateTo: add finalizers 157f045 [project @ 2004-10-27 15:47:23 by ross] adjustments to doc comments 5857b7e [project @ 2004-11-03 01:10:59 by igloo] Implement TH ForallC constructor. 8c8be0a [project @ 2004-11-06 10:45:46 by panne] Push down the tests for errno values to the base package. There's really no need testing for this when e.g. building Happy. :-) c8098e6 [project @ 2004-11-06 11:10:18 by panne] Moved test for C/ISO types to base package, hopefully testing for all needed headers first. ba2b38a [project @ 2004-11-06 13:01:18 by panne] * Changed some '#include "ghcconfig.h"' to '#include "HsBaseConfig.h"' (or added the latter), tracking the recent autoconf-related changes. d3e0473 [project @ 2004-11-06 14:15:06 by panne] * Re-enable large file support * No need to test for lchown here 5c89384 [project @ 2004-11-06 16:34:25 by panne] 'd->d_name' (where d is of type 'struct dirent*') should always return a pointer to the directory entry's name, regardless if dirent is defined as 04b8c08 [project @ 2004-11-06 17:03:43 by panne] * Issue a warning when compilation/execution fails during FP_READDIR_EOF_ERRNO and assume a value of '0'. 00ab5a6 [project @ 2004-11-07 10:17:22 by ross] move CONST_O_BINARY detection down to libraries/base 1336b22 [project @ 2004-11-09 15:48:34 by simonmar] Adding Cabal to GHC, stage 1: 8224acf [project @ 2004-11-09 17:02:23 by simonmar] Make this compile with GHC < 6.3 351b987 [project @ 2004-11-10 11:27:54 by simonmar] Move the compatibility code for rawSystem from libraries/base into ghc/lib/compat. c04f2e1 [project @ 2004-11-11 17:17:30 by simonmar] remove unnecessary #ifdef 13fd5b4 [project @ 2004-11-11 17:48:49 by simonpj] Fix version skew 657eb83 [project @ 2004-11-12 12:34:52 by stolz] Push FreeBSD-unicode-detection into package 731ff7e [project @ 2004-11-12 15:14:17 by simonmar] Note Haskell 98 divergence in isAlpha. bcc5c31 [project @ 2004-11-12 17:07:54 by simonpj] Missing #include following per-package config changes 0d71238 [project @ 2004-11-13 08:21:32 by krasimir] Added the proposed System.FilePath. I also added to System.Directory the canonicalizePath and findExecutable functions. 0ede3d9 [project @ 2004-11-13 14:37:18 by panne] Get rid of those ugly WinDoze CR/LF 69695ec [project @ 2004-11-14 10:47:26 by malcolm] Allow new additions to build with nhc98 too. (I suspect more work is still needed to make them portable to Hugs as well.) c310125 [project @ 2004-11-14 10:48:23 by malcolm] Plumb in new addition System.FilePath. 605f8cb [project @ 2004-11-14 12:32:48 by ross] tweak imports for portability 128d075 [project @ 2004-11-14 20:25:54 by panne] Tiny refactoring, mostly used as a reminder that '#if blah_platform' tests are evil and should be replaced by feature-based test (autoconf!) and concentrated in few modules. System.FilePath is another great example for this, all #ifs should be replaced by a function handling a possible drive letter + a few separator constants. 3e32dec [project @ 2004-11-16 18:02:07 by ross] spelling in error message 92e474d [project @ 2004-11-16 23:36:36 by ross] drop with a negative length should yield the whole list, not [] f3f979a [project @ 2004-11-17 19:07:38 by sof] Expose Win32 console event handling to the user. 0b78351 [project @ 2004-11-18 00:56:24 by igloo] Implement FunDeps for TH. 86b86ee [project @ 2004-11-18 09:56:58 by tharris] Support for atomic memory transactions and associated regression tests conc041-048 16dfca6 [project @ 2004-11-18 16:39:54 by stolz] Push down more feature-tests 6cd05c9 [project @ 2004-11-19 12:54:12 by ross] make instance Enum () conform to the Report (though I doubt anyone will notice) 4f5cc6e [project @ 2004-11-22 10:16:42 by simonmar] Fix example code cb578df [project @ 2004-11-22 10:26:46 by simonmar] More fixes to the sample code (thanks to Satnam Singh for pointing out a problem). 31bcacc [project @ 2004-11-22 14:03:15 by simonmar] Plug a race condition in the IO manager 00fdbd9 [project @ 2004-11-25 15:01:24 by simonmar] Add explicit 'import Prelude' to fix dependencies (necessary for make -j) e8ac1c8 [project @ 2004-11-26 11:58:18 by simonmar] More 'import Prelude's to help make -j. 33af5e4 [project @ 2004-11-26 15:03:22 by ross] fix tycon name strings dc4805e [project @ 2004-11-26 16:00:06 by simonmar] more make -j fixing 3377074 [project @ 2004-11-26 16:22:09 by simonmar] Further integration with the new package story. GHC now supports pretty much everything in the package proposal. 3e3bb28 [project @ 2004-11-26 16:22:12 by simonmar] Further integration with the new package story. GHC now supports pretty much everything in the package proposal. 1665a23 [project @ 2004-11-30 10:04:31 by simonpj] Use C comment not Haskell comment in package.conf 604bd11 [project @ 2004-12-01 17:45:28 by ross] markup db861fd [project @ 2004-12-01 17:46:14 by ross] tweaks for portability 74d0298 [project @ 2004-12-02 14:52:30 by ross] add Henrik Nilsson's combinators for composing with pure functions 1be134c [project @ 2004-12-02 15:57:02 by ross] Hugs only: replace the CBITS pragma (files relative to cbits) with CFILES (files relative to the root of the package). ffe5660 [project @ 2004-12-03 12:19:51 by simonpj] Add nameModule; and PrimTyConI 961ba6f [project @ 2004-12-03 14:08:07 by ross] added a simple-minded implementation of rawSystem for non-GHC implementations. Also re-instated the doc comment that rawSystem lost in its travels. 937f8c0 [project @ 2004-12-08 11:05:31 by simonmar] - Update docs on finalizers: we don't guarantee to run finalizers at all, and you can't express finalizer ordering using touchForeignPtr. 0af150a [project @ 2004-12-09 09:45:39 by simonmar] Add subRegex & splitRegex 523390b [project @ 2004-12-09 17:25:15 by simonmar] Haddock only: import Data.Array.IArray, to avoid linking to hidden Data.Array.Base. c8292d2 [project @ 2004-12-14 12:37:28 by simonmar] Add Lennart's Printf module, extended by me to include hPrintf. 4cf1e85 [project @ 2004-12-14 12:44:52 by simonmar] Add instance Typeable MVar d62f2ba [project @ 2004-12-14 12:52:03 by simonmar] Some more Typeable instances, as requested on the ghc-users list a while back. c5d9bbb [project @ 2004-12-14 13:31:44 by malcolm] For nhc98, get entities from H'98 libraries, rather than redefine them here. 317468c [project @ 2004-12-14 13:32:38 by malcolm] Plumb in the new Text/Printf module. f6507c8 [project @ 2004-12-14 13:55:22 by simonmar] Add Text.Printf 9b65ef9 [project @ 2004-12-15 12:29:08 by simonpj] Pretty print PrimTyConI a95091a [project @ 2004-12-17 15:12:13 by simonmar] Add GHC.ConsoleHandler ba4fdad [project @ 2004-12-18 00:43:03 by ross] avoid a warning by defining getDrive only on Windows 057067e [project @ 2004-12-18 00:45:27 by ross] Add system-dependent filename extensions: exeExtension ("" or ".exe") objExtension (".o" or ".obj") dllExtension (".so" or ".dll") 14d7589 [project @ 2004-12-18 15:38:08 by panne] * Fixed Haddock comment. Please: Before committing, everybody should test with "make html" if the documentation is syntactically OK. It is quite frustrating to find a broken RPM build after several hours and 99% of the work done... >:-( 2132742 [project @ 2004-12-21 09:58:13 by simonpj] Comments only c257f43 [project @ 2004-12-21 12:12:40 by simonpj] Add GHC.Prim to base package modules 5f0ba68 [project @ 2004-12-21 14:00:12 by simonpj] Add an instance for Typeable RealWorld; and move the Typeable ST instance to Data.Typeable 554bbc1 [project @ 2004-12-21 16:42:06 by ross] Hugs only: move the Typeable instance for ST back to Control.Monad.ST. e6dc22c [project @ 2004-12-21 17:09:02 by simonpj] --------------------------------- Template Haskell: dynamically scoped qualified names --------------------------------- 097b243 [project @ 2004-12-23 00:02:41 by ralf] Resolved stage1 issues related SPJ's commit "Add more scoped type variables". Incidentally, this provides some input for the recent GHC list discussion on whether to provide lex. scope for function signatures. Not too many modules are affected! Good! 0043ea0 [project @ 2004-12-23 09:07:38 by simonpj] --------------------------------- Template Haskell: names again --------------------------------- 76672c6 [project @ 2004-12-24 12:12:28 by krasimir] minor performance update for withCAStringLen and newCAStringLen functions. We don't need to calculate the string length twice. d7445b6 [project @ 2004-12-24 12:20:18 by krasimir] revert the previous commit it was wrong b952ffb [project @ 2005-01-01 23:36:20 by krasimir] add getTemporaryDirectory to the collection of pre-defined directories. 04fd9bc [project @ 2005-01-01 23:59:58 by krasimir] According to the documentation, the Haskell implementation of Handle should implement single writer/multiple readers locking but the current implementation doesn't work under Windows. This commit fixes this using '_sopen' function instead of 'open'. The former allows to implement system level locking on Windows. The changes doesn't affect other platforms. 2bbab79 [project @ 2005-01-04 20:15:04 by krasimir] fix haddock comment f61189b [project @ 2005-01-05 21:30:05 by krasimir] Added implementation for hSetFileSize. The configure script checks for _chsize (usially Windows) and ftruncate (Linux) C functions and the package uses one of them to implement hSetFileSize. 72b83e6 [project @ 2005-01-06 16:35:04 by simonmar] Remove the leading '.' from exeExtension, objExtension and dllExtension. This is for consistency with joinFileExt, which does not expect to see a '.' in the extension. 8391324 [project @ 2005-01-06 16:37:36 by simonmar] Apply the previous change to the docs, too. b4fd512 [project @ 2005-01-06 18:14:40 by ross] extensions no longer include dots 36f7903 [project @ 2005-01-06 19:10:14 by krasimir] Reduce dependencies for GHC. This allows System.FilePath to be used in some low-level modules. 7446b65 [project @ 2005-01-06 19:35:05 by krasimir] add temporary files API 2f90d84 [project @ 2005-01-07 11:37:02 by simonmar] Add unsafeIOToSTM d55aeb8 [project @ 2005-01-07 12:22:18 by simonmar] oops, reinstate an import 3aa11fb [project @ 2005-01-07 13:31:07 by krasimir] fix for readFile001 d475b16 [project @ 2005-01-07 22:24:55 by krasimir] truncate the file only in WriteMode 9263e95 [project @ 2005-01-10 00:03:04 by krasimir] Add dropAbsolutePrefix function. (used in Cabal) 23e6371 [project @ 2005-01-10 23:25:04 by krasimir] move createIfNotExists and removeFileRecursive functions from Distribution.Simple.Utils to System.Directory. The functions are renamed to createDirectoryIfMissing and removeDirectoryRecursive. 7862413 [project @ 2005-01-11 12:12:36 by ross] haddock fix cf5744f [project @ 2005-01-11 12:14:00 by ross] tweak docs of name clashes ae91b1d [project @ 2005-01-11 13:20:22 by ross] doc fixes 5b9a3f1 [project @ 2005-01-11 13:29:34 by malcolm] Use ghc implementation of createDirectoryIfMissing and removeDirectoryRecursive for nhc98 and Hugs too. d23613d [project @ 2005-01-11 13:44:39 by malcolm] Hack around the non-portable ReadP library to allow nhc98 to use Data.Version. 8d142ee [project @ 2005-01-11 14:18:13 by ross] get IOError stuff from System.IO.Error instead of System.IO b5efe2a [project @ 2005-01-11 14:36:51 by ross] System.IO no longer re-exports System.IO.Error 0def01b [project @ 2005-01-11 14:49:07 by ross] untangle #if's a2302f6 [project @ 2005-01-11 16:04:08 by simonmar] Use OPTIONS_GHC instead of OPTIONS 3523844 [project @ 2005-01-11 16:04:32 by simonmar] Use OPTIONS_GHC instead of OPTIONS a4dd33a [project @ 2005-01-11 21:26:42 by krasimir] Use "o" extension everywere. Added haddock comment about the possible usage of "obj" for Hugs. 0498c99 [project @ 2005-01-13 10:23:07 by simonmar] import Prelude explicitly 8f500d7 [project @ 2005-01-13 10:37:35 by simonmar] Add Data.Map, Data.Set, Data.IntMap and Data.IntSet from Daan Leijen's DData library, with some modifications by JP Bernardy and others on the libraries at haskell.org list. Minor changes by me to remove the last references to DData, and add a DEPRECATED copy of the old Data.Set interface to the new Data.Set. 5e11a6a [project @ 2005-01-13 10:46:36 by ross] make comments ASCII 2d5d0a8 [project @ 2005-01-13 11:14:09 by ross] Hugs only: replace UserError with ResourceExhausted e5722b1 [project @ 2005-01-13 11:15:17 by ross] use ioError instead of the GHC-specific ioException 3d1901f [project @ 2005-01-13 12:09:55 by ross] kludge for cpp's that don't like \ at end of line b3a6694 [project @ 2005-01-13 12:26:50 by ross] another cpp hack (that infix declaration occurs 3 times!) 1ae033e [project @ 2005-01-13 13:31:09 by ross] adjust module header comments (the bit about imports still sounds wierd) ac8e3f2 [project @ 2005-01-14 00:00:22 by ross] make these work with Hugs (pending the possible return of Word) and simplify the #if's a bit. dfa72b3 [project @ 2005-01-14 12:06:51 by ross] Hugs: use Word like everyone else cc1301c [project @ 2005-01-14 12:18:00 by ross] Hugs: include instances for Word df1f5bb [project @ 2005-01-14 14:30:42 by malcolm] Minor tweaks to build with nhc98. d590170 [project @ 2005-01-14 14:31:58 by malcolm] Hook up the new Text.Map, Text.IntSet, and Text.IntMap modules, and the existing Text.Regex stuff. 7311bf6 [project @ 2005-01-14 17:01:02 by ross] non-GHC: import Word type be5f3d7 [project @ 2005-01-16 11:50:45 by panne] Improved DEPRECATED pragmas a bit 4edfa30 [project @ 2005-01-16 12:52:21 by ross] added runKleisli as suggested by David Menendez 7ae3093 [project @ 2005-01-17 11:08:52 by simonmar] Add Data.FunctorM ab986ec [project @ 2005-01-17 11:23:25 by ross] doc tweaks b6fdb43 [project @ 2005-01-17 13:23:43 by simonmar] Add Typeable instances for the new DData libraries 33197cc [project @ 2005-01-18 11:23:35 by ross] generalize the types of intersectionWith and intersectionWithKey 94fee9e [project @ 2005-01-18 15:08:39 by simonmar] Win32: attempt to make inputReady() work on pipes too. Fixes bug #995658. 7ec0d5b [project @ 2005-01-19 17:20:31 by ross] document the deprecated functions, and redirect mkSet to fromList 153e477 [project @ 2005-01-19 22:33:32 by ralf] Added quite a few more Data instances. 2580de4 [project @ 2005-01-19 23:32:04 by ross] fix name in Typeable instance eeb2216 [project @ 2005-01-19 23:33:25 by ross] Move comments inside #if's they refer to -- makes the cpp output, e.g. as seen by Hugs users, more sensible. 36622b8 [project @ 2005-01-20 10:36:43 by malcolm] Include Typeable instance for nhc98. 5728000 [project @ 2005-01-20 11:09:54 by malcolm] Hook up Data.FunctorM, and update dependencies from Data.Set, Data.IntMap, Data.Map etc, on Data.Typeable. d29794e [project @ 2005-01-20 14:22:26 by simonmar] Fill in the haddock-interfaces and haddock-html fields in the package.conf files. ddac311 [project @ 2005-01-20 14:39:09 by malcolm] Lots more new dependencies. 89eb503 [project @ 2005-01-20 19:00:26 by ross] cross-references and minor doc fixes a6c1afd [project @ 2005-01-21 09:55:52 by malcolm] Typo c9249be [project @ 2005-01-21 10:52:47 by ross] refine docs a bit 9d16745 [project @ 2005-01-21 11:44:08 by ross] alter the interface of splitLookup and splitMember, placing the match between the trees of smaller and larger elements in the returned triple. 565cbfe [project @ 2005-01-21 12:37:05 by simonmar] Update the haddock fields 2420bf2 [project @ 2005-01-21 15:12:21 by simonmar] hClose on stdin,stdout,stderr now actually closes the file descriptor. Before, there was no way to actually close these file descriptors, which might be necessary in some cases - especially when stdin/stdout are pipes and you need to indicate to the other end of the pipe that you've finished I/O, but without exiting the program. 47f3a57 [project @ 2005-01-21 16:02:47 by simonmar] Don't try to run finalizers at program exit. This turned out to be hard if not impossible to do in general, so now we don't attempt it at all. 732861d [project @ 2005-01-21 19:59:01 by sof] win32 only: Tidy up delivery and handling of console events by having the low-level console event handler signal the RTS thread blocked waiting for I/O. 865ce29 [project @ 2005-01-21 21:52:56 by panne] *sigh* Once again: Fixed a Haddock comment which broke "make html"... Why on earth do we have "make validate"?? :?-( I think we should introduce some kind of disciplinary punishment for checking in broken Haddock comments, like porting the mangler to a new platform or porting Adjustor.c to an ABI more irregular than the one on PowerPC... 73dc4c0 [project @ 2005-01-22 12:18:49 by panne] Doc change only: I don't think that toList should give the guarantee that the resulting list is in ascending order... 11ffbdf [project @ 2005-01-23 11:30:39 by panne] * Nuked one #ifdef in isPathSeparator, the generated code is the same * Added a ToDo for searchPathSeparator 23e414d [project @ 2005-01-23 13:12:52 by panne] Unify the base and Cabal versions of GetOpt a bit. 96d9fa6 [project @ 2005-01-23 13:48:19 by panne] Added Isaac's getOpt variant (named getOpt' now), so System.Console.GetOpt and Distribution.GetOpt are identical now. df028ab [project @ 2005-01-23 20:20:55 by wolfgang] Flush stdout and stderr also when exiting due to an ExitException. 44a3357 [project @ 2005-01-24 04:26:17 by wolfgang] Always flush stdout & stderr at exit, even when terminating abnormally due to an exception. d0497c6 [project @ 2005-01-25 17:06:39 by ross] add Cabal package descriptions 0aa48bd [project @ 2005-01-25 22:17:37 by krasimir] Fixed bug with splitFileExt "foo.bar." and splitFileName "foo:bar" e11ddba [project @ 2005-01-26 12:23:33 by simonmar] I think InvalidArgument is more useful than OtherError for EBADF. 3b4e02c [project @ 2005-01-26 13:27:44 by malcolm] Change stability notation from 'stable' to 'experimental', since many people seem to agree there are plenty of bugs here. 06fa805 [project @ 2005-01-26 14:33:29 by malcolm] Fix module name. 4608e3e [project @ 2005-01-26 14:36:42 by malcolm] Patch from John Meacham: Generalise a couple functions in Data.Map to be usable in an arbitrary monad (rather than being restricted to Maybe). 3cfdf74 [project @ 2005-01-26 14:55:41 by simonmar] Remove System.FilePath pending a redesign of the interface. Temporarily introduce System.Directory.Internals as a home for some of the bits of System.FilePath we were already using elsewhere. be80e49 [project @ 2005-01-26 15:19:19 by malcolm] Remove System.FilePath. 85bdaa2 [project @ 2005-01-26 15:40:37 by simonmar] remove System.FilePath; add System.Directory.Internals. a65cba7 [project @ 2005-01-26 15:41:01 by simonmar] Add System.Directory to $(ALL_DIRS) e27d450 [project @ 2005-01-27 10:45:47 by simonpj] -------------------------------------------- Replace hi-boot files with hs-boot files -------------------------------------------- 030644d [project @ 2005-01-27 10:46:19 by malcolm] Hook up System.Directory.Internals. fa67e70 [project @ 2005-01-27 14:19:50 by simonpj] Fix regex.h include stuff; Ross and Malcolm might want to look at the new comment c721dd8 [project @ 2005-01-27 14:38:05 by ross] doc tweaks 3a682aa [project @ 2005-01-28 10:15:44 by ross] fix foreign imports for non-GHC 2940ff3 [project @ 2005-01-28 13:36:25 by simonmar] Catch up with updates to platform #defines. a0808a9 [project @ 2005-01-28 13:54:56 by simonmar] System.Info now exports: 8013474 [project @ 2005-01-28 14:55:05 by simonmar] Remove unnecessary ghcconfig.h include f8249e4 [project @ 2005-01-28 15:03:06 by simonmar] Remove some unnecessary #includes of ghcconfig.h 3bfe0cc [project @ 2005-01-28 16:09:06 by malcolm] Add compilerVersion for nhc98. 5762f04 [project @ 2005-01-28 23:33:57 by krasimir] - The output from uncaught exceptions handler is redirected to RTS's errorBelch. - The output from Debug.Trace is redirected to RTS's debugBelch - Usually errorBelch and debugBelch messages go to stderr except for Windows GUI applications. For GUI applications the Debug.Trace output is redirected to debug console and the exceptions message is displayed in message box. dbc3cfe [project @ 2005-01-29 16:10:27 by wolfgang] import CString on non-windows platforms. 353ec34 [project @ 2005-01-31 12:57:26 by simonmar] Cleanup: convert System/Posix/Signals.hsc into a plain .hs file, and use the configure script to get the appropriate constants. 9f60683 [project @ 2005-01-31 13:45:50 by malcolm] Work around type-system bug (cxt in lhs pattern) in nhc98. dd2035f [project @ 2005-01-31 13:46:24 by simonmar] oops, remove debugging modification 40793bd [project @ 2005-01-31 13:51:22 by simonmar] Some improvements to System.Cmd.{system,rawSystem} on Un*x systems: these commands now do the appropriate signal handling, namely ignoring SIGINT/SIGQUIT in the parent but allowing these signals in the child. This behaviour matches the Un*x system(). c8d9c29 [project @ 2005-01-31 13:52:26 by malcolm] Make it compile for non-GHC. e5c232e [project @ 2005-01-31 15:48:21 by simonpj] --------------------------- Some Template Haskell fixes --------------------------- 7a2b4ed [project @ 2005-01-31 18:33:48 by ross] fix for non-GHC 0b45108 [project @ 2005-01-31 19:28:42 by panne] * Unbreak System.Info for Hugs, rearranging the whole module a bit. e5ccf95 [project @ 2005-01-31 19:54:22 by panne] Ooops, my evil XEmacs inserted an extraneous character... :-} a24f30e [project @ 2005-01-31 21:07:15 by panne] Documentation fix only ("in" is a keyword) a69fb32 [project @ 2005-02-01 00:52:20 by ross] more regex test down to libraries/base 0178a82 [project @ 2005-02-01 10:12:16 by krasimir] Fixes for Windows 4a660ce [project @ 2005-02-01 11:52:08 by malcolm] Record more dependencies. d00ccc5 [project @ 2005-02-01 13:02:37 by simonmar] Make hDuplicateTo actually use dup2() rather than dup(). The difference is noticeable if you want to eg. redirect stdout and then use executeFile or spawn sub-processes. 19097c4 [project @ 2005-02-01 13:41:41 by simonmar] Move #include of HsBaseConfig.h up 183400b [project @ 2005-02-01 16:47:27 by malcolm] Make the cpp directives in NHC.SizedTypes directly usable by nhc98 with internal cpphs, avoiding ANSI-only string-pasting. 48a0f00 [project @ 2005-02-01 17:32:19 by ross] docs 11e6a2f [project @ 2005-02-02 10:59:16 by malcolm] Build all package sources using hmake. The inaccurate and ever-changing Makefile dependencies can now all be thrown away, hurrah! 771e82b [project @ 2005-02-02 13:26:13 by simonpj] I've moved Typeable instances so that they are either in the module that defines the type or in the Typeable module (which defines the class) fc8e94f [project @ 2005-02-02 13:45:05 by malcolm] nhc98 has Data.Typeable. 4539e4a [project @ 2005-02-02 13:47:24 by simonpj] Generalise gfindtype to c3b4dd3 [project @ 2005-02-02 14:54:18 by ross] an instance for FunPtr, and minor Hugs fixes: dab859f [project @ 2005-02-02 15:20:11 by simonmar] tiny doc fix 7c6b74a [project @ 2005-02-02 15:21:02 by simonmar] doc fixes b83c9d3 [project @ 2005-02-02 15:22:19 by simonmar] Doc fixes 0eccfe4 [project @ 2005-02-02 15:22:54 by simonmar] Doc fix a257592 [project @ 2005-02-02 15:23:59 by simonmar] doc fixes de37eee [project @ 2005-02-02 15:28:49 by simonmar] doc fix c0c54c7 [project @ 2005-02-03 10:32:11 by ross] hide GHC internals from Haddock 8471d81 [project @ 2005-02-03 10:38:44 by simonmar] unhide a few modules 066eef3 [project @ 2005-02-04 14:20:57 by ross] if this can't be hidden, at least make it not-home 557cf09 [project @ 2005-02-04 14:36:52 by simonmar] Add a comment to Ross's previous commit (sorry, forgot to commit my version of that change earlier). 7470bd3 [project @ 2005-02-05 00:41:35 by ross] more Haddock fixes. c9aef57 [project @ 2005-02-07 09:56:42 by ross] a few docs (for STABLE) ac1f0f6 [project @ 2005-02-07 10:26:55 by simonpj] Documentation of flush behaviour of runIO 9333e0e [project @ 2005-02-07 12:21:29 by simonmar] After no response on libraries at haskell.org... John Meacham's Data.Graph patch, which returns an extra component from graphFromEdges. The old version of graphFromEdges is available as graphFromEdges'. b36d1d2 [project @ 2005-02-07 15:26:10 by malcolm] Place imports before #includes, just to reduce the number of 'file not found' warnings from hmake. da1b8a2 [project @ 2005-02-11 01:55:56 by ross] track syntax changes: 6e9b375 [project @ 2005-02-11 11:36:23 by simonmar] Add bracketOnError d0844e7 [project @ 2005-02-13 10:53:13 by malcolm] Eliminate more explicit dependencies in Makefiles: use hmake to create the bootstrapping .hc files, as well as the ordinary .o files. 03b44bc [project @ 2005-02-15 08:09:43 by ross] Hugs only: use binary handles for copyFile 018c1c2 [project @ 2005-02-15 21:06:31 by panne] For the 100th time: Fixed Haddock comment syntax. >:-( Perhaps we should really introduce a commit hook which verifies that "make html" works... 105f0e0 [project @ 2005-02-18 15:06:45 by simonmar] Rename fields in InstalledPackageInfo for consistency with PackageDescription & buildInfo: a914eed [project @ 2005-02-18 15:06:47 by simonmar] Rename fields in InstalledPackageInfo for consistency with PackageDescription & buildInfo: a65fe8b [project @ 2005-02-18 18:30:40 by ross] Rename package description fields as in InstalledPackageInfo: f2e87f7 [project @ 2005-02-21 11:36:07 by simonmar] docs only: clarify language in a couple of places. 3351d4b [project @ 2005-02-23 06:31:22 by dons] Typo in comment only. Spotted by sjanssen on #haskell. ab8e4ad [project @ 2005-02-24 09:58:23 by simonmar] nDoc fixes from Sven Panne. Generally fixing of Haddock links, adding some signatures, and in some cases exporting type constructors that are mentioned in the types of exported identifiers. e5bc0f2 [project @ 2005-02-24 09:58:26 by simonmar] nDoc fixes from Sven Panne. Generally fixing of Haddock links, adding some signatures, and in some cases exporting type constructors that are mentioned in the types of exported identifiers. 81e8f16 [project @ 2005-02-25 10:42:24 by simonmar] Add instance Typeable Queue 2d783d3 [project @ 2005-02-26 12:14:54 by panne] Moved Monoid instances of collection types to Data.Monoid, concentrating non-H98 stuff to a single place. 4d00bd6 [project @ 2005-03-02 13:11:00 by simonmar] We should not assume that the timeout parameter to select() is updated with the time left over after select() returns. Linux does this, but FreeBSD does not. 57c01ca [project @ 2005-03-02 14:46:14 by simonmar] distcleaning of things generated by configure e26da1d [project @ 2005-03-02 16:39:56 by ross] *Config.h files are in include/ (MERGE to STABLE) e7f3672 [project @ 2005-03-03 05:11:41 by chak] Merge to STABLE ad7c83f [project @ 2005-03-04 18:26:48 by sof] Temper 'libm' testing -- if 'atan' is available straight from libc, no need to include libm. 085be2d [project @ 2005-03-05 14:13:56 by panne] Use Data.Map instead of the deprecated Data.FiniteMap 12a28a1 [project @ 2005-03-05 15:13:01 by panne] Warning police again: Use the "official" hs_free_stable_ptr from HsFFI.h instead of the internal freeStablePtr, avoiding 02cf8b2 [project @ 2005-03-07 10:40:44 by simonmar] merge rev. 1.4.2.1 to HEAD 8a52d92 [project @ 2005-03-07 13:02:37 by simonmar] Add dynTypeRep, from John Meacham. 4a93ff0 [project @ 2005-03-09 17:47:50 by simonpj] Add instances for Bounded and Show up to 15-tuples 052a792 [project @ 2005-03-10 10:00:39 by simonpj] Read instances for tuples 9cc3315 [project @ 2005-03-10 17:23:06 by malcolm] Change configuration for nhc98 on Cygwin only. 2b179f0 [project @ 2005-03-14 12:18:05 by simonmar] Add Dimitry Golubovsky 's Unicode character class implementation. This will remove the dependency on libc's locale code and give us much more consistent support for Unicode across platforms. 74348f6 [project @ 2005-03-14 15:22:51 by simonmar] - isDigit only returns True for ASCII digits - Export the new predicates from Data.Char e5e2a19 [project @ 2005-03-14 15:46:12 by simonmar] Add Data.Ord and Data.Eq. Data.Ord also exports the new function 'comparing', as discussed on the libraries list a while back. 16246ff [project @ 2005-03-14 15:52:03 by simonmar] doc comparing 44c3027 [project @ 2005-03-14 15:57:04 by malcolm] Plumb in Data.Eq and Data.Ord. 976352f [project @ 2005-03-14 15:57:57 by simonmar] Add the script used to generate WCsubst.c 8f6b60a [project @ 2005-03-14 16:26:47 by simonmar] Fix export of Ordering b2d8004 [project @ 2005-03-14 17:23:22 by ross] Hugs only: don't import Data.{Eq,Ord} 1e09384 [project @ 2005-03-14 18:02:48 by ross] move general categories and derived predicates to Data.Char b7e91d4 [project @ 2005-03-15 12:15:15 by malcolm] nhc98 can use the WCsubst.c stuff for Unicode as well. 2173a4b [project @ 2005-03-15 13:38:27 by simonmar] patch for iswprint() from Dimitry. b683b7d [project @ 2005-03-15 17:18:24 by ross] remove unused WInt type 90b7403 [project @ 2005-03-15 17:19:09 by ross] Nhc: export the new names 77efda4 [project @ 2005-03-16 10:55:04 by simonmar] Back-port changes from WCsubst.c:iswprint() 56f0efe [project @ 2005-03-16 13:27:03 by ross] Data.Char docs, and hide GHC.Unicode 9e7c0b2 [project @ 2005-03-18 17:28:08 by krasimir] HACK: The redirection of standard handles under Windows is a little bit tricky because we have to take in account that the application can be GUI. The commit affects only Windows GUI applications. 7ac781d [project @ 2005-03-19 02:03:26 by sof] [Windows only] for System.Directory / Compat.Directory functionality that probes the OS for local details re: misc user directories, perform late binding of SHGetFolderPath() from shell32.dll, as it may not be present. (cf. ghc-6.4's failure to operate on Win9x / NT boxes.) If the API isn't there, fail with UnsupportedOperation. Packages.readPackageConfigs: gracefully handle excns from getAppUserDataDirectory. c0807fa [project @ 2005-03-21 18:04:48 by sof] __hscore_getFolderPath(): Don't limit ourselves to shell32.dll, look up shfolder.dll too. f2ab06e [project @ 2005-03-24 09:19:52 by simonmar] __hscore_getFolderPath is ccall, not stdcall. c77f5b4 [project @ 2005-03-27 13:41:19 by panne] * Some preprocessors don't like the C99/C++ '//' comments after a directive, so use '/* */' instead. For consistency, a lot of '//' in the include files were converted, too. a0f9b18 [project @ 2005-03-30 11:15:21 by simonmar] Ord instance: use toAscList instead of toList (doc change only; these functiosn are the same). f9aaf4e [project @ 2005-03-31 21:40:15 by wolfgang] Fix handling of end-of-options markers (--). getOpt would correctly return the non-options after the marker, but it would return errors for things after the marker that looked like options. b91764b [project @ 2005-04-02 04:39:35 by dons] Typo in comment only: "Causes a the finalizers associated with a foreign pointer..." to "Causes the finalizers associated with a foreign pointer..." 7847930 [project @ 2005-04-04 08:02:53 by simonmar] doc fix a0707a5 [project @ 2005-04-04 10:23:03 by simonpj] Indent where clauses 909df73 [project @ 2005-04-04 12:08:27 by simonpj] Match changes in DsMeta 58506e5 [project @ 2005-04-04 12:16:45 by simonpj] Default method for unsafeRangeSize should use unsafeIndex! 7e674ec [project @ 2005-04-05 08:38:24 by simonmar] Determine the location of CMD.EXE (or COMMAND.COM) using the same algorithm as system() from msvcrt. cf6ac4d [project @ 2005-04-06 22:05:58 by simonmar] Fix bug in hDuplicateTo 1d2fa28 [project @ 2005-04-07 14:33:31 by simonmar] Support handling signals in the threaded RTS by passing the signal number down the pipe to the IO manager. This avoids needing synchronisation in the signal handler. 0bf709e [project @ 2005-04-07 23:36:48 by sof] import reordering wibble to make it mingw-palatable. a7547ec [project @ 2005-04-12 12:57:49 by ross] clarify docs of insert and union. 8b9d1a1 [project @ 2005-04-17 10:06:16 by panne] Merged "unrecoginzed long opt" fix from Distribution.GetOpt 70c1fee [project @ 2005-04-21 09:40:41 by simonmar] Add unsafeForeignPtrToStorableArray 59e583d [project @ 2005-04-22 16:07:36 by sof] make DEBUG_DUMP-conditional code compile 21efff4 [project @ 2005-04-22 17:00:49 by sof] [mingw only] Better handling of I/O request abortions upon throwing an exception to a Haskell thread. As was, a thread blocked on an I/O request was simply unblocked, but its corresponding worker thread wasn't notified that the request had been abandoned. 6a56194 [project @ 2005-04-25 13:25:08 by simonmar] Only ftruncate() regular files. ae3215c [project @ 2005-05-04 15:07:47 by simonmar] Do *not* inline runSTRep now (see comments for details). 186152b [project @ 2005-05-06 00:30:56 by sof] [mingw only] Work around bug in win32 Console API which showed up in the GHCi UI: if the user typed in characters prior to the appearance of the prompt, the first of these characters always came out as a 'g'. The GHCi UI does for good reasons one-character reads from 'stdin', which causes the underlying APIs to become confused. A simple repro case is the following piece of C code: 000d5f5 [project @ 2005-05-13 16:58:02 by sof] flush_input_console__(): if the fd isn't connected to a console, treat flush as a NOP. Merge to STABLE. 77a3191 [project @ 2005-05-27 19:26:34 by simonmar] hLookAhead: don't wait for a completely full buffer e93177c [project @ 2005-06-10 13:19:41 by simonpj] Eta-contract foldr/app RULE to avoid overlap with foldr/id 8e91a49 [project @ 2005-06-10 13:21:52 by simonpj] Make toConstr strict for tuples, so that it's uniform with all other data types. 15a0ca0 [project @ 2005-06-27 13:56:32 by simonmar] Fix performance buglet: small Float literals weren't being simplified enough because the fromInteger method is defined in terms of encodeFloat, which itself is an FFI call. Double was already fixed, this change does the right thing for Float too. 4ff2fe3 [project @ 2005-06-27 22:31:41 by simonmar] As discussed on ghc-users some time ago, optimise the representation of ForeignPtr to make withForeignPtr more efficient. ForeignPtr is now represented by a pair of an Addr# and a ForeignPtrContents object. 084d417 [project @ 2005-07-04 10:22:17 by ross] add Typeable instance 47c5027 [project @ 2005-07-06 12:13:04 by simonmar] Close Handles passed to runProcess. Fixes #1187302 0c7e84a [project @ 2005-07-06 12:25:53 by simonmar] runProcess: allow duplicate Handles to be passed in without deadlock. Fixes #1187295. 858a97b [project @ 2005-07-06 16:17:36 by malcolm] Fix (from Scott Turner) for a broken implementation of 'split'. 0d0409f [project @ 2005-07-08 12:22:02 by simonmar] Fix instance Eq Version d389445 [project @ 2005-07-08 13:17:47 by simonmar] oops, fix imports 6d6efd8 [project @ 2005-07-08 17:17:31 by sof] - System.Posix.Internals.FDType.RawDevice: new constructor. - System.Posix.Internals.fdType: map block devices to RawDevice (but left character devices as still being Streams). - GHC.IOBase.isReadWriteHandleType: new HandleType predicate. - GHC.Handle.hIsSeekable: RawDevices are seekable. - GHC.Handle.openFd: handle RawDevices. => opening of block devices via std IO opening actions (open{Binary}File, openFd etc.) should now work better. 9f17e12 [project @ 2005-07-10 23:01:24 by ross] doc fix from Remi Turk 4316b2b [project @ 2005-07-14 11:57:09 by ross] Hugs only: more specific imports 170aa6c [project @ 2005-07-14 11:59:27 by ross] Data.Sequence: general purpose finite sequences (as discussed on the libraries list in May 2005). 0c691f5 [project @ 2005-07-14 15:36:31 by ross] remove redundant definitions of unsafeRangeSize (same as default) 48c53ef [project @ 2005-07-19 09:26:03 by ross] use $host instead of $target (mainly affects builds with cabal) dd5aff1 [project @ 2005-07-19 17:06:18 by ross] hook in Data.Sequence dc174ba [project @ 2005-07-19 17:33:23 by ross] improved definition of gfold for Seq a 550699d [project @ 2005-07-19 23:22:39 by ross] use feature tests instead of $host to locate socket library bce52f0 [project @ 2005-07-21 09:26:30 by simonmar] copyFile: copy the permissions properly (don't use getPermissions >>= setPermissions, which only copies the owner's permissions on Unix). 6f7a77e [project @ 2005-07-21 10:00:34 by simonmar] Further optimisations to ForeignPtr: now we don't allocate the IORef for a ForeignPtr without a finalizer. 5fabb36 [project @ 2005-07-21 10:59:27 by ross] more SPECIALIZE pragmas e2c3b39 [project @ 2005-07-21 11:00:17 by ross] revise Data instance again, making it like lists c7cf5ce [project @ 2005-07-21 11:08:51 by ross] specialize instances too efd2f2a [project @ 2005-07-21 12:54:33 by simonmar] Hack Makefiles so that 'make distclean' works even if the tree has not been configured, or 'make distclean' has already been run. 147c719 [project @ 2005-07-22 08:15:06 by ross] unbreak for non-GHC 7824273 [project @ 2005-07-22 10:18:51 by simonmar] check the return value of chdir() f0a1217 [project @ 2005-07-22 16:25:16 by ross] revert 1.17 6c85e7a [project @ 2005-07-23 13:28:24 by ross] Hugs: omit commandToProcess 02c7b60 [project @ 2005-07-23 17:08:03 by ross] non-GHC: implement rawSystem by translating the string for system. 20d9d69 [project @ 2005-07-26 09:37:27 by ross] PrelHandle functions are only needed by GHC 55872fc [project @ 2005-07-26 11:00:42 by ross] this version of closeFd is used by GHC only e6212d3 [project @ 2005-07-27 00:52:33 by ross] Hugs only: no longer need backslash fiddle now that Hugs leaves them alone. e06343d [project @ 2005-07-27 10:04:26 by simonmar] expand docs for touchForeignPtr and newConcForeignPtr 4bfe7c0 [project @ 2005-07-28 13:27:03 by ross] avoid warnings e63043f [project @ 2005-07-29 17:02:07 by ross] use Data.Sequence instead of Data.Queue b682cf9 [project @ 2005-07-29 17:03:37 by ross] deprecate in favour of Data.Sequence c21af11 [project @ 2005-07-29 17:17:22 by ross] document deprecation 751d276 [project @ 2005-08-01 13:23:22 by simonmar] Fix f51320c [project @ 2005-08-04 11:40:26 by simonmar] fix typo in subRegex (fixes subRegex breakage on Windows) 5c9f70d [project @ 2005-08-05 09:48:16 by ross] haddock stuff eb9ebee [project @ 2005-08-12 10:49:45 by dons] Typo in comment only 0b4e1f1 [project @ 2005-08-31 12:15:31 by ross] Hugs: use custom versioon of unsafeInterleaveIO 75e4c3e [project @ 2005-09-01 10:49:07 by ross] GHC only: define toList using build eb91a81 [project @ 2005-09-02 14:04:38 by simonmar] back out rev. 1.22; as pointed out by Krasimir Angelov, the optimisation doesn't work (sadly). cf2ac7d [project @ 2005-09-18 02:22:33 by dons] Typo in comment only. Spotted by heatsink on #haskell. ee014ae [project @ 2005-09-18 10:01:57 by panne] Fixed a few underquoted definitions. f547a0a [project @ 2005-09-19 23:24:31 by ross] For compilers other than MSVC and GCC, assume inline has the C99 semantics. a5c08f0 [project @ 2005-09-21 11:54:59 by simonmar] improve documentation for getProcessExitCode 959189a [project @ 2005-09-22 09:43:01 by ross] some docs 09a8784 [project @ 2005-09-24 15:07:49 by panne] Synched all FPTOOLS_CHECK_HTYPE definitions with the latest changes in libraries/OpenAL/aclocal.m4. Although it is not strictly necessary, keeping things identical is good for consistency. At some point in time we should really find a way to eliminate all this redundancy... *sigh* dd3c91d [project @ 2005-09-28 13:18:28 by malcolm] Add an instance of Read to correspond to the existing Show instance. (Implementation based on H'98 Report definition of 'readList'.) 536fe97 [project @ 2005-09-29 09:31:58 by ross] Tweak Read instance: allow optional parentheses around the outside (for consistency), and don't propagate precedence to elements. fcf6bc9 [project @ 2005-10-05 08:43:26 by ross] add Monad and MonadPlus instances 614127f [project @ 2005-10-05 13:15:44 by simonmar] mention that -O turns assertions off c787514 [project @ 2005-10-05 14:04:28 by simonmar] hPutChar should (probably) not be strict in its Char argument c149d13 [project @ 2005-10-10 23:32:51 by sof] CSsize fix: this Haskell type is defined iff HTYPE_SSIZE_T is. Merge to STABLE 145fc12 [project @ 2005-10-12 10:57:40 by simonpj] Comments 00178b8 [project @ 2005-10-13 10:35:49 by ross] comments re strict/lazy monads b1725c6 [project @ 2005-10-13 10:36:42 by ross] MArray instance for Lazy.ST df1dd98 [project @ 2005-10-13 11:09:50 by ross] update non-portability reasons c50cb4d [project @ 2005-10-18 11:36:25 by simonmar] Fixes to enable base to be compiled with -fasm on Windows: d3e1872 [project @ 2005-10-20 10:58:44 by malcolm] Instance of Read for Map, from Georg Martius. c5c9f61 [project @ 2005-10-20 15:08:35 by ross] Read instance ad514db [project @ 2005-10-20 15:14:22 by malcolm] Add spaces in Show instance, to avoid lexing problems e.g. Foo:=-0.9 in Read. 963fb60 [project @ 2005-10-20 17:12:28 by krasimir] from Neil Mitchell: 0c45859 [project @ 2005-10-20 18:07:53 by krasimir] The original version of @findExecutable@ was looking only in the $PATH but under Windows the executables are searched in the current directory, in $PATH and in some other places too. The new version is based on @SearchPath@ function from Win32 API. This is more consistent with @system@ and @rawSystem@ a50a2c7 [project @ 2005-10-20 23:28:42 by ross] revise Read instance to match < and > as chars rather than lexemes, as suggested by Georg Martius. 15d768a [project @ 2005-10-21 06:54:13 by ross] repair findExecutable 09106d4 [project @ 2005-10-21 10:24:58 by ross] export parens, which is useful for writing Read instances. 59d60fd [project @ 2005-10-21 10:26:57 by ross] conformant Show and Read instances 564bd0e [project @ 2005-10-21 10:39:56 by ross] conformant Show and Read instances b6a50ff [project @ 2005-10-21 10:47:25 by ross] conformant Show and Read instances. b585313 [project @ 2005-10-21 13:10:48 by simonmar] cmp_thread returns CInt, not Int b167a23 [project @ 2005-10-21 16:25:45 by ross] Data and FunctorM instances for View[LR]. 6925cf0 [project @ 2005-10-21 16:31:23 by ross] oops 8da605e [project @ 2005-10-22 00:28:21 by ross] define readListPrec too. 3e03f66 [project @ 2005-10-22 00:37:01 by ross] docs (readListDefault seems pretty useless) 86436c0 [project @ 2005-10-25 09:01:48 by simonmar] Note that throwTo blocks if the target thread is in a foreign call. 2cf6d82 [project @ 2005-10-25 09:11:25 by ross] Change the Monoid instance for functions (as proposed on the libraries list, and interpreting silence as assent) from composition to pointwise combination. ba5cc0b [project @ 2005-10-25 09:29:16 by ross] Now that Data.Monoid is portable, move Monoid instances for sets and maps back to where the data types are defined. a2138cd [project @ 2005-10-25 09:29:47 by ross] add Monoid instance b59789a [project @ 2005-10-25 11:13:53 by simonmar] forkIO the signal handlers directly from the IO manager thread, rather than calling an RTS function to do the same thing. 6f4bd87 [project @ 2005-10-25 12:01:11 by simonmar] fix findExecutable (I hope; don't have an up to date Windows build to test on). 823c0bc [project @ 2005-10-25 17:31:38 by sof] FPTOOLS_CHECK_HTYPE: correctly scope the resetting of CPPFLAGS; as was, it got blown away if the value was cached. 9a4eee8 [project @ 2005-10-26 22:52:58 by ross] missing part of rev. 1.13: in unfoldForestM_BF, the output sequence is now in the right order, so don't reverse it. 04179b4 [project @ 2005-10-27 01:39:40 by sof] [mingw/msys only] Undo long-standing workaround for buggy GNU ld's on mingw/msys; i.e., the linker wasn't correctly generating relocatable object files when the number of relocs exceeded 2^16. Worked around the issue by hackily splitting up the GHCi object file for the larger packages ('base', 'ObjectIO' and 'win32') into a handful of object files, each with a manageable number of relocs. Tiresome and error-prone (but the hack has served us well!) 0a1998c [project @ 2005-11-07 16:39:04 by simonmar] add GHC notes to mallocForeignPtr da71071 [project @ 2005-11-10 12:58:32 by simonmar] Some docs for System.Posix, from Bj?rn Bringert 2e0fce3 [project @ 2005-11-11 10:37:35 by simonmar] Fix bugs in new signal handling machinery a8973d9 [project @ 2005-11-11 12:01:58 by simonmar] On Windows, attach a finalizer to the ProcessHandle so that we can call CloseHandle() when the handle is no longer in use. Previously we were calling CloseHandle() in waitForProcess and terminateProcess, which prevented making multiple calls to these functions on the same handle. f5cf2d4 [project @ 2005-11-11 14:41:01 by simonmar] waitForProcess: if the process died with a signal, just return the exit status rather than EINTR. 1fd5b3a [project @ 2005-11-13 16:52:14 by jpbernardy] Correct handling of negative numbers in split and splitMember in IntMap and IntSet. Better documentation for insert and insertWith in Maps. c2922a3 [project @ 2005-11-17 11:28:43 by simonmar] ProcessHandle is now an MVar, in which we cache the ExitCode of the process when we know it. 01fe96a [project @ 2005-11-17 15:54:17 by ross] add a couple of Boolean instances c472d50 [project @ 2005-11-29 14:31:59 by ross] As foreshadowed on the libraries list, introduce new classes: 6615952 [project @ 2005-11-30 12:24:18 by simonmar] Add 7e724f3 [project @ 2005-11-30 16:56:24 by simonmar] - move forkIO into GHC.Conc, so that the I/O manager can use proper forkIO with an exception handler. This required TopHandler.lhs-boot. It's the right thing, though, since the forkIO implementation is GHC-specific. 15d096a [project @ 2005-12-01 12:32:24 by simonmar] export childHandler c2d0487 [project @ 2005-12-01 12:37:23 by simonmar] oops, forgot to remove forkIO from here 4a066b8 [project @ 2005-12-02 12:26:22 by simonmar] Apply rev 1.24 from FreeBSD's copy of this file. Commit message from FreeBSD: ce39b6e [project @ 2005-12-02 14:29:28 by simonmar] avoid recursive module trap with Haddock f8badeb [project @ 2005-12-03 17:32:01 by jpbernardy] Removed spurious constraint for Monoid (IntMap a) instance 712e319 [project @ 2005-12-05 11:42:47 by simonmar] Add IO versions of the STM primitives that allocate new transactional variables: f4a355a [project @ 2005-12-13 13:28:53 by simonmar] Only Streams can be DuplexHandles, not RawDevices. 8b4617a [project @ 2005-12-13 15:57:49 by simonmar] Raise the (new) exception NestedAtomically when atomically is nested (using unsafePerformIO). This is a small improvement over crashing. 636eb51 [project @ 2005-12-15 11:17:31 by simonmar] Add dataCast1/dataCast2 methods to Data class, as per ticket #633. c598bf9 [project @ 2005-12-30 00:18:59 by ross] deriving Data bf18366 [project @ 2006-01-02 19:38:01 by jpbernardy] * Left-bias restored * Minor documentation improvements d069840 [project @ 2006-01-06 15:46:09 by simonpj] Fix one-char typo in scanl1P ae57dba [project @ 2006-01-06 15:51:23 by simonpj] Eta-expand some higher-rank functions. GHC is about to move to *invariant* rather than *contra-variant* in function arguments, so far as type subsumption is concerned. These eta-expansions are simple, and allow type inference to go through with invariance. 7a04400 [project @ 2006-01-06 15:52:36 by simonpj] Use a type sig rather than a pattern signature, to avoid depending on GHC's precise impl of scoped type variables. (Which I'm about to change.) 0dc78a9 [project @ 2006-01-10 10:23:16 by simonmar] improve documentation for takeMVar/putMVar a2297e7 [project @ 2006-01-11 11:29:49 by simonmar] add some more warnings about unsafeThaw df9eb19 [project @ 2006-01-17 09:38:38 by ross] add Ix instance for GeneralCategory. 36d59c7 [project @ 2006-01-18 11:45:47 by malcolm] Fix import of Ix for nhc98. 8112cc1 [project @ 2006-01-19 14:47:15 by ross] backport warning avoidance from Haddock fe2c41b Generate PrimopWrappers.hs with Haddock docs Patch originally from Dinko Tenev , modified to add log message by me. 9f29faa add foldr/build optimisation for take and replicate This allows take to be deforested, and improves performance of replicate and replicateM/replicateM_. We have a separate problem that means expressions involving [n..m] aren't being completely optimised because eftIntFB isn't being inlined but otherwise the results look good. 72e08fb When splitting a bucket, keep the contents in the same order To retain the property that multiple inserts shadow each other (see ticket #661, test hash001) edd9a0f Add -fno-bang-patterns to modules using both bang and glasgow-exts ce3fd0e Give -foverlapping-instances to Data.Typeable 92e69c5 update ref in comment 0aaf0b9 simplify fmap 359978a typo in comment in Foldable class e9a5fe6 Drop dependency to haskell98 package 1a7dff0 declare blkcmp() static c592fc5 Years have 365 days, not 30*365 5e3514b Avoid overflow when normalising clock times e30e5f0 make head/build rule apply to all types, not just Bool. 9acdaa9 addToClockTime: handle picoseconds properly fixes #588 057d7ff add Data.Set.notMember and Data.Map.notMember e91e4ec Added notMember to Data.IntSet and Data.IntMap fa0b88a IntMap lookup now returns monad instead of Maybe. 907255a Oops typo in intSet notMember b3217ad Simplify Eq, Ord, and Show instances for UArray The Eq, Ord, and Show instances of UArray were written out longhand with one instance per element type. It is possible to condense these into a single instance for each class, at the expense of using more extensions (non-std context on instance declaration). 884e415 deprecate FunctorM in favour of Foldable and Traversable as discussed on the libraries list. be5f052 Added 'alter' Added 'alter :: (Maybe a -> Maybe a) -> k -> Map k a -> Map k a' to IntMap and Map This addresses ticket #665 b884ab3 Add unsafeSTToIO :: ST s a -> IO a Implementation for Hugs is missing, but should be easy. We need this for the forthcoming nested data parallelism implementation. 5b9df10 Fix a broken invariant Patch from #694, for the problem "empty is an identity for <> and $$" is currently broken by eg. isEmpty (empty<>empty)" d1372be add runIOFastExit :: IO a -> IO a Similar to runIO, but calls stg_exit() directly to exit, rather than shutdownHaskellAndExit(). Needed for running GHCi in the test suite. 56c2377 commit mysteriously missing parts of "runIOFastExit" patch 86dd67c work around a gcc 4.1.0 codegen bug in -O2 by forcing -O1 for GHC.Show See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26824 30a4c1d Rework previous: not a gcc bug after all It turns out that we were relying on behaviour that is undefined in C, and undefined behaviour in C means "the compiler can do whatever the hell it likes with your entire program". So avoid that. ff829d7 add forkOnIO :: Int -> IO () -> IO ThreadId 3d44743 implement ForeignEnvPtr, newForeignPtrEnv, addForeignPtrEnv for GHC b17768e in the show instance for Exception, print the type of dynamic exceptions Unfortunately this requires some recursve module hackery to get at the show instance for Typeable. 968208c Track the GHC source tree reorganisation b2322c0 GHC.Base.breakpoint 209bf03 add Functor and Monad instances for Prelude types 38f343d add superclasses to Applicative and Traversable a23421f add instances 5ef3a87 add Data.Fixed module c5a59fc fix for Haddock 0.7 7ebcbea RequireOrder: do not collect unrecognised options after a non-opt The documentation for RequireOrder says "no option processing after first non-option", so it doesn't seem right that we should process the rest of the arguments to collect the unrecognised ones. Presumably the client wants to know about the unrecognised options up to the first non-option, and will be using a different option parser for the rest of the command line. d2944d7 fix imports for mingw32 && !GHC fc75004 fixes for non-GHC efceae6 fix previous patch 2d5b84e Import Data.ByteString from fps 0.5. Fast, packed byte vectors, providing a better PackedString. 57580d9 Merge in Data.ByteString head. Fixes ByteString+cbits in hugs a9c2fe4 Fix string truncating in hGetLine -- it was a pasto from Simon's code (from Don Stewart) 03aaf4d inline withMVar, modifyMVar, modifyMVar_ e7fdfc4 improve performance of Integer->String conversion See http://www.haskell.org//pipermail/libraries/2006-April/005227.html 6d442b3 Sync with FPS head 13ed689 writeFile: close the file on error Suggested by Ross Paterson, via Neil Mitchell 765afaa use bracket in appendFile (like writeFile) b6baa0a fix for non-GHC 5dc6d8a Add array fusion versions of map, filter and foldl 916d10f Sat May 6 13:01:34 EST 2006 Don Stewart * Do loopU realloc on the Haskell heap. And add a really tough stress test cf09e8b Merge "unrecognized long opt" fix from 6.4.2 5046116 Much faster find, findIndex. Hint from sjanssen 375fb0c Faster filterF, filterNotByte 55a6c08 Fixed import list syntax 0e20df1 Fix all uses for Int that should be CInt or CSize in ffi imports. Spotted by Duncan and Ian aea8eeb Sync with FPS head. e23efcf Make unsafePerformIO lazy 5643470 Trim imports 2f3d49f Make length a good consumer 7888b96 Two things. #if defined(__GLASGOW_HASKELL__) on INLINE [n] pragmas (for jhc). And careful use of INLINE on words/unwords halves runtime for those functions 69267ec add GHC.Dynamic a8e9e76 add CIntPtr, CUIntPtr, CIntMax, CUIntMax types aac3a2c add WordPtr and IntPtr types to Foreign.Ptr, with associated conversions 90b1678 portable implementation of WordPtr/IntPtr for non-GHC 26e52f4 Some small optimisations, generalise the type of unfold 3047c46 Last two CInt fixes for 64 bit, and bracket writeFile while we're here c90763d Use our own realloc. Thus reduction functions (like filter) allocate on the Haskell heap. Makes around 10% difference. 7033cd5 Fix negative index handling in splitAt, replicate and unfoldrN. Move mapF, filterF -> map', filter' while we're here 419c964 add import Prelude to get dependencies right for Data/Fixed.hs Hopefully this fixes parallel builds. 3afb16f copyCString* should be in IO. Spotted by Tomasz Zielonka 484919b #define _REENTRANT 1 (needed to get the right errno on some OSs) Part 2 of the fix for threaded RTS problems on Solaris and possibly *BSD (Part 1 was the same change in ghc/includes/Rts.h). 35c06b8 Better error handling in the IO manager thread In particular, handle EBADF just like rts/posix/Select.c, by waking up all the waiting threads. Other errors are thrown, instead of just being ignored. 787633b Move Eq, Ord, Show instances for ThreadId to GHC.Conc Eliminates orphans. ec985c1 simplify indexing in Data.Sequence f5453a0 haddock fix d0c25f9 Sync with FPS head, including the following patches: b9dd64f add a way to ask the IO manager thread to exit 3d0ff7d Merge in changes from fps head. Highlights: cf5ba6a export breakpoint 915608d small intro to exceptions c5abb27 Add the inline function, and many comments 25ffdea Optimised foreign pointer representation, for heap-allocated objects 27cc188 a few doc comments 5aa26c3 add signature for registerDelay 72dc76a Add minView and maxView to Map and Set 397210f clarify and expand docs 6861b99 remove dead code 0aac978 default to NoBuffering on Windows for a read/write text file Fixes (works around) #679 e5c1c21 comments for Applicative and Traversable 7aa1ae2 Wibble in docs for new ForeignPtr functionsn 3b80a6c Import Data.ByteString.Lazy, improve ByteString Fusion, and resync with FPS head 96040a0 Disable unpack/build fusion a2880cf Avoid strictness in accumulator for unpackFoldr 2d747fd UNDO: Merge "unrecognized long opt" fix from 6.4.2 This patch undid the previous patch, "RequireOrder: do not collect unrecognised options after a non-opt". I asked Sven to revert it, but didn't get an answer. 2bd9530 breakpointCond edc5299 make Control.Monad.Instances compilable by nhc98 1cebefa disambiguate uses of foldr for nhc98 to compile without errors 06f63fd Add missing method genRange for StdGen (fixes #794) 2b0673e Improve documentation of atomically 15ccf58 Fix unsafeIndex for large ranges f9a5721 remove spurious 'extern "C" {' 3612974 add traceShow (see #474) 7b0cffd deprecate this module. 784a581 Change the API of MArray to allow resizable arrays See #704 eef1ca7 remove unnecessary #include "ghcconfig.h" 970f880 move altzone test from ghc to base package 0bd0b8a Remove deprecated Data.FiniteMap and Data.Set interfaces d176439 bump version to 2.0 b6f1c8f move Text.Html to a separate package 57ea42b (non-GHC only) track MArray interface change 4275eb7 reduce dependency on ghcconfig.h e1d2ec1 Warning police: Removed useless catch-all clause 1c04b40 Warning police: Make some prototypes from the RTS known baf6864 Jan-Willem Maessen's improved implementation of Data.HashTable Rather than incrementally enlarging the hash table, this version just does it in one go when the table gets too full. 4264db2 remove deprecated 'withObject' 30e4620 fix Data.HashTable for non-GHC 8b90757 revert removal of ghcconfig.h from package.conf.in 33d6937 markup fix to Data.HashTable 878033a Hugs only: disable unused process primitives 3e3001b eliminate more HOST_OS tests 22e2f2c remove Text.Html from nhc98 build 424d170 add mapMaybe and mapEither, plus WithKey variants 9877f3a use correct names of IOArray operations for nhc98 3900e67 use Haskell'98 compliant indentation in do blocks c0c6e3f fix docs for withC(A)StringLen 16a9ba1 remove extra comma from import 03b3d01 generate Haddock docs on all platforms 2220a18 add alternative functors and extra instances 0236be1 copyFile: try removing the target file before opening it for writing f366c7e copyFile: try removing the target file before opening it for writing ff58206 add notes about why copyFile doesn't remove the target 19b0b8b Sync Data.ByteString with current stable branch, 0.7 e30f641 Add spec rules for sections in Data.ByteString c587da6 explicitly tag Data.ByteString rules with the FPS prefix. 817e4b1 remove Text.Regx & Text.Regex.Posix These are subsumed by the new regex-base, regex-posix and regex-compat packages. dfd5b77 this should have been removed with the previous patch 4af3f6a Add shared Typeable support (ghc only) c11b520 C regex library bits have moved to the regex-posix package 39c7df3 document minimal complete definition for Bits e2c372f add docs for par cdb49e2 Workaround for OSes that don't have intmax_t and uintmax_t OpenBSD (and possibly others) do not have intmax_t and uintmax_t types: http://www.mail-archive.com/haskell-prime at haskell.org/msg01548.html so substitute (unsigned) long long if we have them, otherwise (unsigned) long. 22ae6fa Clarify how one hides Prelude.catch 2dd6854 add Haddock marker f3789f0 expand advice on importing these modules f06cad5 add advice on avoiding import ambiguities 8e2de3a Hide internal module from haddock in Data.ByteString f61e591 Add Control.Monad.forM and forM_ cee3369 Make length a good consumer 44e60b1 Fix a bug in mkName; merge to STABLE ed03203 Add Show instances 06a394f Modifications required by the changes to package support in GHC A NameG now needs to store the package name, too. 8313186 add Data.Foldable.{for_,forM_} and Data.Traversable.{for,forM} 9b3b565 fix doc typo a5e46c7 add Data.Foldable.{msum,asum}, plus tweaks to comments d05b325 remove Text.Regex(.Posix) from nhc98 build f9ed538 import Control.Arrow.ArrowZero to help nhc98's type checker 46b8f57 remove some outdated comments 70cc949 mark nhc98 import hack ce524a6 fix hDuplicateTo on Windows deja vu - I'm sure I remember fixing this before... 7da77b4 Better doc on Data.Map.lookup: explain what the monad is for a08a636 New function isInfixOf that searches a list for a given sublist 08c9165 Cleaner isInfixOf suggestion from Ross Paterson bbd10f9 remove obsolete Hugs stuff 42bc89c Typeable1 instances for STM and TVar 27de16c Sync Data.ByteString with stable branch 962f7dd doc tweaks, including more precise equations for evaluate 2cf2fc3 Add strict versions of insertWith and insertWithKey (Data.Map) f40952a fix header comment 9e9cd6e add typeRepKey :: TypeRep -> IO Int See feature request #880 1785df7 make hGetBufNonBlocking do something on Windows w/ -threaded hGetBufNonBlocking will behave the same as hGetBuf on Windows now, which is better than just crashing (which it did previously). bb521d9 Hugs only: unbreak typeRepKey 03d0cfd Fix syntax error that prevents building Haddock documentation on Windows c38aadd Data.ByteString: fix lazyness of take, drop & splitAt f3ff0bf Don't create GHC.Prim when bootstrapping; we can't, and we don't need it b628859 Inline shift in GHC's Bits instances for {Int,Word}{,8,16,32,64} 872e851 STM invariants 034f0e0 Remove Data.FiniteMap, add Control.Applicative, Data.Traversable, and Data.Foldable to the nhc98 build. e99378b add Data.Sequence to nhc98 build bdaca42 Use the new Any type for dynamics (GHC only) 51e8938 fix example in comment 31a910c `par` should be infixr 0 Alas, I didn't spot this due to lack of testing, and the symptom is that an expression like x `par` y `seq z will have exactly the wrong parallelism properties. The workaround is to add parantheses. 485a4c9 Export pseq from Control.Parallel, and use it in Control.Parallel.Strategies e1da52d Add intercalate and split to Data.List 66e2685 rearrange docs a bit 77ae4e7 minor clarification of RandomGen doc 235e738 Add deriving Data to Complex 0472466 #ifdef around non-portable Data.Generics.Basics 9dcd804 Data.Generics.Basics is GHC-only 1d21645 Add intercalate and split to Data.List 53d7e21 fix example in docs 79c5c8d fix Haddock module headers 5624fae Use unchecked shifts to implement Data.Bits.rotate This should get rid of those cases, maybe lower the size enough that the inliner will like it? 5dfb83e Update documentation for hWaitForInput See #972 Merge to 6.6 branch. 6ad778f enable canonicalizePath for non-GHC platforms c12944f non-GHC: fix canonicalizeFilePath 742f987 Add intercalate to Data.List (ticket #971) 875a980 remove conflicting import for nhc98 44b2881 add withFile and withBinaryFile (#966) fba6785 redefine writeFile and appendFile using withFile c283e0f __hscore_long_path_size is not portable beyond GHC 24f8f5a Added Data.Function (Trac ticket #979). + A module with simple combinators working solely on and with functions. + The only new function is "on". + Some functions from the Prelude are re-exported. 853060d import Prelude 0ab34eb move fix to Data.Function c3a275e whitespace only 18acbc6 add Data.Function 528e40d add Data.Function 6103c6b hide Data.Array.IO.Internals 2f50f09 add doc link to bound threads section 87fad1c Fix broken pragmas; spotted by Bulat Ziganshin b3cfb51 Added and cleaned up Haddock comments in Control.Parallel.Strategies. Many of the definitions in Control.Parallel.Strategies had missing or unclear Haddock comments. I converted most of the existing plain code comments to haddock comments, added some missing documentation and cleaned up the existing Haddock mark-up. 5c0d819 Control.Parallel.Strategies: clarified documentation of parListChunk. 77b3487 add Control.Monad.Instances to nhc98 build a60bf5a Control.Parallel.Strategies: deprecate sPar, sSeq, Assoc, fstPairFstList, force and sforce. Code comments indicated that sPar and sSeq have been superceded by sparking and demanding, and that Assoc, fstPairFstList, force and sforce are examples and hacks needed by the Lolita system. 541ff14 Control.Parallel.Strategies: added NFData instances for Data.Int.*, Data.Word.*, Maybe, Either, Map, Set, Tree, IntMap, IntSet. 7a95457 Control.Parallel.Strategies clean-up: Added export list to avoid exporting seq, fixed import list strangeness that haddock choked on, and moved the deprecated functions to a separate section. 277e650 Update comments on Prelude organisation in GHC/Base.lhs 3b4ae5f LPS chunk sizes should be 16 bytes, not 17. 706b202 The wrong 'cycle' was exported from Data.ByteString.Lazy.Char8, spotted by sjanssen e7f9aae (nhc98) use new primitive implementations of h{Put,Get}Buf. 38d3dcf fix shift docs to match ffi spec 7b5235b typo in comment 8a3e83e One less unsafeCoerce# in the tree d65c1d2 make Data.Graph portable (no change to the interface) 795a06a remove Data.FunctorM and Data.Queue 18063ef Data.Graph is now portable (enable for nhc98) 9fd9913 trim imports 0c99253 Add an example of the use of unfoldr, following doc feedback from dozer e6c9171 Add type signatures d05d58b Move instance of Show Ptr to Ptr.hs (fewer orphans) 6b8688cd Hugs: add Control.Parallel.Strategies a2730b6 Add comments about argument order to the definitions of gmapQ and constrFields 126ec36 Make sure the threaded threadDelay sleeps at least as long as it is asked to 1143767 deriving (Eq, Ord, Enum, Show, Read, Typeab) for ConsoleEvent e0bfa41 Add support for the IO manager thread on Windows Fixes #637. The test program in that report now works for me with -threaded, but it doesn't work without -threaded (I don't know if that's new behaviour or not, though). aa6f4f5 Bump version number 3568a5d don't try to compile this on Unix 8c741ae dos2unix cf2d0bf documentation for installHandler merge to 6.6 2bc271d Add note about synhronous delivery of throwTo 2db4355 Mention that throwTo does not guarantee promptness of delivery 05fccf8 Fix missing comma in Fractional documentation 9b46e1e Introduce Unknowns for the closure viewer. Add breakpointCond which was missing 8b1678a Show instance for GHC.Base.Unknown 43ccc31 Improved the Show instance for Unknown 8d21eab Added Unknowns for higher kinds 569100a version of example using Tomasz Zielonka's technique bfe7806 Fix crash with (minBound :: Int*) `div (-1) as result is maxBound + 1. 66cb5d0 update section on "blocking" 7ba42a3 fix threadDelay In "Add support for the IO manager thread" I accidentally spammed part of "Make sure the threaded threadDelay sleeps at least as long as it is asked", which is why the ThreadDelay001 test has been failing. ff844b6 Added examples, more detailed documentation to Data.List Extracting sublists functions 7cf2924 Add IsString class for overloaded string literals. 7663ed1 Applicative and Monad instances for Tree cb089d8 IsString is GHC-only (so why is it in the Prelude?) 628e887 Add Kleisli composition fe68f08 Remove IsString(fromString) from the Prelude e745d6c Eliminate some warnings Eliminate warnings in the libraries caused by mixing pattern matching with numeric literal matching. b78b87f Improve pretty-printing for Template Haskell a52048c bump version to 2.0 a985f2c Omit package names when pretty-printing Names. 2eabf4a Add comments, re-order code (no functional effect) 7919110 Add Lift instances for Maybe and Either 5825786 Add instance Functor Q and make Quasi require Functor 117a9ce make Setup suitable for building the libraries with GHC de31008 add doc pointers to Foldable 676eede add derived instances for Dual monoid 66b09e0 Use static inline rather than extern inline/inline I understand this is more portable, and it also fixes warnings when C things we are wrapping are themselves static inlines (which FD_ISSET is on ppc OS X). 23d4259 Add some type sigs 038a87c Whitespace changes only 8cb0f00 wrapround of thread delays a245c49 The Windows counterpart to 'wrapround of thread delays' 2cd39a9 fix to getUSecOfDay(): arithmetic was overflowing 6541cb7 fix for hashString, from Jan-Willem Maessen (see #1137) 5a4614e Fix the types of minView/maxView (ticket #1134) 1b76e1d Consistently use CInt rather than Int for FDs f4c9f5a Fix FD changes on Windows c57ae3a Remove more redundant FD conversions e2880ed Keep the same FD in both halves of a duplex handle when dup'ing Otherwise we only close one of the FDs when closing the handle. Fixes trac #1149. 10c329e Fixed PArr.dropP - Thanks to Audrey Tang for the bug report 5764043 FDs are CInts now, fixing non-GHC builds 008e6d5 Bump nhc98 stack size for System/Time.hsc 10b8fa2 GHC.PArr: add bounds checking 6415e1c Add Data.String, containing IsString(fromString); trac proposal #1126 This is used by the overloaded strings extension (-foverloaded-strings in GHC). 96bb404 PArr: fixed permutations f86201f This patch adds a timeout function to the base libraries. Trac #980 is concerned with this issue. The design guideline for this implementation is that 'timeout N E' should behave exactly the same as E as long as E doesn't time out. In our implementation, this means that E has the same myThreadId it would have without the timeout wrapper. Any exception E might throw cancels the timeout and propagates further up. It also possible for E to receive exceptions thrown to it by another thread. e4323ea So many people were involved in the writing of this module that it feels unfair to single anyone out as the lone copyright holder. c0ab057 document timeout limitations 4cc5934 expand docs for forkOS ec836af Prevent duplication of unsafePerformIO on a multiprocessor Fixes #986. The idea is to add a new operation a8978ba fix race condition in prodServiceThread See #1187 44ab526 Add ioeGetLocation, ioeSetLocation to System/IO/Error.hs; trac #1191 59b427f copyBytes copies bytes, not elements; fixes trac #1203 6760c51 remove Makefile.inc (only affects nhc98) b6533af fix strictness of foldr/build rule for take, see #1219 a503ca1 Fix the type of wgencat 4701812 Monoid instance for Maybe and two wrappers: First and Last. trac proposal #1189 05ebb4b Add min/max handling operations for IntSet/IntMap f60d46b Function crossMapP for fixing desugaring of comprehensions 4b6a4eb fix for nhc98 build cedc8a4 put 'unsafeCoerce' in a standard location f60d1d7 Fix type mismatches between foreign imports and HsBase.h a37d25a add new module Unsafe.Coerce to build system 02d43d2 Fix C/Haskell type mismatches 0a39a51 Fix incorrect changes to C types in a foreign import for nhc98. If we use type CTime, it needs to be imported. Also, CTime is not an instance of Integral, so use some other mechanism to convert it. d786c4c Fix braino 227cf48 HsByteArray doesn't exist 0266d37 Don't use Fd/FD in foreign decls Using CInt makes it much easier to verify that it is right, and we won't get caught out by possible newtype switches between CInt/Int. 29d33b0 HsByteArray doesn't exist ae2d7c4 make Setup and base.cabal suitable for building the libraries with GHC 6480393 Unsafe.Coerce doesn't need Prelude 6bfb0f0 fix isPortableBuild test 65de149 Hugs only: fix location of unsafeCoerce 020e535 Allow additional options to pass on to ./configure to be given 11a95eb Add missing case in removePrefix ceef7da Fix -Wall warnings 2ac9133 Don't turn on -Werror in Data.Fixed This may be responsible for the x86_64/Linux nightly build failing. d652584 mark System.IO.openTempFile as non-portable in haddocks f7ecae4 add System.Posix.Types to default nhc98 build 3e534f1 Remove unnecesary SOURCE import of GHC.Err in GHC.Pack 799c7ed we need a makefileHook too e7e4438 For nhc98 only, use hsc2hs to determine System.Posix.Types. Avoids the existing autoconf stuff, by introducing an auxiliary module called NHC.PosixTypes that uses hsc2hs, which is then simply re-exported from System.Posix.Types. 6525735 MacOS 10.3 needs #include as well 20edb73 Fix configure with no --with-cc 65ca4e1 MERGE: fix ugly uses of memcpy foreign import inside ST fixes cg026 6afe94d inclusion of libc.h is conditional on __APPLE__ d961dd8 Follow Cabal changes in Setup.hs 98d48f5 Add extra libraries when compiling with GHC on Windows e457960 tweak documentation as per suggestion from Marc Weber on libraries at haskell.org aa97e0f Add IsString to exports of GHC.Exts 4d4bbe3 Remove Splittable class (a vestige of linear implicit parameters) ddf3e70 Create showName, which takes an additional prefix-context argument 5a9552b Thread prefix-context argument through pprName 9044ae2 Use pprName False in pretty printer 0c74dc0 Typo fixes, missing {in,ex}ports 5cbdc0d Properly handle tilde-patterns 65dd02d Fix precedence passing for patterns in LamE (fixes \((:) x xs) -> x misprinting) 1b71adb Pretty-print an empty list of fundeps without '|' (should fix #1260) de7bb87 parse (but don't pass on) options for ./configure d219695 Rejig name printing a bit 9e55b8f Another name printing tweak 59f1728 Add missing case in removePrefix 22d0fcd Fix -Wall warnings bbca21c Report fail string before passing control through to underlying fail in Q monad (otherwise it gets lost in GHC's IOEnv) for trac #1265 dcc8108 Follow Cabal changes in Setup.hs 279015b Be less quiet about building the base package ebde8c2 Trim imports, remove a cycle 73715a0 Make Control.Exception buildable by nhc98. The nhc98 does not have true exceptions, but these additions should be enough infrastructure to pretend that it does. Only IO exceptions will actually work. c12da1c the "unknown" types are no longer required d8f90d7 FIX: #724 (tee complains if used in a process started by ghc) aa73318 improve documentation for evaluate 94fd935 further clarify the docs for 'evaluate' 8e41494 Give an example of how intersection takes elements from the first set 698db81 fix imports for non-GHC 6c1f9ea Build GHC/Prim.hs and GHC/PrimopWrappers.hs from Cabal a5e5cd66 Use FilePath to make paths when building GHC/Prim.hs and GHC/PrimopWrappers.hs 2ce182e When doing safe writes, handle EAGAIN rather than raising an exception It might be that stdin was set to O_NONBLOCK by someone else, and we should handle this case. (this happens with GHCi, I'm not quite sure why) 3851b9a correct the documentation for newForeignPtr 51cdd8a add install-includes: field abcb831 Remove the pretty-printing modules (now in package pretty( d5ec800 We now depend on pretty 5d048b7 Remove Control.Parallel*, now in package parallel 60eef51 Split off directory, random and old-time packages 565675e System.Locale is now split out a77b423 Fix comment: maperrno is in Win32Utils.c, not runProcess.c 2ecf2cb Split off process package 9a7a022 Remove Makefile and package.conf.in (used in the old build system) f1a7942 Remove Makefile and package.conf.in (used in the old build system) 4c87ae5 remove directory, pretty, and random bits from base for nhc98 bbea32c nhc98 version of instance Show (a->b) copied from Prelude dbe5cf7 remove locale as well 995b9ff remove System.Cmd and System.Time too 9515bd4 delete unused constants d7ffcfa DIRS now lives in package Makefile, not script/pkgdirlist 1ab69f6 add module Data.Fixed to nhc98 build c193735 Add System.Timeout to base.cabal Filtered out for non-GHC by Setup.hs. 63d51d7 add a dummy implementation of System.Timeout.timeout for nhc98 0801066 add nhc98-options: field to .cabal file c72577d Control.Concurrent documentation fix 1be55ff Add Data instance for PackedString; patch from greenrd in trac #1263 1735728 Add Data and Typeable instances; patch from greenrd in trac #1263' 262f013 Data.PackedString: Data.Generics is GHC-only 4423efb --configure-option and --ghc-option are now provided by Cabal 5fedced Remove unsafeCoerce-importing kludgery in favor of Unsafe.Coerce ed5ac20 --configure-option and --ghc-option are now provided by Cabal 3b1e6cb fix description of CWStringLen 5b773cb FIX hGetBuf001: cut-and-pasto in readRawBufferNoBlock c9c7e2a update prototype following inputReady->fdReady change 0fbc000 install dependent include files and Typeable.h 67106d5 Typo (consUtils.hs -> consUtils.h) b16277b Hugs now gets MonadFix(mfix) from its prelude e1340db makefileHook needs to generate PrimopWrappers.hs too 4ddc6d9 Change C-style comments to Haskell-style. These two headers are only ever used for pre-processing Haskell code, and are never seen by any C tools except cpp. Using the Haskell comment convention means that cpphs no longer needs to be given the --strip option to remove C comments from open code. This is a Good Thing, because all of /* */ and // are valid Haskell operator names, and there is no compelling reason to forbid using them in files which also happen to have C-preprocessor directives. aa44db4 Use a combination of Haskell/C comments to ensure robustness. e.g. -- // ensures that _no_ preprocessor will try to tokenise the rest of the line. 2a9932d Use "-- //" (2 spaces) rather than "-- //" (1) to avoid tripping haddock up Are we nearly there yet? 4736c6e Speed up number printing and remove the need for Array by using the standard 'intToDigit' routine dfb3810 Modernize printf. 3deaeb1 fix bug in writes to blocking FDs in the non-threaded RTS 9143446 Word is a type synonym in nhc98 - so class instance not permitted. c9fc2b4 change nhc98 option from -prelude to --prelude 8b6d67e FIX #1131 (newArray_ allocates an array full of garbage) Now newArray_ returns a deterministic result in the ST monad, and behaves as before in other contexts. The current newArray_ is renamed to unsafeNewArray_; the MArray class therefore has one more method than before. d56c747 Remove include-dirs ../../includes and ../../rts We get these by virtue of depending on the rts package. 2f54eec Add a more efficient Data.List.foldl' for GHC (from GHC's utils/Util.lhs) f8099c8 no need to hide Maybe 105cdfb Define stripPrefix; fixes trac #1464 78e6aa0 Implement GHC.Environment.getFullArgs This returns all the arguments, including those normally eaten by the RTS (+RTS ... -RTS). This is mainly for ghc-inplace, where we need to pass /all/ the arguments on to the real ghc. e.g. ioref001(ghci) was failing because the +RTS -K32m -RTS wasn't getting passed on. 74859e7 in hClose, free the handle buffer by replacing it with an empty one This helps reduce the memory requirements for a closed but unfinalised Handle. d6b1060 fix Data.Map.updateAt See http://haskell.org/pipermail/libraries/2007-July/007785.html for a piece of code triggering the bug. updateAt threw away parts of the tree making up the map. 9e71989 Add a test for Data.Map, for a bug on the libraries@ list 9cb0c9e Rename openFd to fdToHandle' The name collision with System.Posix.IO.openFd made my brain hurt. fbe2f45 Move open(Binary)TempFile to System.IO 4c73274 Tweak temporary file filename chooser 39b65b1 open(Binary)TempFile is now portable 36d4917 Hugs only: avoid dependency cycle f0320cc fix Hugs implementation of openTempFile 3001ce0 Handle buffers should be allocated with newPinnedByteArray# always Not just on Windows. This change is required because we now use safe foreign calls for I/O on blocking file descriptors with the threaded RTS. Exposed by concio001.thr on MacOS X: MacOS apparently uses smaller buffers by default, so they weren't being allocated as large objects. 5637658 Use cabal configurations rather than Setup hacks c3eb383 Correct Windows OS name in cabal configuration 6259d85 Fix fdToHandle on Windows The old setmode code was throwing an exception, and I'm not sure it is meant to do what we need anyway. For now we assume that all FDs are both readable and writable. 645196f Generalise the type of synthesize, as suggested by Trac #1571 be395b7 Temporarily fix breakage for nhc98. A recent patch to System.IO introduced a cyclic dependency on Foreign.C.Error, and also inadvertently dragged along System.Posix.Internals which has non-H'98 layout, causing many build problems. The solution for now is to #ifndef __NHC__ all of the recent the openTempFile additions, and mark them non-portable once again. (I also took the opportunity to note a number of other non-portable functions in their Haddock comments.) 63544e5 fix Haddock markup 77d32a0 Clarify the swapMVar haddock doc 0fd4bea Move throwErrnoPath* functions from unix:System.Posix.Error 0e5ff9a Add simple haddock docs for throwErrnoPath* functions 0b9eebb Export throwErrnoPath* functions 78c8f42 bytestring is now in its own package d5b0bbb Remove System.Posix.Signals (moving to unix) c769383 Remove a number of modules now in a "containers" package 95a6179 Data.Array* and Data.PackedString have now moved to their own packages bf42b1a We now depend on the packedstring and containers packages 4f92628 Move the datamap001 (our only test) to the containers package 46341a1 Remove bits left over from the old build system 675a579 Move Data.{Foldable,Traversable} back to base The Array instances are now in Data.Array. b9bb2fc Don't try to build modules no longer living in base. a93b81c install Typeable.h for use by other packages ebd05cd Correct the swapMVar haddock doc 1df1a9b Don't import Distribution.Setup in Setup.hs as we no longer need it daf52ae include Win32 extra-libraries for non-GHC's too e3d4781 remove now-unused SIG constants 364214f fpstring.h has moved to bytestring c9a5285 test impl(ghc) instead of IsGHC 78d4976 Fix hashInt As pointed out in http://www.haskell.org/pipermail/glasgow-haskell-bugs/2007-August/009545.html the old behaviour was Prelude Data.HashTable> map hashInt [0..10] [0,-1,-1,-2,-2,-2,-3,-3,-4,-4,-4] 4fa06d9 FIX #1282: 64-bit unchecked shifts are not exported from base I've exported these functions from GHC.Exts. They are still implemented using the FFI underneath, though. 8a55cef delete configure droppings in setup clean 03ddae3 Make arrays safer (e.g. trac #1046) 6a9a2bf Added dummy license file Please fill in the correct license, no clue what it should be. Furthermore, a few licenses resulting from the "Big Base Split" (tm) should be reviewed, I guess. 113cd39 Put the correct license text in b2f00be Remove redundant include/Makefile cf6952e Better hash functions for Data.HashTable, from Jan-Willem Maessen 4af946a Fix building HashTable: Use ord rather than fromEnum e5954dc Fix haddock docs in Hashtable 11e8e5c make hWaitForInput/hReady not fail with "invalid argument" on Windows See #1198. This doesn't fully fix it, because hReady still always returns False on file handles. I'm not really sure how to fix that. 53a7a8a Suppress some warnings ff8b9d8 Remove some incorrect rules; fixes #1658: CSE [of Doubles] changes semantics 786638a FIX #1689 (openTempFile returns wrong filename) 043f2f2 Add a boring file adf2a96 Add a boring file 502c181 Add more entries to boring file e70b3ee put extra-tmp-files field in the right place 1fc47ca typo efdee48 expose the value of +RTS -N as GHC.Conc.numCapabilities (see #1733) a8ee502 clean up duplicate code ab8f5bb FIX #1652: openTempFile should accept an empty string for the directory b788063 base in 6.8 and head branch should be version 3.0 c17eadb Clean up .cabal file a bit specify build-type and cabal-version >= 1.2 put extra-tmp-files in the right place use os(windows) rather than os(mingw32) 9c374bf FIX #1258: document that openTempFile is secure(ish) Also change the mode from 0666 to 0600, which seems like a more sensible value and matches what C's mkstemp() does. 90af93e Fix doc building with Haddock 0.9 I was using a recent build here, which is more tolerant. 65fe3dc new Control.Compositor module 66ec326 Bump version number bf2a204 Copy description for the Cabal file from prologue.txt 6758b39 Specify build-type: Simple da44e83 new Control.Category, ghc ticket #1773 f9bc7b8 FIX BUILD: Haddock 1.x fails to parse (Prelude..) 8898b4b Fix performance regression: re-instate -funbox-strict-fields Yikes! While investigating the increase in code size with GHC 6.8 relative to 6.6, I noticed that in the transition to Cabal for the libraries we lost -funbox-strict-fields, which is more or less depended on by the IO library for performance. I'm astonished that we didn't notice this earlier! a4b128f fix nhc98 build: need a qualified Prelude import 6270bf0 add Control.Category to the nhc98 build 27fa0a4 Add module of special magic GHC desugaring helper functions Currently containing only one such helper: (>>>) for arrow desugaring 59b4958 Filter out GHC.Prim also for the Haddock step Please merge to the GHC 6.8.2 branch 2dc3c04 Fix ` characters in elem's haddock docs df97527 fix comment 530c5c7 Only overwrite GHC/Prim.hs and GHC/Primopwrappers.hs if they change This avoids make doing unnecessary work after 'setup makefile'. 5f59f65 Move file locking into the RTS, fixing #629, #1109 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). 460f368 Fix compilation with GHC 6.2.x 740bbc4 oops, we forgot to export traceShow 5a223d3 remove lockFile.h from install-includes 7bac83d FIX #1753 hClose should close the Handle and unlock the file even if calling close() fails for some reason. ea2fdf0 FIX BUILD: maybeUpdateFile: ignore failures when removing the target 94dbed6 Escape some special characters in haddock docs bc34b5f Don't try to make haddock links to the mtl package as we don't depend on it 49cc9d9 Fix some links in haddock docs 333440b Fix some URLs 69fc4b6 note about how to convert CTime (aka EpochTime) to UTCTime b3febff restore fdToHandle' to avoid breaking clients (#1109) c6f9dba protect against concurrent access to the signal handlers (#1922) 1030068 protect console handler against concurrent access (#1922) 34c69fd FIX #1621: bug in Windows code for getCPUTime We were reading the components of FILETIME as CLong, when they should be unsigned. Word32 seems to be the correct type here. c8a5524 Add singletonP to GHC.PArr a8897e2 doc only: use realToFrac instead of fromRational.toRational 0002e65 docs: describe the changes to forkIO, and document forkOnIO 5b4734c Implement 'openTempFile' for nhc98. fd205ff Simplify the GHC.Prim hack in base.cabal/Setup.hs 09f867c Add GHC.Prim to exposedModules in the Haddock 0.x hook 757c909 Add GHC.Prim to exposedModules in the Haddock 0.x hook 774beba Add groupWith, sortWith, the, to support generalised list comprehensions 045a52b Tuple tycons have parens around their names ca6fcaa Remove redundant imports of GHC.Err 8fb82f4 Fix comment on GHC.Ptr.minusPtr 485b60f Data.List.sort: force elements from start to end. this prevents a stack overflow on sort (take 10^6 [1..]) e37fa69 haddock attributes for haddock-2.0 33a93d5 Export topHandler, topHandlerFastExit from GHC.TopHandler We now use one of these in ghc when running with ghc -e e0fac59 Windows: large file support for hFileSize and hSeek (#1771) 087ccec add comment about lack of _chsize_s() 55b76a3 The default uncaught exception handler was adding an extra \n 7d4917a FIX #1936: hGetBufNonBlocking was blocking on stdin/stdout/stderr 7068e4c Generalise type of forever :: (Monad m) => m a -> m b f3f3903 deforestation rules for enumFromThenTo; based on a patch from Robin Houston 65a16b7 FIX dynamic001 dynamic002: isTupleTyCon had rotted In the patch "Tuple tycons have parens around their names", the names of the tuple tycons were changed to include parens, but isTupleTyCon was not updated to match, which made tuple types show as "(,) a b" rather than "(a,b)" 7382021 Whitespace only 7d1f993 whitespace only b667aa1 untabify only 499cb4f untabify 0077a5a FIX dynamic001, dynamic002: further fixes to tuple printing 18245aa untabify ae37bad untabify 9800d3d untabify 32af111 Add exitSuccess :: IO a. For symmetry with exitFailure f724cc9 untabify 6cab05d untabify e117955 untabify fc013dc untabify 01c9ee9 untabify 43f65bc mention explicitly that hIsEOF may block 58572f4 untabify 9cd506f untabify 6673102 Added Down class and improved groupWith fusion 4d73790 export MVar, TVar, and STM non-abstractly As requested by Sterling Clover on ghc-users 131f6db untabify 75d9ecb untabify dd53a79 untabify 64f46cc untabify ed725c0 untabify 0f41ab5 untabify 288d724 untabify 22ab7b5 untabify 1b8dcfa untabify 95d429d untabify 5492860 untabify f2ec55f untabify 8210c67 untabify e05218e untabify 4c61e6f untabify c0e1b8dd untabify f4275e0 untabify 93d0932 untabify 0b0b3ac untabify b7703a4 untabify 475e70a untabify d19e849 untabify 729ebf1 untabify 450f869 untabify 0363aee untabify 1a8a30e System.Console.GetOpt mistakenly rejects options as ambiguous. From "Eelis van der Weegen" . Testcase: 2a4ab8c Add partitionEithers, lefts, and rights. Patch from Russell O'Connor, trac proposal #974. e24f86f Replace (^) with a faster variant (from trac #1687) 13e57e9 An even better definition for (^) (trac #1687) 689ac05 Remove a gratuitous pattern type sig 6de7e26 List extensions used rather than using the -fglasgow-exts hammer 175e045 Move Integer out into its own package We now depend on the new integer package. We also depend on a new ghc-prim package, which has GHC.Prim, GHC.PrimopWrappers, and new modules GHC.Bool and GHC.Generics, containing Bool and Unit/Inl/Inr respectively. b7bd165 base now uses build-type: Configure c6b4079 Remove GHC.PrimopWrappers from base's exposed modules list 3f64040 Update .darcs-boring GHC/Prim.hs, GHC/PrimopWrappers.hs are no longer generated in this package 3aa968c Move Word64/Int64/Word32/Int32 primitives into ghc-prim feb58bb give an absolute path to 'harch' c211150 fix types for __hscore_st_dev() and __hscore_st_ino() 20faa40 Ordering has now moved to ghc-prim 45ba9b2 Turn off the gcd/lcm optimisations for Integer for now This makes it easier to experiment with other implementations 0ac84bf In docs for unsafeCoerce, point to unsafeCoerce# 2d817e6 Spelling only a83c996 Improve docs for unsafeCoerce Make it clear that compilers differ. Point to GHC docs in GHC.Base, and add a short description of nhc98's representation-safe conversions. 75a49cc don't set O_NONBLOCK on FDs passed to fdToHandle 7ae99bb Added emptyP def ad5ffc1 record libraries at haskell.org as maintainer 6e10abd Just (-0/1) is now printed as Just (-0.0), not Just -0.0; trac #2036 50058d5 Add RULES for realToFrac from Int. 9c6794a Add realToFrac RULE comments from patch message into the source code d0f3db8 Reexport (>>>) and (<<<) from Control.Arrow. Preserves API compatibility 0295b0c emptyP def to gHC.PArr d609d67 Moved def. of emptyP a5b73db Inline Data.Bits.rotate at Int, enables rotate to be constant folded e2294ec Add comments about why rotate has an INLINE e6a38b3 Avoid calling varargs functions using the FFI Calling varargs functions is explicitly deprecated according to the FFI specification. It used to work, just about, but it broke with the recent changes to the via-C backend to not use header files. 7d24980 Add a wrapper for mkstemp This is for #2038: macros are used in the Linux .h includes to redirect to a 64-bit version when large file support is enabled. f2e54f5 Add wrappers for [gs]etrlimit This is for #2038: macros are used in the Linux .h includes to redirect to a 64-bit version when large file support is enabled. 0706579 Fix the build on Windows 516e3c1 note about evaluation affecting StableNames 20fb7a8 Tweak the definition of (^) again This fixes trac #2306 (do the minimum number of (*)s), and also means that we don't use the value of (1 :: a) which causes problems if the Num a definition isn't complete. b2cc70e Add 'subsequences' and 'permutations' to Data.List b1a0c72 'subsequences' is now more lazy and also faster 02c91df 'permutations' is now more lazy and also faster 164d14e Support code for quasi-quotation feature 90726a0 Replace TH.Quasi by TH.Quote 11a293d Initial commit; code copied from the base package 2b1bd37 Initial commit of integer(-gmp) package; code copied from base 74e5de4 Fix parsing precedence problem 29c5f2e Add .darcs-boring file 89868b8 Define integerToWord64, word64ToInteger, integerToInt64, int64ToInteger if on a 32-bit machine db7460e Add GHC.IntWord32 and GHC.IntWord64 (from base) 18f5bf9 We can now use Ordering as it's in ghc-prim ae2efae Wibble && definition 5f6b44f Add GHC.Ordering 0f49db3 Add support for Word primitives 32## ec042d3 Initial commit 2f99971 Move the register-inplace special-case stuff into the ghc-prim package 1698be3 Avoid the need for infinite Integers when doing bitwise operations eebd9c7 Make the Integer type components strict a84ba0f Sprinkle on some strictness annotations e0bcb4a Fix ubconfc The current code doesn't seem to be what was used to generate WCsubst.c, so I'm not sure if it never worked, or if my tools work slightly differently to those of the previous user. e1c1482 Update WCsubst.c for Unicode 5.1.0, and add a README.Unicode README.Unicode describes how to do updates in the future. 24afeb6 Fix conversions between Float/Double and simple-integer 6e0d1f0 delete __hscore_{mkstemp,getrlimit,setrlimit} (moved to unix) 6b02395 Avoid using deprecated flags dfaf18f Avoid using deprecated flags 791ad9d Avoid using deprecated flags ee77cc8 Remove -fglasgow-exts from pragmas and comments c2986e0 List exact extensions used rather than using -fglasgow-exts 2533973 We only need -fno-warn-deprecations, not -w b2357b5 Make rename of a SigP fail properly, rather than just being an unhandled case a1a84a2 Make the StringConstr [] case of dataToQa fail rather than be an unhandled case 71da6cd Make the package -Wall clean 0eacb96 Fix #2363: getChar cannot be interrupted with -threaded Now in -threaded mode, instead of just making a blocking call to read(), we call select() first to make sure the read() won't block, and if it would block, then we use threadWaitRead. d27b23c Make the macros in Typeable.h add type signatures 6b5411e Remove code for older GHC versions 746ec49 Add GHC.Exts.maxTupleSize :: Int, the size of the largest tuple supported bfbfaf4 () has moved to ghc-prim:GHC.Unit, and the Eq and Ord instances to Data.Tuple d17038a FIX part of #2301 1b0906e FIX #1198: hWaitForInput on Windows Now we do the appropriate magic in fdReady() to detect when there is real input available, as opposed to uninteresting console events. 9f11776 Make threadWaitRead/threadWaitWrite partially useable on Windows 2a0267a check CONST_SIGINT ab5a660 FIX BUILD (on Windows) 40b8364 Add Control.Exception.blocked :: IO Bool Tells you whether async exceptions are currently blocked or not. 25614e1 forkOS: start the new thread in blocked mode iff the parent was (#1048) This matches the behaviour of forkIO 31c8495 Add threadStatus :: ThreadId -> IO ThreadStatus 23e579e Fix haddocking with older haddocks f185bc5 fix dummy async implementations for non-GHC 59af38f Extend nhc98's Exception type to resemble ghc's more closely c396535 Add instance Show Control.Exception.Exception for nhc98. f3b135c FIX #2376: inline shiftR Duplicating the default definition for shiftR doesn't seem quite right to me, but it gets the right results when compiling the example program, and I couldn't find a better way to do it. 282b3a9 add some big warnings to the docs for unsafeIOToSTM (#2401) a848c50 add comment 80bc85d Use extensible exceptions at the lowest level Everything above is largely unchanged; just the type of catch and throw. 6d87a36 Define nonTermination for the RTS to use We'll probably need to do the same for some other exceptions too 6a58c76 Fix warnings in ghc-prim modules 99ad336 Add GHC.Unit for the definition of the () type 4b835ac Use simpleUserHooks rather than defaultUserHooks in Setup.hs Cabal says that defaultUserHooks is deprecated. 0d62a23 Add a .darcs-boring file f2b1e35 Update .darcs-boring f64ea4a Follow Cabal changes 43e1c29 Follow flag name change 22c37b9 Rejig the extensible exceptions so there is less circular importing 20c837f Start to actually use extensible exceptions a322849 Re-add blocked; it got lost in the extensible exceptions patches c218e2a Fix whitespace The space after "\begin{code}" was confusing haddock 573beb4 Add onException 5a5cb88 Don't use "deriving Typeable" (for portability reasons) de13396 applied patches to make enumFrom and friends strict in arguments as per the Report; closes ticket #1997 514e5b2 Put in some parens to clarify how things parse 4d2b1ea Make numericEnumFrom more efficient b607bdb Comment wibble 87f7be5 TopHandler now uses the new extensible exceptions 3af5a2f Export assertError from Control.Exception to make GHC happy It's a wired-in name in GHC. We should possibly move it to another module. 98e13f5 Don't import Control.Concurrent.MVar in GHC.TopHandler 9bf4914 Reshuffle GHC.Conc/GHC.TopHandler a bit to remove a recursive import 0a713f6 Remove the now-unused GHC/TopHandler.lhs-boot 9753479 Rejig some code so Control.Exception and GHC.Conc don't need recursive imports f33f450 Make some more imports non-recursive e4bbe51 Remove the now-unused GHC/Conc.lhs-boot 81b785a Get rid of some duplicate imports afab0ec Remove unused imports in Control.Exception 3c08fdf Remove unused imports f2bd44a Remove an unused import ed6aac2 Remove the dangerous Exception functions Removed: catchAny, handleAny, ignoreExceptions These make it easy to eat /any/ exception, which is rarely what you want. Normally you either want to: * only catch exceptions in a certain part of the hierarchy, e.g. "file not found", in which case you should only catch exceptions of the appropriate type, or * you want to do some cleanup when an exception happens, and then rethrow the exception, in which case you should use onException, or one of the bracketing functions. 0525d37 Generalise the type of onException The type of the thing to do on an exception is now IO b rather than IO () which better matches functions like bracket. e7e051e Use onException rather than catchAny 8eb40cf Move assertError into GHC.IOBase 0912bae Remove the only import of GHC.Exts 6443137 Remove the duplicate definition of throwTo in Control.Exception It now imports GHC.Conc, so it is no longer necessary 8454033 Windows fixes 860c51c Change some imports and derive Show (Either a b) rather than writing it by hand in GHC.Show faf76d4 nhc98 needs the Prelude for this module d3bafd0 Fix nhc98 code variations to use the extensible exception API. There is still only one real exception type in nhc98, so it is not truly extensible. But this is enough to get the base package building again. f2fff63 zipWithM_ comes from Control.Monad f0e95df poke and peek come from Foreign.Storable c8ab434 make ExitCode an instance of Exception for nhc98 f2198b5 The tuple datatype definitions have moved to ghc-prim 4cf0bb2 Tuple datatypes are now in GHC.Tuple (they were in base:Data.Tuple before) 3ce8614 Remove some unnecessary Data.Tuple imports 1ea665e Generalise the type of mapException; pointed out by Isaac Dupree 7e87e49 Control.Exception doesn't need to export assertError 52a190c Hide standalone deriving clauses from haddock d4ece12 Remove GHC.Dotnet 350c446 Follow tuple datatype movements 4875183 Add a missing case to Show AsyncException 12a50ca Fix warnings 63c69e8 The [] definition has moved to ghc-prim 6588e16 Remove an unnecessary import a9bc61b Move the Char datatype into ghc-prim ad9140e Move some internals around to simplify the import graph a bit c99dd50 Remove the DynIOError constructor of IOErrorType As far as I can see it is never used or exported 13fb5c0 Tweak an import bc3938e Move some bits around to stop Data.Either being in the base import knot b33380b Swap imports around to get GHC.ForeignPtr out of the base knot c580fa7 Remove unused conditional import bc7c503 Fix a couple of imports 2937609 Put some explicit import lists in Data.Typeable a146ed9 Move Int, Float and Double into ghc-prim:GHC.Types d7141f7 Remove an unnecessary import e9ec30f Remove more redundant GHC.Float imports d0ea616 Remove unnecessary Data/Dynamic.hs-boot 8fe9ca2 Import wibbles b296beb Use the proper CInt type in GHC.Unicode d2f58eb Eq and Ord have moved into GHC.Classes 8ccf3c9 fix imports for non-GHC 3b66a65 threadDelay and friends are GHC-only 6579c41 remove kludges, now that Control.Exception is imported ec16083 split most of Control.Exception into new Control.Exception.Base 4474018 Hugs only: don't import exception types -- their instances are now in Control.Exception.Base 879807f bump to version 4.0 f072514 Move the [] definition from base into ghc-prim:GHC.Types 95f9739 Move the Char datatype into ghc-prim 44560f9 Add some GHC.Generics imports so we can find Inl etc where we need to 7faadaf Move Int, Float and Double into ghc-prim:GHC.Types f14420b add Control.Exception.Base to nhc98 build 3ae7e85 non-GHC: hide Prelude.catch 591b39f Hugs only: fix imports ebce15a use dummy implementation of timeout for all non-GHCs 569e88b export Control.Exception.Base f47de96 use the Haskell 98 module Control.Exception.Base in the Concurrent modules 2319319 use New.catch instead of catchException in OldException ea52fdb Must import ExitCode for its instance to be re-exported. The Cabal library depends on "instance Exception ExitCode", and expects to import it from Control.Exception, not Control.Exception.Base. 31215fe No reason for Handler and catches to exclude nhc98. 5ebd066 remove returns from void functions b8a8325 simplify definition of Prelude.catch 9b6b729 add Traversable generalizations of mapAccumL and mapAccumR (#2461) 8d771a4 Control.OldException: Map exceptions to old exceptions and back properly. * Control.OldException: Map exceptions to old exceptions and back properly. 5691448 Eliminate orphan rules and instances in the array package 4975be7 Fix oversight in Control.OldException The NonTermination constructor slipped through in the Exception instance. 9a7b324 Fix hReady (trac #1063) We now throw an EOF exception when appropriate a54da06 nhc only: expose Foldable and Traversable instances of Array a4088f2 Rewrite the documentation for forkOS again Try to make it clearer that forkOS is only necessary when calling foreing libraries that use thread-local state, and it has nothing to do with scheduling behaviour between Haskell threads. I also added something about the performance impact of forkOS, and mentioned that the main thread is a bound thread. f1f0f17 remove __hscore_renameFile, it is no longer uesd System.Directory implements renameFile using unix/Win32 now. e2a79c3 remove some functions that aren't used in base 48612e5 Ignore some orphan warnings cff5e3c Fix some more warnings 8c1cb53 Fix warnings in Data.Generics.* f9b2d39 Fix more warnings f050ec4 Suppress a couple of warnings in GHC.PArr The fix isn't immediately obvious to me 18328c7 Fix more warnings 094430f Provide blockedOnDeadMVar, blockedIndefinitely for the RTS 877f6ac Suppress some warnings that are hard to fix because of ifdefs 3968fbf Fix Windows-only warnings in GHC.Conc 7166d89 Fix Windows-only warnings 75097ac Remove ST stuff that is now in the new st package 1943bef Split getopt off into its own package 8beae42 Split off the concurrent hierarchy (concurrent, unique, timeout) 39711a3 Windows-only fixes for moving concurrent out of base dccaa13 Fix warnings in PrelIOUtils.c 70b971f add extra-source-files field 67dfc3e Split syb off into its own package I've also moved the Data (Complex a) instance into it, and made it portable rather than GHC-only in the process. 6085e27 getopt is no longer part of base 0af78f5 System.Timeout is no longer part of base 0ad9def #2528: reverse the order of args to (==) in nubBy to match nub This only makes a difference when the (==) definition is not reflexive, but strictly speaking it does violate the report definition of nubBy, so we should fix it. 83092ca docs: mention that killThread on a completed thread is a no-op 306b3f8 non-GHC: add Typeable instance for ForeignPtr ab3e00c non-GHC: leave out Belch functions 5994604 avoid relying on the implementation of SomeException a0bd245 add include/CTypes.h to extra-source-files a7b8c05 Don't look for actual OldException.Exception exceptions We don't actually throw them (we throw the new Exception equivalents instead), and looking for them was causing an infinite loop e8a0e61 make Typeable instances for larger tuples available to non-GHC 8d4f8b8 remove 'pure' method from Arrow class (#2517) 96c6210 Remerge concurrent,unique,timeout,st,getopt into base 672a5a9 Add missing files 2e383b7 Don't make S_ISSOCK use conditional We were conditionally defining the C wrapper, but unconditionally using it. So if it didn't exist then things would have broken anyway. 67a0e66 Unbreak the GHC build with older versions of gcc Patch from kili at outback.escape.de, who says: Stg.h must be included before HsBase.h, because the latter contains function definitions causing older versions of gcc (3.3.5 in my case) to bail out with "error: global register variable follows a function definition" on Regs.h, which is included by Stg.h. 51bd513 Don't define __hscore_s_issock on Windows ee17e68 Generic functions that take integral arguments should work the same way as their prelude counterparts b100e76 Add a dep on syb ba950c6 Help haddock find ghc-prim's types by explicitly exporting them f338f43 In Setup, tell haddock about GHC.Prim 73cec9f We should be including Rts.h here, not Stg.h Stg.h is for .hc files only, and it sets up various global register variables. 9ac2a78 Fix bugs in Text.Printf (#1548) e3a8052 Fix compilation of Setup.hs with GHC 6.9 4e430ea In nhc98, Word is a type synonym, so class instance is not possible. c70bcab Pad version number to 4.0.0.0 aafb9bb Pad version number to 0.1.0.0 bcd82a7 Pad version number to 0.1.0.0 0d05991 Bump version number to 2.3.0.0 e921297 Restore the Haskell 98 behaviour of Show Ratio (#1920) b130868 Move the Integer type definition into GHC.Integer.Internals This means that we can export the constructors, but still keep the GHC.Integer interface generic. 4ae7c07 Don't use ^(2::Int) in Data.Complex.magnitude; partially fixes trac #2450 We still might want to make a RULE for this, so the bug is not fully fixed. d2f13aa update Data.Generics import e2c964b restore Complex's derived Data instance 73c5dd0 add new Data.Data module 815cbac added new module Data.Data 86e089b Add build-depends: rts for correct dynamic library linking 4d07ded eliminate dependency on syb df6626f non-GHC: delete unnecessary imports ba37236 removed (->) instance from Data.Data 3a6ee49 add readTVarIO :: TVar a -> IO a 1040756 changing haddock links de659cd add link to the new syb wiki f2b608c Import n_capabilities via import symbol when linking dynamically 2f27767 docs about how exceptions are handled by forkIO'd threads (#2651) c42736c Fix Trac #2700: pretty-printing of types e38db62 Make NameFlavour have a full Data instance so annotations can deserialize it 1b1a4ac Add AnnotationWrapper type so GHC can capture annotation dictionaries during compilation 51ac30e FIX #2722: update RULES for the Category/Arrow split 80ce119 add GHC.Conc.runSparks (required by GHC patch "Run sparks in batches") 877f16b updating Haddock documentation 3a4810c Fix the definitions of trueName and falseName 8fc45a4 Change an "undefined" into a more informative error; trac #2782 134633c re-instate the gcd/Integer and lcm/Integer RULES Fixes a performance regression between 6.8.3 and 6.10.1 33ec542 Add more description of what "round" does, from the H98 report c05b2a3 Fix performance regression in quotRemInteger/divModInteger This fixes most of the performance regression in these functions between 6.8.3 and 6.10.1, it was due to a slight difference in the strictness between the old and new versions (see comments for details). There's still a few percent loss in performance in the div test in nofib/spectral/integer that I haven't tracked down as yet. c09e4ae Fix typo (or out of date reference) in throwTo documentation. 5591c2b Fix #2750: change Prelude.(,) to Prelude.(,,) 64d5fe1 Update INLINE pragmas for new INLINE story dc746ab Fix #2760: deprecate mkNorepType, add mkNoRepType 06e60f3 FIX #1364: added support for C finalizers that run as soon as the value is no longer reachable. 5a70e93 Rollback INLINE patches 6279bfa warning fix: don't use -XPatternSignatures in GHC >= 6.10 64bafed extra dependencies for the new build system f54b22b More compact error messages for record selectors a1ec510 Fix typo (reqwests -> requests); trac #2908, spotted by bancroft 8f32298 Add errno to the IOError type 2bd42c4 Fix the build on Windows c66815c Fix build when we have HTYPE_TCFLAG_T 1f1c03c #2699: exit silently for EPIPE on stdout 04770e8 Add NoImplicitPrelude to the extensions used when building with GHC 4808212 Move some catch definitions around to avoid an import loop As suggested by simonpj in trac #2822. 8e2a7b7 make the Monoid docs more self-contained d49ea2e Unbreak an import cycle caused by moving 'catch' definitions around. The new cycle was introduced for nhc98 only. ed1a8c2 add Monoid laws 09cc855 Make Data.Typeable imports and exports more explicit 7dd8652 avoid `mappend` in monoid laws, because it doesn't work with haddock 8224df6 Correct SYB's representation of Char f63fe36 optionally include GHC.Prim in exposed-modules (for the new GHC build system) 4940d17 Fix #2759: add mkRealConstr and mkIntegralConstr, deprecate mkFloatConstr and mkIntConstr f4fb75b Proposal #2875: remove StringRep and StringConstr 3f81b2d #2875: Correct SYB's representation of Char e21b1cc Add "bug-reports" and "source-repository" info to the Cabal file 99c71c3 Add "bug-reports" and "source-repository" info to the Cabal file 8cf662a Add "bug-reports" and "source-repository" info to the Cabal file fc6ae58 Add "bug-reports" and "source-repository" info to the Cabal file Also switched to the modern Cabal file format e3b05c3 Require Cabal version >= 1.6 c9dd0a0 get unsafePerformIO from a documented location 7850ab9 Require Cabal version >= 1.6 e910522 Require Cabal version >= 1.6 e941801 Require Cabal version >= 1.6 d4a67c3 Update the Exception docs 0be55bd OldException catches unknown exceptions as DynException It's important that we put all exceptions into the old Exception type somehow, or throwing a new exception wouldn't cause the cleanup code for bracket, finally etc to happen. ea0dd25 Fix #2903: ensure CWStringLen contains the length of the array rather than the String 261f56f Make System.Posix.Internals buildable by nhc98. 2fc5d82 implement System.IO.Error more fully for nhc98 4f1b447 add some rules of thumb for catching exceptions, restructure the docs a bit 6ae4c49 Fix #2971: we had lost the non-blocking flag on Handles created by openFile This code is a mess, fortunately the new IO library cleans it up. 1d266a9 Rewrite of signal-handling (base patch; see also ghc and unix patches) 3c642ac Set the IO manager pipe descriptors to FD_CLOEXEC This pipe is an internal implementation detail, we don't really want it to be exposed. 27df316 ifdef out the syncIOManager export on Windows; fixes the build eac3bc6 Fix warnings: put imports inside ifdefs 19b8cab ifdef out the definition of setCloseOnExec on Windows; fixes the build c15e830 #2759: Amend previous patch e86bc10 Rules to make genericLength strict for Int/Integer lengths, see #2962 68cf5b0 Don't hide GHC.Integer from haddock; fixes trac #2839 This works around haddock not exporting docs across package boundaries a1adf4c FIX #2189: re-enabled cooked mode for Console-connected Handles on Windows Patch from Sigbjorn Finne 258be3d add final newline; fix build (on Windows?) c751ba5 Add config.guess, config.sub and install-sh 7fc5bad Partial fix for #2917 97ca06f avoid a space leak building up in the "prodding" IORef (part of #2992) 40ad6ff FIX #2189: re-enabled cooked mode for Console-connected Handles on Windows Patch from Sigbjorn Finne 5b413a6 Don't set -Wall -Werror in the .cabal file db1fe7e Fix layout to comply with H'98. Also, configure correctly for nhc98, to avoid win32 code. 4715e3d ghcconfig.h is __GLASGOW_HASKELL__ only 2d75b36 Added type family declarations forms - Adds type family and instance declarations, both on the top level and as associated types - No equality constraints yet 36bf9a5 Adding equality constraints - This patch adds equality constraints - This requires an incompatible change of the type TH.Cxt - hence: 66d3f4c Add an import needed in the new build system 05ee08c Remove some redundant fromInteger's ce8f519 Added INLINE and SPECIALISE pragmas as declaration forms 4b84d6d Template Haskell: kind annotations - Kind annotations at variables in type declarations - Kind signatures in types 5429c33 Added bang patterns 8962241 Add another Data.List.intersect example from Christian Maeder cebb0b8 Avoid unnecessarily using Integer when decoding Floats 76fc3e3 be sure to install Nhc98BaseConfig.h 4ad4fcc Don't inline unpackCString e3abe55 Import GHC.Err so we see bottoming functions properly 59a4969 Don't inline enumDeltaToInteger until its rules have had a chance to fire b12c687 Fix QSem and QSemN: Initial amount must be non-negative 534875d FIX #3171: make sure we have only one table of signal handlers 3a8892c Use a bang pattern when we where/let-bind values with unlifted types eae9587 Use a bang pattern when we where/let-bind values with unlifted types 3050a63 Add more bang patterns, needed to fix the 32bit build 89f7400 Add wrappers around fcntl We need to do this as it has a (, ...) type, which we aren't allowed to directly call with the FFI. 925de5d remove msvcrt and kernel32 from extra-libraries 603dc2c add _O_NOINHERIT when opening files on Windows (see #2650) f7aba142 Document that the initial quantity for QSem and QSemN must be >= 0 3b73807 Fix warnings d93422a Increase the version number to that in the 6.10 branch b4a6381 Add liftString, to match the "improve lifting for strings" patch in the compiler c40a70c Fix #3257: document that exitWith in a forkIO'd thread does not exit the process ac45944 Make two type defaults explicit d7940ee Fix validate (on Windows) f06ff78 Add missing -XTypeOperators 84aff67 Remove the unused decodeFloatInteger 7892f2f Remove unnecessary parens 247de6b nhc98 must build dirUtils.c as well. Fixes this bootstrapping error: Undefined symbols: "___hscore_readdir", referenced from: _FR_System_46Posix_46Internals_46readdir_35 in libHSbase.a(Internals.o) ea7e893 Add __encodeDouble and __encodeFloat Moved here from the rts. 16f5710 Remove unused foreign imports of __encodeFloat/Double 10b4734 abstractify ModName, PkgName and OccName; drop dependency on packedstring 7b067f2 Rewrite of the IO library, including Unicode support 7834fd6 Add iconv as an extra library on platform that need to link with it For example, we need -liconv on OS X. 7f97d9d Allow System.Posix.Internals to compile with nhc98 again. Also affects GHC.IO.Device, which is not very GHC-specific at all. bbbf03e Fix #3128: file descriptor leak when hClose fails 1e74d27 Save and restore the codec state when re-decoding d273fbc Fix warnings in C programs generated by configure; fixes failures with -Werror 5abf6bc Fix warnings in configure script 0f859f0 The IO type has moved to GHC.Types in ghc-prim 86b3b70 Redefine gcdInt to use gcdInteger rather than gcdInt# primop The gcdInt# primop uses gmp internally, even though the interface is just Int#. Since we want to get gmp out of the rts we cannot keep gcdInt#, however it's also a bit odd for the integer package to export something that doesn't actually use Integer in its interface. Using gcdInteger is still not terribly satisfactory aesthetically. However in the short-term it works and it is no slower since gcdInteger calls gcdInt# for the special case of two small Integers. 68e2d96 Implement the gmp primops in the integer-gmp package using cmm 8294eb6 Tweak the small integer case of gcdInteger for better optimisation The gcdInt function in the base package now calls gcdInteger with two small integers. With this weak, the optimiser generates a base gcdInt that directly calls the gcdInt# primop from this package. This means there should be no additional overhead compared to when the base gcdInt called the gcdInt# primop directly. 116fd1f Add a configure script and rely on local definitions of derived constants 060251c Move gmp to here, from the GHC repo 64bcc31 Add a GHC.Debug module, with debugLn :: [Char] -> IO () 0c829ca The IO type has moved to GHC.Types in ghc-prim d8cc29c Remove the Integer functions; they're now in integer-gmp instead 819ff42 Move the int64 conversion functions here, from ghc-prim ce8b9e1 Fixes for building on machines that don't have gmp bba3952 Remove old Integer prototypes 81217a9 Don't put "extra-libraries: gmp" in the cabal file; it comes from the buildinfo file 28d1321 Remove AC_C_CONST It was breaking the build on Windows. The problem was that we included stdio.h which gave a prototype for some functions (e.g. remove), then the AC_C_CONST meant that we did /* Define to empty if `const' does not conform to ANSI C. */ #define const /**/ and then we included io.h which gave prototypes that, due to const being removed, conflicted with the earlier prototypes. 4a35e26 Improve the configure script 585f14e Make configure fail if deriving the constants fails ee93754 gmp build tweaks 82427f5 Unconditionally make a (Show Ptr) instance It used to only exist if (WORD_SIZE_IN_BITS == 32 || WORD_SIZE_IN_BITS == 64) 772a168 Add a comment to remind us that memcpy_src_off is used by dph 2e7e5a3 Windows: Unicode openFile and stat functions cfc1d39 Patch GMP to always use the GHC allocation functions This works around a crash (only on OS X for some reason?) where the GHCi GMP uses the systems memory allocator. We should fix this properly, by making ghci run constructor functions. 14a5ed1 Make this file independent of HsBase.h, use HsBaseConfig.h only 7f3e271 Tidy up use of read/write/recv/send; avoid unnecessary wrappers 331047f don't include config.mk if we're cleaning 5aa24b2 Make this package now really integer-gmp, rather than pretending it's integer 7975b3a fix bug in partial writes 82ea26e add hFlushAll, flushes both read and write buffers cdd8efa fix the dependencies on GmpDerivedConstants.h when HaveLibGmp==YES 77bdf4d Call nl_langinfo(CODESET) to get the name of the locale encoding on Unix fe11112 setNonBlockingMode now takes a flag, can turn blocking mode back on again 6664b78 Fix iconv detection on OpenBSD Matthias Kilian discovered that iconv_open is #define'd to something else on OpenBSD, so the test needs to include the iconv header. 6879b31 fix build failure on Windows 0c29bd3 not having iconv is not fatal on Windows 44f5e8e fix the windows build even more f1c161e Move directory-related stuff to the unix package now that it isn't used on Windows any more. e5c2417 Fix the case of HaveFrameworkGMP values 63b433a Check for whether we have gmp.h, as well as whether we have the gmp library a8da923 set binary mode for existing FDs on Windows (fixes some GHCi test failures) 9416fb7 #include if we have it (should fix build problems) c5692da Add a wrapper for libiconv. ff79ef5 avoid a warning 818e4ab a byte between 0x80 and 0xBF is illegal immediately (#3341) 63128a7 Don't export CLDouble for GHC; fixes trac #2793 We never really supported CLDouble (it was a plain old double underneath), and pretending that we do does more harm than good. 942281f Add 'eof' to Text.ParserCombinators.ReadP 63a241d Remove some cruft from Data.HashTable dbb6d84 Use the result of writeCharBuf c84bffd Remove unused imports from base 244350c fix mk/build.mk for HaveLibGmp/HaveFrameworkGMP Previously if you were to set HaveFrameworkGMP/HaveLibGmp in mk/build.mk (e.g. on mac os) the settings would be ignored, as gmp/config.mk is included late in GHC's ghc.mk, meaning autoconf overrides your settings. Now they ignore the values picked up by configure if you set these variables. 7c97c89 Remove unused imports 48ba358 Remove unused imports 201a288 Add back imports needed on Windows d521a6a Fix "warn-unused-do-bind" warnings where we really do want to ignore the result e6b1fc6 Fix "warn-unused-do-bind" warnings in System.Posix.Internals 3ef577a Fix "warn-unused-do-bind" warning in GHC.Conc If we fail to communicate with the IO manager then we print a warning using debugErrLn from the ghc-prim package. 95f71e7 Minor code tidyups in GHC.Conc 4f1f969 Use the result of writeCharBuf in GHC/IO/Encoding/Latin1.hs too f1c7f5b Fix some "warn-unused-do-bind" warnings where we just want to ignore the result 313263a Fix "warn-unused-do-bind" warnings in GHC/IO/Handle/Text.hs 5480a97 Minor SampleVar refactoring 1b12b2e Fix some "warn-unused-do-bind" warnings where we want to ignore the value 28056bd GHC.Conc.reportError now returns IO () It used to return IO a, by "return undefined". 63263ed reportStackOverflow now returns IO () It used to do "return undefined" to return IO a. fb13a2a Remove an unused import 1274496 Use throwErrnoIfMinus1_ when calling getrusage c23bcae Fix some "warn-unused-do-bind" warnings where we want to ignore the value c344229 Fix build on Windows 3d5794a add a comment about the non-workingness of CHARBUF_UTF16 43c7f11 Add a debugErrLn function, which is like debugLn except it prints to stderr 6bc00b2 Export Unicode and newline functionality from System.IO; update Haddock docs ecfac87 Add the utf8_bom codec as suggested during the discussion on the libraries list. 33209d5 Add more documentation to mkTextEncoding noting that "//IGNORE" and "//TRANSLIT" suffixes can be used with GNU iconv. 07c5532 Add hGetEncoding :: Handle -> IO (Maybe TextEncoding) as suggested during the discussion on the libraries list b6c2447 warning fix: -fno-implicit-prelude -> -XNoImplicitPrelude 9d3a7e4 remove unused warning f20d8c1 Add GmpDerivedConstants.h dependencies for all ways, not just vanilla 1ea44d1 Make chr say what its argument was, if it's a bad argument 5099abf Improve the index checking for array accesses; fixes #2120 #2669 As well as checking that offset we are reading is actually inside the array, we now also check that it is "in range" as defined by the Ix instance. This fixes confusing behaviour (#2120) and improves some error messages (#2669). c6214d4 move "instance Exception Dynamic" so it isn't an orphan fd5e28c Move the instances of Functor and Monad IO to GHC.Base, to avoid orphans f6a645e depend directly on integer-gmp, rather than indirecting through integer 7d28e54 Make integer-gmp suitable to be used directly, rather than via integer 6679d2c Whitespace only, in gmp-wrappers.cmm 3ee11c4 Remove unused stack variable 50d0195 Use shift[LR]Integer in the Bits Integer instance 14ca574 Add integer-simple as a build option 8325cd8 Add primops for shifting 12e1e1f Follow changes in GHC and the other libraries a63b16e () is now available, so use that instead of our own a7e4d79 Add an import so the deps get sorted out correctly cfe2b67 Add NoImplicitPrelude to the extensions used 44dc3ef Fix GC annotations in GMP_TAKE1_UL1_RET1() 65f42eb Update to follow RTS tidyp changes 47b0050 fix conditionals (prevents GMP always being built) 82b3b2a Update to follow RTS tidyp changes 5f54b85 Updates to follow the RTS tidyup C functions like isDoubleNaN moved here (primFloat.c) 356f414 Windows build fix, following RTS tidyup bcbe9e7 Deprecate Control.OldException ed6de50 Tweak the BufferedIO class to enable a memory-mapped file implementation We have to eliminate the assumption that an empty write buffer can be constructed by setting the buffer pointers to zero: this isn't necessarily the case when the buffer corresponds to a memory-mapped file, or other in-memory device implementation. cc81cb8 fix a copyright 32ed9c8 add INLINE toList 23a7746 Fixing configure for autoconf 2.64 2e1f145 Add some more C wrappers; patch from Krister Walfridsson Fixes 21 testsuite errors on NetBSD 5.99. 3744427 Apply proposal #3393 Add openTempFileWithDefaultPermissions and openBinaryTempFileWithDefaultPermissions. 57fea45 Add a GHC.Constants module; fixes trac #3094 97f3d01 Add a doc header to GHC.Types, and point at GHC.Exts 7a3b850 Fix "Cabal check" warnings 6401664 Fix "Cabal check" warnings 1d08e94 improvements to Data.Fixed: instances for Typeable and Data, more predefined types bf2f7ce Document 'CompE' better (see Trac #3395) 2da4486 Apply fix for #1548, from squadette at gmail.com 32f868b un-hide some modules from the Haddock docs 8537662 typo in comment a05ddfe Allow for configurable iconv include and library locations. This should help to fix the build on OpenBSD. 0bb639d fix debugging code bc41c09 Fix hWaitForInput It was erroneously waiting when there were bytes to decode waiting in the byte buffer. b98015a Fix #3441: detect errors in partial sequences 7ac406c Fix unicode conversion for MSB architectures This fixes the SPARC/Solaris build. a5e2fa9 Address #3310 92c7985 Bump base version to 4.2.0.0 bf7ad38 Fix "init" docs: the input list need not be finite. Fixes trac #3465 b63b596 On Windows, use the console code page for text file encoding/decoding. 9563eea make some Applicative functions into methods, and split off Data.Functor (proposal #3335) 970816a Use let !y = x in .. x .. instead of seq in $! and evaluate (#2273) 8dad51b Use CONF_CC_OPTS - Needed to get arch-dependent options, eg, on Snow Leopard 5b5e5b7 Fix #3534: No need to flush the byte buffer when setting binary mode 81c87ee Fix the error message when flushing the read buffer of a non-seekable Handle 612db02 Add traceEvent :: String -> IO () For emitting an event via the RTS tracing framework 3c87dfe Strip any Byte Order Mark (BOM) from the front of decoded streams. When decoding to UTF-32, Solaris iconv inserts a BOM at the front of the stream, but Linux iconv doesn't. ad96a22 use UTF32BE/UTF32LE instead of UCS-4/UCS-4LE 7f5e473 Strip any Byte Order Mark (BOM) from the front of decoded streams. When decoding to UTF-32, Solaris iconv inserts a BOM at the front of the stream, but Linux iconv doesn't. ef624c4 Use UTF-32LE instead of UTF32LE The latter is not recognised by some iconv implementations. 3951112 Fix gratuitous breakage for non-GHC in Data.Bits. 1748fa8 Fix gratuitous breakage of non-GHC in Data.Fixed. 1fcc5c8 Fix gratuitous breakage of nhc98 in Control.Exception.Base. 8a7745d Fix gratuitous breakage of nhc98 in System.IO. fdc271f Cope with nhc98's (occasionally-strange) import semantics. c3b8a74 Make Data.Functor compatible with non-GHC compilers. 9590147 Another instance of nhc98's strange import semantics. dfad393 It seems that nhc98 needs defaulting in Data.Fixed. 894d7fe Roll back "Cope with nhc98's (occasionally-strange) import semantics" Fri Oct 9 14:43:51 BST 2009 Malcolm.Wallace at cs.york.ac.uk GHC (correctly) warns about the unused import, which breaks the validate build. 2fa71f7 Roll back "Another instance of nhc98's strange import semantics." Fri Oct 9 14:50:51 BST 2009 Malcolm.Wallace at cs.york.ac.uk GHC (correctly) warns about the unused import, which breaks the validate build. 188bff7 Re-instate System.Console.Getopt for nhc98 builds. Although it was split out of base a while back, that change was reverted for ghc soon afterwards, but nhc98 never noticed. 23c183b Make hGetContents throw an exception if an error is encountered 1895485 dirUtils.c no longer available 381f8a8 Inline foldr and (.) when applied to two arguments not three 763bea6 Tidy up and comment imports 5a1ec04 Exploit now-working default-method INLINE pragmas for Data.Bits 1d6de5f Move error messages out of INLINEd default methods 00c66fe Inline more default methods 8d0eda2 Don't inline unpackFoldrCString ever 07bbc8c improve the documentation for throwErrnoIfRetry 23939c6 Fix #1185: restart the IO manager after fork() d9b3261 Fix the build on Windows 429156a Rollback #1185 fix e5b04f8 Second attempt to fix #1185 (forkProcess and -threaded) 23a2c67 Remove ffi warnings for nhc98. 99ead68 Move Eq/Ord Ordering instances to de-orphan them 08c5e81 De-orphan the Eq/Ord Bool instances b7d693c De-orphan the Eq/Ord Char instances 20d77cb De-orphan the Eq/Ord [a] instances c677ed0 Rearrange the contents of Control.Monad.ST; no functionality changes 606ef3a De-orphan the MonadFix ST instance for GHC 0739342 Control.Exception.Base no longer has any orphans b3a0d27 De-orphan tuple Eq/Ord instances d39fcd7 We can now derive Ord () 62e84a9 Derive some more instances, rather than writing them by hand 468595e Whitespace only d6f29a0 De-orphan the Eq/Ord Integer instances 78217b0 Remove an old comment 450bac6 Make sure zipWithFB has arity 2 c3f0928 Tweak layout to be accepted by the alternative layout rul b0b39d7 Tweak layout to work with alternative layout rule 07061cc Remove an unnecessary -fno-warn-orphans flag 46629f2 Fix arities of mapFB and zipFB f4b76d3 hGetContents: close the handle properly on error 524d844 check for size < 0 in mallocForeignPtrBytes and friends (#3514) 0e0130b x86_64 requires more stack 8c44eab fix the docs regarding finalizer guarantees 07f3840 Data.Either.partitionEithers was insufficiently lazy. Spotted by Daniel Fischer. 238b0d4 Add comments to "OPTIONS_GHC -fno-warn-orphans" pragmas 21b0ea0 De-orphan Eq/Ord Float/Double 8a4aa09 Comment the remaining orphan instance modules 6103a09 Mark 'index' as INLINE in GHC.Arr 0dd0cce Fix Trac #3245: memoising typeOf b6b3de1 Add comments about double bounds-checking, and fast paths for rectangular arrays 8b3a3db Restore previous Data.Typeable.typeOf*Default implementations for non-ghc. Not all compilers have ScopedTypeVariables. b48b19b Replace the implementation of mergesort with a 2x faster one. See ticket http://hackage.haskell.org/trac/ghc/ticket/2143. a8d9dc1 Control.Monad: +void :: f a -> f () See http://hackage.haskell.org/trac/ghc/ticket/3292 Turns m a -> m (). Lets one call functions for their side-effects without having to get rid of their return values with '>> return ()'. Very useful in many contexts (parsing, IO etc.); particularly good for 'forkIO' and 'forM_', as they demand return types of 'IO ()' though most interesting IO functions return non-(). c2507dd hIsEOF: don't do any decoding (#3808) 0dd5ade Fix the build: export void, so it doesn't give an unused binding warning a9db92b fix #3832: use the locale encoding in openTempFile Also while I was here fix an XXX: the Handle contained an uninformative string like for error messages rather than the real file path. c9de89a Stifle warning about unused return value 59252fb For nhc98, import unsafeInterleaveIO rather than defining it here. b7212fa Handle NaN, -Infinity and Infinity in the toRational for Float/Double (#3676) b166de1 Update the exitWith docs Error pointed out by Volker Wysk 8ff7031 nhc98 should build Data.Functor. 9699809 Put the complexity in the length docs. Fixes trac #3680 cba34d6 UNDO: Handle NaN, -Infinity and Infinity in the toRational for Float/Double (#3676) c77631a FIX #3866: improve documentation of Data.Data.Constr 4cd0295 Plug two race conditions that could lead to deadlocks in the IO manager da9c3f7 Documentation fixes in Control.Exception f73dee6 Fixed dead links in documentation of forkIO 522a41a Tweak docs 843fd34 change to use STM, fixing 4 things 1. there was no async exception protection 2. there was a space leak (now new value is strict) 3. using atomicModifyIORef would be slightly quicker, but can suffer from adverse scheduling issues (see #3838) 4. also, the STM version is faster. f513faee1 Write the thunk 'next' to the MVar 3a6a033 Fix bugs regarding asynchronous exceptions and laziness in Control.Concurrent.SampleVar - Block asynchronous exceptions at the right places - Force thunks before putting them in a MVar 05c9b24 Make SampleVar an abstract newtype fe89270 fix the deprecation message (GHC.IO.Handle.Base -> GHC.IO.Handle) 2f25bea runInUnboundThread: block asynchronous exceptions before installing exception handler 416bddb withThread: block asynchronous exceptions before installing exception handler. Note that I don't unblock the given io computation. Because AFAICS withThread is only called with 'waitFd' which only performs an FFI call which can't receive asynchronous exceptions anyway. cb1ec67 remove old/wrong comment d5dff95 Tiny code tidy-up a414415 Fix bitrot in IO debugging code Also switched to using Haskell Bools (rather than CPP) to en/disable it, so it shouldn't break again in the future. 6445963 Ignore the return code of c_fcntl_write again 8095608 Move comment closer to the offending line 98aeee2 INLINE alloca and malloc See discussion on glasgow-haskell-users: http://www.haskell.org/pipermail/glasgow-haskell-users/2010-April/018740.html bcf26f5 add NOINLINE pragmas for stdin/stdout/stderr 2ff3230 raise asynchronous exceptions asynchronously (#3997) 9a36403 inline allocaArray0, to fix withCString benchmark 092c0cf Add swap (#3298) 1428e6e Add hGetBufSome, like hGetBuf but can return short reads df963fc add Typeable instance fb2c023 elaborate the docs for unsafePerformIO a bit 4922f39 improve the documentation for throwTo and killThread (#3884) 77dcfa5 Fix for hGetBufSome 39aa14d Correct haddock formatting. 38e98e3 hSetEncoding: change the encoding on both read and write sides (#4066) 7eaf04a hWaitForInput: don't try to read from the device (#4078) readTextDeviceNonBlocking is not non-blocking on Windows bb6c2ee export hGetBufSome (#4046) 24265cd fix syntax in doc comments 3b4000f doc comment illustrating Foldable(foldr) 855b6c7 expand Foldable instance for Array ecff886 Added Applicative and Alternative instances for STM 74e75a2 Moved MonadPlus instance for STM from Control.Monad.STM to GHC.Conc to avoid an orphaned instance 808665a bump version to 4.3.0.0, added instance MonadPlus STM 2429795 Don't depend on Prelude (#4123) 7e991e1 don't depend on Prelude (#4122) f3bbb89 docs: note that hGetBufNonBlocking isn't non-blocking on Windows 0771aab Add a note about the interruptibility of throwTo. 264ffc7 Use libcharset instead of nl_langinfo(CODESET) if possible. c9bb622 add Applicative instance for Either (proposal #4095) 5dd5a90 Don't define the C localeEncoding on Windows (it causes warnings, and isn't used) 95ff509 add an INLINE to the list version of traverse, to enable fusion 37fa6df remove extraneous info from docs for Array bd2d802 add doc for the ExitCode type c4228db nit in docs for accumArray 2d6a2e0 make the hGetBuf/hPutBuf family work with non-FD Handles (#4144) fc5566b fix docs for isSpace 02d543a correct docs for exitWith: only stdout/stderr are flushed, not all Handles 039b6e1 Give nub's complexity in the haddock docs; fixes #4086 aeb0696 Fix haddock formatting 0506438 doc wibbles 035b627 doc wibble 23e8914 doc updates in System.IO 0d6d3b3 doc wibble da43f48 move the doc for 'Char' to its new home in ghc-prim:GHC.Types bdfebf2 doc whitespace f9a9ace doc wibble: nonstrict -> non-strict 8fb7b12 doc wibble: remove confusing mention of "Prelude" 56f36a9 use '==' consistently rather than '->' in examples 2c4faf5 Haddock hacks to fix whitespace consistency 8496a88 doc typo 97545f7 doc wibble: Haskell 98 I/O Error -> 'IOError' d4fc1d7 doc typo a879e42 doc typo 485a489 doc typo e88be24 peekArray docs: remove mentions of "this version" and "previous version" b6dca0e doc typo 207a6a6 extract information about Data.Time from docs for CTime 5f0bcba unqualify Float and Double d770bc0 docs: unqualify Prelude.IO 7cd4211 remove docs from Monad that belonged on the instance for MonadPlus IO fd70fba Fix a few places where we forgot to close the text codecs (#4029) Each time you invoke :load in GHCi it resets the CAFs, including stdin/stdout/stderr, and each of these was allocating a new iconv_t. 23d79ef Async-exception safety, and avoid space leaks Patch submitted by: Bas van Dijk Modified slightly by me to remove non-functional changes. 3ae2fa0 Async-exception safety, and avoid space leaks Patch submitted by: Bas van Dijk Modified slightly by me to remove non-functional changes. 7315707 New asynchronous exception control API (base parts) d328fb6 Allow nhc98 to cope with recent changes to Control.Exception. 4ed43d3 Remove duplicated word in documentation a2d8cd7 Fix typo in documentation 564d00c Partial fix for Trac #4136 2f788c9 mention that IntPtr and WordPtr can be marshalled to/from intptr_t and uintptr_t 5e2ec13 add cast{C,U}CharToChar and castCharTo{C,U}Char, from Haskell 2010 e4a66c6 note shortcutting behaviour of any/all/elem 90067a6 clarify meaning of bit e2fcaf0 doc: use "finalizer" consistently fac2960 document exception-overriding behaviour in withFile 941c197 add module intro from Haskell 2010 80d8b2f doc formatting fix 73bd02b docs: mention that Foreign.unsafePerformIO is deprecated We can't actually deprecate it without introducing a name clash between Foreign.unsafePerformIO and System.IO.Unsafe.unsafePerformIO 175e795 add unsafeLocalState from Haskell 2010, and docs 5a9bd2b add numSparks :: IO Int (#4167) 4c45d8f Remove egregious ghc-ish from Foreign.Marshal 6583bc7 move Monad and MonadFix instances for Either from mtl (proposal #4159) 41fe4e3 Add mfilter to Control.Monad bae5886 Bump version to 0.2.0.0 f4acc35 Bump version to 0.2.0.0 5cc558c Pad version to 0.1.0.0 d1c396b Set the path to nm before configuring the C gmp lib 6b3eea4 Fix Trac #3572 (pls merge) f8fe4fd Fix pretty-printing of INLINE pragmas 659ca88 Windows DLLs: Tag imported gmp symbols with the package they're from. 33a319e Add new GHC.Magic module 471b14a Undo previous patch, caused linker problems on x86_64/linux ccdaa27 allocateLocal was renamed to allocate 631bb7f Add a missing dependency on gmp.h 9dbad72 bump base dep; apparently base4 is now required 620cdc5 Fix a makefile dep a7a7d7b Move .depend file dependency inside HaveLibGmp test We were building GMP even if we didn't need to. 6fd63e5 Tag imported gmp symbols with the package they're from 2eaf722 MERGED: Pass GMP paths when compiling mkGmpDerivedConstants; fixes trac #3784 Ian Lynagh **20100118191831 d7e56c1 Don't rely on tar supporting -j; trac #3841 cd0cecb Fix the build A missing | meant that the build broke on machines that don't have libgmp available. 2528077 Fix the $(GMP_DIR) path that we remove b749fed pass $(AR) to the GMP build 1f4961a Follow variable name changes e69ab88 FIX #38000 Store StgArrWords payload size in bytes 87af623 Tighten the base dep; fixes trac #3809 619fc6b Add quasiquote definitions for declarations and types 7c93bf7 Add parens in patterns; fix Trac #3899 49f2a3b Format most comments for haddock. 65160e0 Fix typo d474eda Replace an (incorrect) bytes-to-words calculation with ROUNDUP_BYTES_TO_WDS 4d372bc Follow SET_ARR_HDR change af3c0ac Hide GHC.Integer from haddock again, now that haddock #24 is fixed; trac #2839 77f432c re-instate the documentation for 'Char', which got lost at some point 43583aa Integrated new I/O manager (patch originally by Johan Tibell , minor merging by me) 37f9e66 Add type signature in local where a76bad5 Add type signatures to cope with lack of local generalisation aae6f86 deprecate unGetChan and isEmptyChan (see #4154) 74500d4 Improve TH pretty printing 0d34321 export allocaBytesAligned; make allocaArray use the correct alignment (#2917) e449f18 Fixed a rounding error in threadDelay 2e197f1 Add a missing castPtr (only shows up in -DDEBUG) dc8d692 fix cache variable name used by FP_SEARCH_LIBS_PROTO cbd9e54 Fix warnings 3e3cfe9 Fix the build when HAVE_KQUEUE but not HAVE_KEVENT64 e7f7ce7 More accurate isatty test for MinGW. 158edf1 Fix Windows build; patches frmo ezyang 29cc62c Remove debugging code accidentally left in 68e20b5 avoid Foreign.unsafePerformIO f5f073d Put the state-token argument on fill, done, adjust on the RHS 4176e8a fix warning on Windows a442e21 deriving (Eq, Ord, Read, Show) for Newline and NewlineMode 1957027 don't fill a finalized handle with an error (see comment) c3563c6 Add a suitable Show instance for TextEncoding (#4273) b6c6bc8 Add missing import, fixes build on windows c3c5bee Add absentError. 1b0a5be tighten up parsing of numbers (#1579) deea031 Windows: map ERROR_NO_DATA to EPIPE, rather than EINVAL WriteFile() returns ERROR_NO_DATA when writing to a pipe that is "closing", however by default the write() wrapper in the CRT maps this to EINVAL so we get confusing things like 0363c0b some fixes for hGetBufSome - fix one case where it was blocking when it shouldn't - a couple of error-message tweaks 880046f Allow Data.HashTable construction with user-supplied size a5e8598 Use the stage-specific CONF_CC_OPTS variables 76dcfb8 Add a StringPrimL constructor to the Lit type (fix Trac #4168) 8ac36fd implement integer2Int# and integer2Word# in Haskell, not foreign prim 6c00372 fix hashInteger to be the same as fromIntegral, and document it (#4108) 13393fc documentation for IODeviceType (#4317, edited by me) 6cc96ac doc tweak for Directory file type: file names are '\0'-separated 8e81282 Make intersectBy lazier Add shortcuts to intersectBy for empty list arguments. In addition to being faster in that case, more inputs yield defined results. Treats ticket #4323 13e2f4a FIX #4228 (atanh (-1) returns NaN instead of -Infinity) 61b7635 Fix compile warning on 32bit machine 54047d1 Add quoteFile function (see Trac #4293) 4292f7c Add TH reification of instances (Trac #1835) e6ad4fd Bump version to 2.5.0.0 c33ce37 Export recent additions from Language.Haskell.TH e7bd0d0 Extend Template Haskell support for interruptible calls. ce7e28e Bump version number to 0.2.0.2 efc5f12 Lazier intersperse A lazier implementation of intersperse, and consequentially intercalate, to avoid space leaks. 9e176dc Added initial .authorspellings c60ff20 Replaced some throws to throwIOs where the type is IO e015075 FIX #4381 Fix scaleFloat by clamping the scaling parameter so that exponent + scale doesn't overflow. fed095f remove trailing whitespace bb0e835 throwTo: mention interruptible foreign calls 686bce8 Define SpecConstrAnnotation in GHC.Exts, and import it from there 2620fbe FIX #1434 Rewrite rules for RealFrac methods with sized Int and Word targets. For all types whose range is contained in Int's range, there are now rewrite rules for properFraction, truncate, floor, ceiling and round from Double and Float, going through the specialised methods for Int. c3c3533 FIX #4334 Make selector thunks visible to GHC to fix a space leak in lines. 55d1537 Generalize catchSTM 834b9cf Add throwSTM :: Exception e => e -> STM a 5329059 Added view patterns (Trac #2399) a59bf17 FIX #4336 Avoid superfluous gcd calculation in recip for Ratio a because numerator and denominator are known to be coprime. f87c2eb remove trailing whitespace ca69c4f FIX #4337 Special versions for the power functions with a Rational base and rewrite rules. 27310e0 FIX #4335 fromRational :: Rational -> Ratio a produced invalid results for fixed-width types a. Reduce the fraction to avoid that. 16e5ce1 Remove redundant imports, now that NoImplicitPrelude does not imply RebindableSyntax 132e2c2 Follow GHC.Bool/GHC.Types merge aeb9367 CIntPtr, CUIntPtr, CIntMax, CUIntMax are new to nhc98. 4041be6 Add showMultiLineString to GHC.Show a75383c Refer to 'mask' instead of 'block' in documentation of Control.Exception e6c8e5d hGetBuf: fix a case of a short read being returned (#4427) 4e089af Add an INLINE pragme for fmapDefault f5dc1f6 Add an INLINE pragma on fromInteger on Int e44eac2 Fix whitespace in codepages/MakeTable.hs db5a9f5 Add a Makefile for MakeTable, and remove GHC.Num generated import 2c9b441 Re-gen GHC/IO/Encoding/CodePage/Table.hs ac6e50b Remove redundant import cd5e82e Reimplement firstPowerOf2 679d2c3 Add LANGUAGE BangPatterns to modules that use bang patterns b1b414a System.Event.KQueue conditionally uses BangPatterns 2494866 Add some comments to the generated Table.hs 3b01da3 Remove unnecessary fromIntegral calls 36896b6 Use throwIO instead of throw in runInBoundThread and runInUnboundThread 3503268 There's no need to explicitly check for blocked status in runInUnboundThread when we have mask eea9504 Catch exceptions in current thread and throw them to the forked thread in runInUnboundThread f891dda Fixing uses of fromIntegral for Windows 61eb4de Remove redundant fromIntegral 0a5ae50 Make (^) and (^^) INLINABLE 4c6bc7f Remove a redundant fromIntegral 04e3a09 Remove an unnecessary fromIntegral e7b799f Remove unused import on Windows db78cae doc fix: don't refer to unblock. 3beebdc use LANGUAGE instead of OPTIONS_GHC 443a9f1 Don't throw an error if the output buffer had no room This is consistent with the other codecs, and will be relied on by some upcoming changes in the IO library. 62c11c9 Encode immediately in hPutStr and hPutChar This means that decoding errors will be detected accurately, and can be caught and handled. Overall the implementation is simpler this way too. 0944a3b fix hTell behaviour with Unicode Handles d1e5852 Fix typo 9c0da18 check for ClosedHandle in read/write operations on DuplexHandles (#4808) 0b73a8d -XPArr is now -XParallelArrays 2046516 fix a discarded exception in hClose 21c4b26 extend the documentation about interruptible operations 8b3134d Export String from Data.String 5b0dbb5 Do not export String from Data.Char fab6b97 Also export lines, words, unlines and unwords from Data.String d8a0209 Add a Read instance for Data.Fixed.Fixed c69ecdd FIX #4383 Use a better approximation to logBase 10 2 to prevent leading zeros in floatToDigits. bdb39d8 Performance enchancement for floatToDigits Use quot and quotRem instead of div and divMod for dividing positive Integers since that is a bit faster. ef360ef Fix typo in floatToDigits The mDn value for powers of 2 >= floatDigits x - 1 was typo'ed, leading to longer than necessary show results in a few cases (e.g. 2.0^852). Corrected in accordance with Burger and Dybvig's paper. 0853287 Cache for powers of 10 Add a cache for commonly needed powers of 10 to speed up floatToDigits. cd497c6 Bump the version of base 79cf73c Fix #4514 - IO manager deadlock b6b40e4 Drop System.Mem.Weak's dependency on Prelude b9aeafa Fix #4533 - unregister callbacks on exception, fixing a memory leak dcc27a9 Drop closeFd from Control.Concurrent, rename to closeFdWith e30b2f4 Use onException for exception cleanup, and mask async exceptions 7617a10 Fix warnings 3485636 Fix build on Windows 7676811 Replace uses of the old catch function with the new one 798805f Always use 8k buffers instead of BUFSIZ This makes a huge difference to I/O performance for me on Windows, where BUFSIZ is 512. It might help on Mac too. 85bbbc4 Add Applicative instances for ST monads (proposal #4455) 0a55732 indentation tweaks, re-order exports c32e204 indentation tweaks (whitespace only) 52dbd3a Instances for ST not available in nhc98. 88faf22 fix #4876 511cbda Derived Eq instance for Chan a6d475c Derived Eq instance for QSem and QSemN 842d0d2 Added a Typeable instance for SampleVar 4f20ff4 Remove extensions required for GHC < 6.10 5578d58 Add NondecreasingIndentation to the extensions needed 232b001 Document System.Event 6036932 Clean up remnants of the Event Manager after forkProcess. Closes #4449 4cc27e7 fix silly mistake in hGetBufSome (#4895) 32ba285 Use explicit language extensions & remove extension fields from base.cabal c3d80a4 add NoImplicitPrelude (fix Windows build failure) c1a2db0 add missing extensions for Windows 6504ff9 add getNumCapabilities :: IO Int fa535ef Deprecate System.IO.Error.{catch,try} and Prelude.catch; fixes trac #4865 a8003b2 Regenerated cbits/WCsubst.c based on Unicode 6.0.0 f8dc7e4 Add Data.String to the nhc98 build 3771f1c Fix incorrect #ifdef for nhc98 9d379ca Do not export GHC.Generics from GHC.Base 9a6c22b Merge GHC.Bool into GHC.Types ab7f235 Update GHC.Generics to new generic programming library 2040842 Roll back generics changes in the HEAD repos c4ae3b4 Remove most of GHC.PArr - First step of migrating this code into the dph package d06adaf Expand and clarify MVar documentation. bdbbfc7 Grammar fix 93038d5 Add some more explanation to the skip channel example in the MVar docs 92b5624 improve discussion of the laws (doc comments only) 92028dc Make the Timeout exception a newtype instead of a datatype 85a39f5 follow changes to threadStatus#, and update stat values 06c59e5 add threadCapability :: ThreadId -> IO (Int,Bool) 9aaeb94 FIX #2271 Faster rounding functions for Double and float with Int or Integer results. Fixes #2271. Since some glibc's have buggy rintf or rint functions and the behaviour of these functions depends on the setting of the rounding mode, we provide our own implementations which always round ties to even. 30f9427 Follow GHC.Bool/GHC.Types merge a350b02 Follow GHC.Bool/GHC.Types merge 816f7e6 Follow GHC.Bool/GHC.Types merge f63a3ea Use showMultiLineString from GHC.Show 056d48a Add a rewrite rule for toInt# so literals work right 14476b7 Follow GHC.Types changes 2ed6c18 Add LANGUAGE BangPatterns to modules that use bang patterns 8a0e139 Remove unused functions combine, rename, genpat, simpleMatch 8f16f80 Remove unnecessary toRational 8eed780 Remove the "alpha" helper function; trac #4423 64b90e7 Fix unknown symbol base_ControlziExceptionziBase_patError_info by helping GHC generate smarter core. 37912e6 Put FlexibleInstances in PprLib alone 008d230 Use type families ee74f61 Fix warning 04f4b12 Never use epoll_create1; fixes trac #5005 There is little benefit to using epoll_create1 (especially if we still have the epoll_create code too), and it cuases problems if people build a GHC binary on one machine and try to use it on another. 9ff857c Rename System.Event to GHC.Event It's just an internal GHC library, for now at least a1025fa Work around a limitation in the hsc2hs cross-compilation mode 2811d81 Fix documentation for mkWeakIORef: argument is finalizer, not key or value b2e0b65 Add allowInterrupt :: IO () (#4810) 8acfc99 Use functional dependencies 5509e8a Use functional dependencies. 381ce0f Add extensions to LANGUAGE pragmas f496f8b Add extensions to LANGUAGE pragma bbf06bf Change type of TH.classInstances (and qClassInstances) c7a4168 Tidy up gmp cleaning 614c26b Correct the gmp build phase be8301a Update for changes in GHC's build system 56d4508 We should not use XGenerics in ghc-prim, for now at least. 35c86cc Call the final build system phase "final" rather than "" 3b1ec6e Add unboxed tuple support to Template Haskell 150a157 Roll back generics changes in the HEAD repos bb01c72 Add GHC.IO.Handle.FD.openFileBlocking (#4248) like openFile, but opens the file without O_NONBLOCK 54c33b2 add forkIOWithUnmask, forkOnIOWithUnmask; deprecate forkIOUnmasked ba301c4 fix Haddock error 53a93d1 Deprecate Control.Exception.blocked in favour of getMaskingState aec9d3e Export the affinity API from Control.Concurrent: forkOn and friends. 31cb13b No need to include the OpenGL / OpenAL headers in aclocal.m4 5534946 Rewrite FPTOOLS_CHECK_HTYPE to be cross-compilation-friendly Inspired by a patch from Mark Lentczner 9463922 Generalize the type of Foreign.Marshal.Utils.maybeNew; fixes trac #5044 a018a9c Tweak alloca docs 0b6ff78 Less strict inits and tails 763b7be Add .gitignore b9bab42 Merge branch 'master' of ssh://darcs.haskell.org/srv/darcs/packages/base fee7e18 Change debug prints in readTextDevice' to refer to right function 84145c3 Fix handling of suffixes for GNU iconv fe98324 Change some uses of CString functions to CAString instead 7089444 Document invariants on mkText{Decoder,Encoder} 6ec3bbc Bump Cabal version we implement, and add source repository to .cabal file 88020c7 Update source-repository in the .cabal file to point to the git repo 4ded72a Update source-repository in the .cabal file to point to the git repo 4970a5c Update source-repository in the .cabal file to point to the git repo 43d12dc Use _NSGetEnviron on OS X: fixes #2458 c7d6b4c Use FP_COMPUTE_INT rather than AC_COMPUTE_INT 03de58e Swap FP_COMMUTE_INT argument order to match AC_COMPUTE_INT ed8f672 Removed Show instance for IOCallback and FdData The IOCallback instance conflicts with the more general instance Show (a -> b) defined in Text.Show.Functions e276da0 Update source repo location to be the git repo in .cabal file b49dea0 Initial commit for Pedro's new generic-default mechanism 5b11dc6 Second initial commit for Pedro's generic-default mechanism 3bf05a2 Initial commit for Pedro's generic-default mechanism 3796c18 Improve docs for GHC.IO.FD.openFile 976a913 Tweak build rules b1a391b Update comment on fmapDefault to note that it only works for Traversable instances with a given definition of traversable, and NOT for instances with only sequenceA given. 48dd2aa Part of #5122 "Faster conversion between Rational and Double/Float" fix 17f1654 Part of #5122 "Faster conversion between Rational and Double/Float" fix 3812286 Part of #5122 "Faster conversion between Rational and Double/Float" fix bea20c0 Fix build on 64bit machines 6203474 Make and use AR_STAGE[0123] makefile vars 091e108 Follow CC var changes in makefiles 1874189 For GHC, implement the Typeable.hs macros using standalone deriving 6984014 Remove an unnecessary -fno-warn-unused-binds flag 366bda5 Remove a redundant -fno-warn-unused-binds flag 471bcc5 Merge branch 'master' of http://darcs.haskell.org/packages/base into ghc-generics 5286a2e Remove old generics stuff. 16482a4 Whitespace only. 4c990cc Add instances for basic types of the new generic deriving mechanism. 2f8e099 Update comments. 00d0bc2 monad comprehensions: Group and Zip monad 08db4da Performance improvement for division: got rid of an unnecessary branching in cases where the second argument is a constant and is not -1. f506257 Add GHC.Event.getSystemEventManager :: IO (Maybe EventManager) 32038d8 Add a note about the definition of quot etc e40066a Comment the generics stuff instances in GHC.Int, for now. c0f3860 Merge branch 'master' of http://darcs.haskell.org/packages/base into ghc-generics 89e8676 Add new module GHC.CString with functions relating to CString (moved from GHC.Base). Updated the base type modules so that the Generics flag is on (the CString functions are required because the generic representation uses strings). d4c8911 Moved the CString functions to GHC.CString in ghc-prim (needed for the new generic deriving mechanism). 6ec0c9f Move Eq and Ord for Int from GHC.Base to GHC.Classes, so they are not longer orphan. fc3f3c9 Add Representable0 instances where needed. 884f2be Add Representable0 instances to Either and Maybe. 6bebb34 Merge branch 'monad-comp' f84e3b6 Merge branch 'master' of http://darcs.haskell.org/packages/base into ghc-generics c37911f Adapt to the renaming of `Representable0` to `Generic`. 53ccafe Adapt to the renaming of `Representable0` to `Generic`. cdbce12 disable incorrect RULEs for Floats (#5178) 741a5e3 Merge branch 'master' of http://darcs.haskell.org/packages/base into ghc-generics dc58b73 Big patch to improve Unicode support in GHC. Validated on OS X and Windows, this patch series fixes #5061, #1414, #3309, #3308, #3307, #4006 and #4855. 8ea485f Merge branch 'master' of http://darcs.haskell.org/packages/base into ghc-generics d3ebf52 Use Unicode private-use characters for roundtripping 036830b Change to the 0xEF80..0xEFFF private-use range for //ROUNDTRIP d48f6ea Merge remote branch 'origin/master' into ghc-generics d2c2c2a Merge branch 'master' of http://darcs.haskell.org/packages/base into ghc-generics 4a66940 Add tests from testsuite/tests/h98 a21710b Move tests from testsuite/tests/libraries 1559fb3 Add System.IO.char8, the encoding used by openBinaryFile, and correct the documentation for hSetBinaryMode which claimed that it was using the latin1 encoding when in fact it was using an unchecked modulo-256 version of it. 02beed4 docs: note strict sequential ordering of MVar operations e09bf1f document the memory model of IORef ada4548 document the behaviour of throwTo to the current thread (#4888) 81443da add final newline ea28013 Remove datatype contexts from base d321fba Merge branch 'ghc-generics' of http://darcs.haskell.org/packages/base into ghc-generics a167d69 Merge remote branch 'origin/master' into ghc-generics 240897e Add a missing "deriving Generic" 39b51b1 Detab GHC/Tuple.hs a642f15 Don't derive Generic for tuples for now c1e88d8 FIX #5227: derive Generic only up to 7-tuples, like Data. 2c240a8 Make 'forever' inlinable (fixes Trac #5205) b8e0de6 Add Haskell types for C types useconds_t and suseconds_t, which are respectively CUSeconds and CSUSeconds. a1a373a Whitespace only. This patch is part 2 of 4 for trac #4247 and #4970. e2850de Use CSUSeconds in getCPUTime and getCurrentTime. Fixes #4247. 7c85f70 Remove wint_t configure test 687c4e7 In configure, remove default Haskell equivalent of C types b565506 Refactor the FPTOOLS_CHECK_HTYPE macro 119deaa In configure, set $WINDOWS to YES or NO 47aa065 configure: fail if suseconds_t doesn't exist, except on Windows fe14485 Adjust behaviour of gcd 3fb44a5 Fix suseconds configure test on Windows fd5c862 New gcd documentation 1916561 Only the type definition of '[::]' (which is wired in) remains in 'GHC.PArr'. a61aedc SafeHaskell: Added SafeHaskell to base 1dbde5d Changes for TypeNats. fd5e2bb Support for TypeNats 6d1d9bd Merge branch 'master' into type-nats 88d77e0 Fix build on Windows 8d2d301 Fix Haddock. 4d2ac2d Fix quoteRem, rem, divMod and mod definitions c4bcd9a Add a test for quot/rem/div/mod overflow aa46613 Fix a comment about splitAt (fixes #1182). 196785e use seq# as the implementation of evaluate (see #5129) c04a6fb Fix some haddock markup 066670a Make the calls to 'error' more informative (Trac #5274) 5586f1b Bump version number ec1c486 Bump version number a36435e Fix a copy-and-paste-o 956b98d Bump version number 3c0d916 Foreign.Marshal now reexports Foreign.Marshal.Safe b89a2f8 Remove some legacy comments 3f1606f Fix a typo e11e9ff Correct a comment e0b63e0 Typeable overhaul (see #5275) 014775f fix warning 3ffbf9a fix warnings (including moving things around to avoid orphan instances) ac28a24 In the deprecation warning for mkTyCon, suggest deriving Typeable. 9698887 Follow removal of 'threadsafe' FFI imports 73103ca Move the munzip function in the Zip type class; fb3ff79 small tweaks to docs 51ea3e6 export unsafeDupablePerformIO 1042a2c Implement unsafeLocalState by unsafeDupablePerformIO, not unsafePerformIO. The latter is more efficient, and will work correctly for clients that are using unsafeLocalState for its documented uses. b855357 give instances of Ord for TyCon and TypeRep e08fb3a DEPRECATE typeRepKey c99e34d Add TH support for UNPACK pragmas (Trac #5290) 052a964 Merge branch 'master' of http://darcs.haskell.org/packages/template-haskell 79a8e5b Make Typeable safe now that handcrafted instances aren't allowed. a498671 Move GHC.Classes here from base e939cea GHC.Classes has moved to ghc-prim 546d609 Use LANGUAGE pragmas rather than OPTIONS_GHC 3c793f7 Integer Eq and Ord instances are now in the integer package 1f9e4a3 Eq and Ord instances are now in the integer package, not base 246d0f7 Fix build following modules moving around d4d3094 Follow library changes 78aba9a Sync the typeable fingerprinting with GHC 7359f81 Tweak the typeable fingerprinting 0a69e14 Follow toInt# -> integerToInt renaming ddada32 Rename toInt# -> integerToInt for consistency 69985f0 Rename toInt# -> integerToInt for consistency 13ebd1e Simplify int2Word# . integerToInt -> integerToWord 6e57e93 Don't inline most integer operations ccbb32d Add a missing implicit build dependency 9dc19cd Add support for unresolved infix expressions and patterns. e72f6d4 Remove mention of setUncaughtExceptionHandler from forkIO. f6fe25d Add newline to the end of Control/Monad/Zip.hs 8eecfc2 Upgrade gmp, 4.2.4 -> 5.0.2 84bcbde Trailing whitespace 62f5c97 Remove import of GHC.Show from IOBase.hs 9ad111e Remove now-unnecessary import of GHC.Show fc1f061 Merge branch 'master' of /home/dafis/GHC/./ghc//libraries/base 7c662d6 Data.Bits: specialise shift[LR] for instance Bits e72a0a3 Remove unnecessary import (Windows only) 95d90ba Make Q an instance of Applicative d1050b0 Merge branch 'master' of /home/dafis/GHC/./ghc//libraries/base 7d9e4f7 Remove -Werror from the cabal file 7787668 No need to export Integer from GHC.Integer.GMP.Internals 6f9d180 Eliminate orphan instances a6b1f7f Eliminate orphan instances 9695595 New GHC.Stats module for accessing GC statistics. 95f3b1a Warning police 1fe8239 Merge branch 'master' of /home/dafis/GHC/./ghc//libraries/base 8f43c3c Merge branch 'master' of /home/dafis/GHC/./ghc//libraries/base b2cec86 Fix the behaviour of scaleFloat; part of #3898 15bc61c Remove some antiquated C constructs a097edc Merge branch 'master' of /home/dafis/GHC/./ghc//libraries/base 232ad99 This should finally fix #5293 by fixing two bugs in GMP's configuration setup c99b8ec Make pattern matches more obviously complete dfd374c Trailing whitespace 78d3296 Unbox all GCStats fields, also add cpu_seconds and wall_seconds. 166e72f Merge branch 'master' of /home/dafis/GHC/./ghc//libraries/base 2ea4044 Expand documentation for RealFloat. Part of #3898. db2ac3a Delete stray comma in doc for encodeFloat 0ba0dbc Add a note about why/how we avoid patError 0826e99 Use Safe Haskell when GHC >= 7.2 21adc1d Formatting fixes 91aceda Remove old darcs boring file 779f36d Remove old darcs boring file 98b804a Remove old darcs boring file eaa2fe4 Remove old darcs boring file a47a745 Add fallbacks for processor specific instructions (e.g. POPCNT). These fallbacks are referred to by code generated by GHC. f708b3d The unit tuple is defined in a different module to other tuples (oddly) d31c81f .gitignore 963bd4b Update import of Text.PrettyPrint 54ee4da Implement lookupTypeName/lookupValueName, and reification of type family instances b38f083 Drop bitrotted code for < 32-bit platforms 03e8758 Drop bitrotted code for < 32-bit platforms 65ba73b Fix documentation for withCWStringLen (#5396) 5eaf161 Export Integer(..) from GHC.Integer.GMP.Internals again; fixes #5419 4dfdbd1 Add Data.Bits.popCount 93d2061 Follow ghc-prim changes 88db1ec Merge GHC.Unit into GHC.Tuple, and GHC.Ordering into GHC.Types b0b6424 Follow ghc-prim changes 19493a0 Follow ghc-prim changes 9018422 Trailing Whitespace 2b50f31 Fix return type of hs_popcntX b0be190 FIX BUILD on 32-bits dcb2d63 Add a data type we can use to box up equality evidence for -XConstraintKind 0706002 Break the GHC.Generics / GHC.Types import loop. 6c9c37f Update imports b685745 Fix build on Windows 97bf1c5 Don't export gcdInteger, lcmInteger from GHC.Integer cd4d0fb Add NOINLINE pragmas 77d0c63 NOINLINE a couple more functions c9b1dee Import GMP-only functions from a GMP modules 9935359 Export GMP-only functions from the Internals module 5480b00 Eliminate the orphaned Enum Integer instance 61cd1df Move some Enum helpers into GHC.Enum 19c467e Give Word a proper Show instance 680c1a9 Define mkInteger f9dad24 Define mkInteger ee727e8 Don't define our own list type d02622a Define mkInteger 5a195cc Merge branch 'master' into tmp c9b4d05 Use the Ratio constructor for toRational from Int/Integer 8266f5f Whitespace only in Text.Read.Lex 0eafdcd Be more efficient reading fractional literals 2d17a5c Fix #5436 by using 'recover' on handle EOF 9286e3b Don't try to detect iconv or libcharset if we are on Windows c0e43d4 Break the GHC.Generics / GHC.Types import loop. c8d544e Merge branch 'fix#5464' of /home/staff/magal101/repos/ghc/libraries/ghc-prim into fix#5464 8aedaae Untabify cbits/float.c 72de218 Eliminate intermediate overflow for encodeFloat, fixes #5524 7f72975 Removed pointless rule (realToFrac :: Int -> Int) 661f19f Whitespace only in GHC.Show 5d0d46b Fixed documentation bug 8473017 Fixed mistake in documentation and a typo in a comment cdca0c4 Change haddock for encodeFloat, fixes #5525 e885907 Fix fromRat' and fromRat'' 8005148 Explanatory comments 0101c91 Use Rational constructor if numerator or denominator is 1 34cd5f1 Eliminate unnecessary shift and reorder branches in fromRat'' 41841f6 Align arrows 3db78d1 Whitespace only 6107984 Fix typo in error message 78885e5 Merge /home/dafis/GHC/bghc/libraries/base ec96cd6 Remove now unnecessary helper function 0d4c9cd Minor: replace undefined uses with error as mentioned in ticket #5532 6871fa9 Improve performance of the unpack loop 4d47404 Combine two calls to 'ord' (seems to be just slightly faster) 817c4e1 Remove the Show superclass of Num 0a40540 Remove the Eq superclass of Num 6557680 De-orphan the Show Integer instance 77edace 80-columnify d27da47 tweak unpack/unpack_nl to generate better Core (#5536) 43f5377 Merge branch 'master' of mac:ghc/git/val32/libraries/base e84f5b1 remove erroneous '::' in NOINLINE pragma 4791ff8 Fix build on Windows 4b46bbd fix cross-ref to "Catching all exceptions" section (#5546) 28cfbf3 update ref to deprecated function forkIOUnmasked -> forkIOWithUnmask (#5546) f878f1b update IO manager documentation (#5547) ffe2f8d If an assertion fails, through it rather than a deeper error; fixes #5561 f2ef82e Export constructors for Foreign.C.Types and System.Posix.Types newtypes ac3ddf2 Fix error in KQueue caused by changes to FFI import requirements cd6a715 Warn about ArrowLoop instance for Kleisli Arrows c9dceb6 Update base for new Safe Haskell design 378dd29 Update base for latest Safe Haskell. 4b1de9f GHC.Stats: Use camelCase in public APIs e2df98c add laws to class documentation d8633ce Add pure traceEvent and re-export from Debug.Trace 201a47c Update Debug.Trace haddock docs and rename putTraceMsg to traceIO 2043afc Avoid using iconv for the locale TextEncoding if we can help it de77751 Be more forgiving about encoding name capitalization/hyphenization f2067ca Fix build on Windows c7c9db4 use MVar to define fixIO, for thread-safety (see #5421) ab0d93c addDependentFile #4900 eeae7d3 add unsafeFixIO (#5421) c7e5902 export flushAllHandles (#5594) f1c593e Add unsafeShift to Data.Bits 2766f50 export tyConName, tyConModule and tyConPackage; deprecate tyConString 9ac6337 fix typo 1422568 Make dataToQa work regardless of the set of in-scope names (fixes #4491). 53be8c8 Add GHC.PArr.PArr to break a cycle in compiling Data.Array.Parallel 59ecd68 Add "dropWhileEnd", as discussed on the libraries list b550077 Make the fileSystemEncoding/localeEncoding/foreignEncoding mutable 8019a64 Go back to using private-use characters in roundtripping bf9d5a3 Follow GHC build system change to the way we call rm 31159cb Move CPUTime001 here from testsuite/tests/lib/CPUTime 2b0adbd Remove some comments about interfaces being checked against H98 7e26078 Move lib/Char tests from testsuite to base 90e8b87 Move testsuite/tests/lib/Data.Fixed test to base/tests 7593ffd Move testsuite/tests/lib/Show to base/tests 1a9b04d Move testsuite/tests/lib/Numeric to base/tests d1fa09f Whitespace only in tests 0f386a8 Move hash001 to base/tests 56d233a Whitespace only in hash001 test 1627bf0 Move lexNum to base/tests 1303b93 Whitespce only in lexNum d7d45de Move Data.List tests to base/tests 180933b Whitespace only in tests b855aef Move ix001 to base/tests baf68bf Move lib/System tests to base/tests a4a686d Whitespace and modernise some tests 5a0b1a4 Move ioref001 to base/tests d45fd80 Update system001 output 8395104 Fix compilation error on windows. 7361c6c Rules for powers with small exponents (fixes #5237) 513cc84 Eta contract 'PArr' synonym 6962aa8 Add a C wrapper for gettimeofday ab5fa6c Remove some unused functions from include/HsBase.h 7b421c6 Simplify some CPP ff20d57 Make a wrapper for getrusage; part of #5480 73c4ff5 Convert come FFI bindings to use the capi calling convention ddc0d28 update to track changes to CCCS in the RTS 135680b Add a way to get hold of the current call stack 6bf8991 Use capi some more (part of #5480) 227e13c Use capi to define the fcntl FFI imports ab256d4 Use utf8 when decoding cost centre strings 02066df Expand the stack-tracing API 463b609 Add traceStack :: String -> a -> a 8c981c2 Change the layout of stack traces 4ec5661 Track changes to the way we reference CCCS in GHC (was: W_[CCCS], now: CCCS) 631796d Add source locations to call stack entries. fda7675 Use the mingw touch program on Windows e4c9384 Roll back the sigset capi changes 52abc41 doc update: mention -fprof-auto-calls 20007f5 renderStack: reverse the stack trace (most recent frame first) 637d791 add setNumCapabilities :: Int -> IO () 5789042 Add getNumProcessors :: IO Int 7855f10 Fix typo 95f330f Remove GHC.Exts.traceEventIO 77da470 Document that -T RTS flag is necessary. 66f4b10 Merge branch 'master' of http://darcs.haskell.org/packages/base 5fb9dee update documentation for getNumCapabilities and setNumCapabilities c0e32a3 Re-export Constraint from GHC.Exts d5ead92 Export "readEither" and add "readMaybe". 914da19 Merge branch 'master' into type-nats 9697def Remove all but the basics from the GHC module. 3b281a2 Change the representation of singletons from Integer to Word. da8f3c4 Export setNumCapabilities 800f575 Removing the MonadGroup class. This is to reflect the removal of the default grouping clause from the SQL-like comprehension notation ; 4b60b56 Add <> as an alias for mappend 5572345 Merge remote-tracking branch 'origin/master' into type-nats 3af923c Moved the instances from Control.Monad.Instances to GHC.Base and Data.Either 139d27a Remove Num superclass of Bits Add and export bitDefault, testBitDefault and popCountDefault from Data.Bits. a9e976c Use sharing in the Alternative instance of Maybe db94d0f Expand num009 to test more values, and add mingw32 output a63257f Added missing Functor, Applicative, Alternative and MonadPlus instances Added Applicative and Alternative instances for ReadP and ReadPrec Added Functor, Applicative, Alternative and MonadPlust instances for ArrowMonadx e3467bd Foldable typeclass: make foldl' and foldr' class methods; fixes trac #5538 03246bf Merge remote-tracking branch 'origin/master' into type-nats f948f83 Change extension name to match current GHC head. e184fcc Rename GHC.TypeNats to GHC.TypeList, cleanup, add type-level strings. 299f286 Add some rules; fixes #5767 acdd956 num009 now only fails on OS X i386, not OS X amd64 b2100a2 Export addDependentFile from Language.Haskell.TH.Syntax; part of #4900 ca85ca0 Updated to a newer version of gmp; fixes #5810 5c56453 Move Text.Printf tests from testsuite; part of #1161 86141a3 Fix the data constructors for tuples etc that dataToExpQ builds ad42fd9 Bump base's version to match 7.4.1's 30c0c02 Merge remote-tracking branch 'origin/master' into type-nats 5a16507 System.Environment: improve 'getEnv' doc to mention closest 'setEnv' we have ('System.Posix.putEnv') 11f108b Fix bug in popCountDefault. Fixes #5872 529a4cc Use the new quotRemInt# primop 04a8206 Fix documentation of minimal complete definition of Bits instances 4532045 Define a divModInt function that only does 1 division d7f6d0c Merge branch 'master' of http://darcs.haskell.org/packages/base 7b93b2c Add CTYPE pragmas cea77c1 Add CTYPE pragmas for GHC types 291633f Use throwIO rather than throw where possible This makes exceptions more predictable. f38789e Eta expand unsafeCoerce and add a pointer to the Note 9d60296 Merge branch 'master' of http://darcs.haskell.org/packages/base e757f8e Use the new unsigned quotRem primop 11c4880 Fix build on 32bit platforms a359804 Remove Control.OldException f016aa1 Minor Haddock documentation fix 142bfae Redo the sigset capi changes 3da3890 Convert some more declarations to use the CAPI 38799c7 Change CSigset into a (empty) datatype d5fa875 Fix an FFI decl: it should have been using capi but was using ccall e0db134 Remove an unsed definition in HsBase.h 702891c Convert some FFI bindings to use "value" imports 9ba5344 Remove some unused code 7ca5621 Remove another unused definition e416596 Use CAPI for lseek 31521d1 Move nocldstop from HsBase.h to HsUnix.h b677224 Remove some __HADDOCK__ CPP 62a506d Move chr's definition into a new GHC.Char f40aa90 Remove some redundant imports ba5bea9 Refactor number lexing; part of #5688 1752a9b Rename lexNum test to lex001, and expand it fbfa8f4 Add a test for reading Doubles 198c93e Change how NaN and Infinity are read by lex 81b6141 Add a readInteger001 test ba85754 Make "100e12" not parse as an Integer; part of #5688 63fedc7 Update .gitignore. f252b20 Update .gitignore. 6d0454a Update .gitignore. 7e84795 Copy tests from GHC testsuite; part of #1161. 533bcf0 Avoid making huge Rational's when reading Double/Float; fixes #5688 5c1c24f Sealed writeChan with mask_ to prevent a theoretical bug 588c08d Merge branch 'master' into type-nats ae75915 Add strict versions of modifyIORef and atomicModifyIORef 6f72869 Add fixity declarations to Template Haskell (Trac #1541) e1f950f Update gitignore 2638e80 Merge branch 'master' into type-nats b058d97 Updates to type-literal support. 064dc4a Win64 fix 3fb8c43 Fix building libgmp on cygwin 50005fa Merge remote-tracking branch 'origin/master' into type-nats eec29e9 Merge remote-tracking branch 'origin/master' into type-nats bd77f37 Fix typo in Data.List.(\\) documentation a732476 Add some useful functions for working with type literals. a218b90 Merge remote-tracking branch 'origin/master' into type-nats 3b8f092 Fix the type of IsEven cf67512 Revert IsEven to the way it was. bbcf397 change unsafeDupableInterleaveIO from INLINE to NOINLINE (#5943) 670eaf2 add test for #5943 86330a3 Merge remote-tracking branch 'origin/master' into type-nats 077ba3c Ensure hGetBufSome does not cause potentially blocking reads (#5843) ce96c14 Fix compilation under LLVM backend. (#5965) c899071 Fix an egregious bug in the fingerprint calculation for TypeRep b1d51d3 Test Trac #5962 ef9e348 Rename parAvgBytesCopied to parTotBytesCopied 0f1f0d9 Rewrite to use just one notion of singletons. c07266e Whitespace only: convert mixed tabs and spaces to spaces. 75efe3c Add System.Environment.lookupEnv (#5930) 3019319 Add testcase for #5930. f0e9b2b bugfix: use forkIOWithUnmask rather than forkIO 0b2923a add "Portions obtained from hbc (c) Lennart Augusstson" (#5963) 52d43ff move mkWeakThreadId to GHC.Conc.Sync; export it from Control.Concurrent 3b047ba doc tweaks b297a1f Add GHCi monad 6ea5981 Revert "Add GHCi monad" 386d3e2 Use monotonic time in Event/Manager.hs. 666bba8 Define monotonic time function for Darwin. 1fd0c2e Replace getUSecOfDay with monotonic timer (#5865) 22307c1 Add timer initialization for darwin. 5779768 Remove hardcoded mangling of the n_capability symbol (#5864) 91af2e9 Add GHCi monad. Experimental for now. 9949004 DEPRECATE Foreign.Marshal.Error.void (use Control.Monad.void instead) e119fe8 Don't include sys/timeb.h on FreeBSD. d5a3d79 use mkWeakNoFinalizer# (#5879) 7719344 Fix openFile003 for Win64 9c11265 Add a type-family for comparing numbers. 48c1949 Remove old test outputs a436735 Fix some more tests on Win64 56b05f1 system001 test is expected to fail on Win64 89e9295 Tidy up the ThreadDelay001 test code 4100b75 Fix an off-by-one error in freeProgArgv 8dda2df Use IORef/atomicModifyIORef instead of STM c031aec Use RTS version of getMonotonicNSec on Windows (#6061) 9cb3d36 Use in-process file locking on Windows (#4363) 4631489 Fix build. a75c1be Modify 'SingRep' to support arbitrary singleton types. e88cf25 Update to support singleton types with custom implementations. 5176c1f Don't use stdcall on Win64: It isn't supported; ccall is used instead 27e4036 Add INLINABLE pragmas in Template Haskell 58898eb Change TH syntax to allow promoted kinds and kind polymorphism cf14ed6 Change a few FFI imports to use CAPI 6fcc554 Remove some unnecessary Int specialised values c2f6f89 Remove some commented out code 5fdb0b5 Remove some more specialise-Int code c06e2a4 Use Word literals directly, rather than converting Int literals fda6ab9 Move the Word type from base to ghc-prim 312bd1c Move the Word type from base to ghc-prim a48be46 Abstract out a Ppr Inline instance 0eacc7f Use expect_broken rather than expect_fail in testsuite driver 93ac54f Fix typo in documentation of GHC.Exts.groupWith 5a3489f Update documentation of intersectBy 70d4e93 add mkWeakMVar; deprecate addMVarFinalizer (#6130) 797a829 Re-export Fingerprint in Data.Typeable.Internal. 3bcff29 Make Sing kind-polymorphic 4546adb Refactor findTempName: factor out file creation. 53184fb Allow openTempFile to retry when it hits a directory (#4968). 11b4bad add forkFinally e9f1000 Fix warning. bde4a84 add tests for deadlocks in readChan & writeChan 35d42ee add modifyMVarMasked, modifyMVarMasked_ 3425c77 fix another theoretical deadlock bug in the Chan implementation (c.f. #6153) 33416a2 omit the profasm way cbad295 Add GHC.IP for the new implicit-parameter story 1befc19 Fix typo; spotted by Gabor Greif 4276992 StringPrimL now takes [Word8] c41ac8f Add GHC.Stats.getGCStatsEnabled function (#5846) 14c4cd0 Re-export forallC in Language.Haskell.TH (#7009) b32d4e0 Export ForeignPtrContents in GHC.ForeignPtr (#7012) b08c092 Remove Prelude.catch and System.IO.Error.{catch,try} f1d3c29 Move divInt#/modInt# to ghc-prim e6594eb Move divInt#/modInt# from base 1bb3a57 Use divInt#/modInt# from ghc-prim c15b549 Use divInteger and modInteger fb66613 Merge branch 'master' of darcs.haskell.org:/srv/darcs//packages/base f83d3df Add divInteger and modInteger functions 36a2a5c Fix typos c4b81e3 Bump base's version b8d7b8f Update tests following changes in base f8b272a Use CLong, not CInt, for mp_bitcnt_t value; fixes #5965 827dab9 Use round-to-even when formatting floats (#5963) 3bac25f Move GHC.Generics to base d0a3eef Move GHC.Generics to base f0234bb Deprecate Control.Concurrent.{QSem,QSemNSampleVar} 9785fb9 Split a pragma into for better warnings 0a76803 Add System.Environment.getExecutablePath (#7029) f190e2d Add missing imports. 54c62c0 Deprecate the Data.HashTable module ec77f50 Fix parsing of RealFloat with huge exponents (#7034). c8a8b06 add some UNPACKs to improve performance a bit 9e3fb41 Add RatioZeroDenominator to ArithException, and use it instead of error 8e08f83 Add Functor instance for Handler (#7047) fc3edb4 Adapt to removal of catch from Prelude 658e926 Add strict version of modifySTRef 5e72463 Bump version to 0.3.0.0 72ec1df Bump version to 0.1.0.1 b9c580c export the constructors of ForeignPtrContents too 657153a Add alignment-restricted ForeignPtr allocation actions c888396 fix warnings e5629b9 Tweak RULEs; fixes #7041 e6bc6b7 Add another gcdInteger rule 47f0fd5 Remove a workaround for building with old GHCs 219c653 Added lambda-case support. 73c36bc Added multi-way if-expressions support. d27c454 Add documentation for Template Haskell functions 18d48b4 Remove Language.Haskell.TH.Syntax.Internals dccb90a Add reportError and reportWarning to TH 2ccf50a Reorganise the Language.Haskell.TH export list, so that it Haddocks better 1116d7b Add comment to GHC.Exts. 2c3a43d Move Down to Data.Ord (#7077) 4b0ccf8 Move some rules into PrelRules 52f7fa8 Simplify how gcd @ Int is implemented 69bacb8 Simplify how gcd @ Int is implemented 48987c1 Bump version to 0.5.0.0 fbf73d9 Bump version to 2.8.0.0 3bf0816 Merge branch 'master' of darcs.haskell.org:/srv/darcs//packages/base 94c6921 Merge branch 'master' of darcs.haskell.org:/srv/darcs//packages/integer-gmp 9557f5f Remove some deprecated modules and functions 5428d11 Remove hash001, as we no longer have Data.HashTable 13631d0 Remove tests for removed modules 9f0eca5 track integer-gmp and add 'divInteger', 'modInteger' ff06b84 Make numeric rules builtin. ac50935 Port more primop rules to PrelRules. de7d4e9 Fix inline rule shadowing warnings d19e3e0 Merge inline rule warning fixes 855ef73 Document that a FinalizerPtr is a pointer to a ccall function (#5254) 290310c Whitespace only: Line some things up better 54fccb5 Use testBitInteger; part of #3489. patch from pumpkingod at gmail.com 55df44b Define testBitInteger; part of #3489 fb83206 Define testBitInteger; part of #3489. Patch from pumpkingod at gmail.com 0ebac5b Fix building on Windows 3b3eb7d Refer and link to Haskell 2010 report in Prelude. 86ba770 Make startProfTimer and stopProfTimer available via GHC.Profiling 8dbc583 Merge branch 'master' of darcs.haskell.org:/srv/darcs//packages/base 5682cac Fix build 7e01e07 Comments ony 9bd314e Merge branch 'master' of darcs.haskell.org:/srv/darcs//packages/base 935a043 Pragmas refactoring. Also adds RULES and 'SPECIALIZE instance' support. 120bd32 Fix Trac #7146, by displaying a "\n" in a multi-line string 2df687f Merge branch 'master' of http://darcs.haskell.org/packages/base b3ef645 Improve definition of forever (#5205) 889ff4a add errorWithStackTrace daa75ea Remove finalizers from a ForeignPtr atomically (#7170) 833ba65 add pointers to Data.STRef and Data.Array.ST (#7182) 0b14849 add eqStableName :: StableName a -> StableName b -> Bool 0d280e0 fix typo ea9570d Add missing instances for (<=) 20130c0 Fix a typo; spotted by Mikolaj Konarski 86f4eb5 Fix build; GHC.Constants is now empty 7f7c9ed In the Template Haskell pretty printer, don't call error e6b690d Remove deprecated functions from Data.Data c89b5a1 Remove GHC.IOBase 520b2dd Remove GHC.Handle 4f03d11 Follow module removal in hDuplicateTo001 test 39b9f94 Add a big warning to the documentation for Weak (#7250) 925782e Add bitSizeMaybe to Bits, and add FiniteBits class a9ecd61 Deprecate bitSize 02998bd Add unary natural numbers to experiment on matching with literals. e801dcc Merge remote-tracking branch 'origin/master' 0978d64 FIX #7263: derive Eq, Show, and Read for GHC.Generics representation types 4aa8bc1 Adapt to NetBSD's struct kevent e2fec97 FFI wrapper for kevent() cdf4d62 Adapt to new Cmm syntax 6097a94 Add Debug.Trace.traceMarker/traceMarkerIO 2ea50a1 Use CAPI to make the C wrapper for kevent d0b9ed0 Merge branch 'master' of darcs.haskell.org:/srv/darcs//packages/base 1851a2f Update library to avoid using `Any` (also, replace fun-dep with type fam.) 0422ada Add CApiFFI to the extensions used by GHC.Event.KQueue 021a0f9 Merge branch 'master' of darcs.haskell.org:/srv/darcs//packages/base e9ab31d Remove out-of-date docs about Prelude.catch; fixes #7348 cbfc632 move fromRational into rationalToFloat/Double 636894f fix type mismatch in result of integer_cmm_testBitIntegerzh 1e1c03f remove deprecated pragmas (eliminating warnings) 3c083fa ErrorCall should be a newtype, and derive Eq/Ord 6f847e9 Fix #7233: avoid overflow in divInt64# a66b6ff Make sure testBit and bit get inlined; fixes #7292 6f32757 Handle UTF8 correctly in GHC.Conc.labelThread; fixes #6010 57f6591 alpha-rename the type signatures of foldl, foldl', and scanl to be consistent with foldr and scanr fda3002 Remove commented types in module export lists 123ba5e More type signature improvements from Bas van Dijk 9e9c6eb Remove GHC.Read.readp 0ec659d add Traversable laws f5dee98 Replace Rank2Types with RankNTypes 7fa0073 Merge branch 'master' of http://darcs.haskell.org//packages/base 9a1890d Fix Haddock formatting in Control.Exception 29f4ac8 Use nicer type variables in foldlM's type sig 14bad9a Declare a family for subtraction. 56c8e93 Merge documentation from inline's old primop entry 10a586e Move lazy from GHC.Base to GHC.Magic ce67249 Move lazy from GHC.Base to GHC.Magic e83b6cd Improve the Prelude doc header; part of #7108 fff4dbd Fix a typo 6db976d Change a commonet not to refer to the Haskell 2010 report in particular 0edcea0 Improve a comment 7dd230f Update some H98 references to refer to H2010 7be5177 Remove an out-of-date comment 1e41f1b Update a H98 reference to H2010 a651570 GHC.Windows: more error support (guards, system error strings) 5879d5c Add module header with some external links 5ea5b52 typo 87e61d8 Add a test for #6026 (fixity info for primops) df67010 Update haddock now that we can derive Generic1 (FIX #7444) 5142bc2 Add dataCast* definitions to Ptr/Array Data instances; fixes #7256 00ea200 typo a532c91 Merge branch 'master' of darcs.haskell.org:/srv/darcs//packages/base 1cce322 Add comment to .cabal file saying what GHC 7.6.1 shipped with 415a26a Add comment to .cabal file saying what GHC 7.6.1 shipped with 5e20e4e Add comment to .cabal file saying what GHC 7.6.1 shipped with f389e29 Add comment to .cabal file saying what GHC 7.6.1 shipped with 7498923 Add comment to .cabal file saying what GHC 7.6.1 shipped with cfa1da9 Bump version number following new policy 1998210 Bump version number following new policy b14ec9c Bump version number following new policy a81e2cf Bump version number following new policy 67bb9e6 Bump version number following new policy ca327c2 Bump base lower version to 4.5 (the version GHC 7.4.1 came with) 954ef66 Add newFilePath to System.Posix.Internals 4ab3d16 Added threadWait functions to wait on FD readiness with STM actions. c0032c0 Added the unregistration command to the return value of threadWait*STM functions. 32c3f2e Fix warnings 4bd0fa9 fix #7479: ArrowChoice unit law in doc comment 84a989b Remove trailing whitespace in GHC.Base 43a383f Worker/Wrapper and static argument transform for `until` so it can be inlined c10a1b8 Add word2float 756a970 Make a class for asynchronous exceptions in the exception hierarchy 2f32d1d Add back new working QSem and QSemN implementations (#7417) c8db4bb getNumCapabilities should read enabled_capabilities (#7491) 22e5fc3 qsem001 and qsemn001 fail in HEAD: #7497 65d4f18 GHC.Event.IntMap.highestBitMap reimplementation ec335ed fix qsem001 & qsemn001 5f6551b unbreak qsem001/qsemn001 703b5cf highestBitMask: use shiftRL instead of shiftR a18cf9c Add fromIntegral/Word->Double and fromIntegral/Word-Float rules d369ae5 zap obsolete FIXME, fix typos 7a6ddb8 remove unnecessary STM import e1779a7 Define GHC.Read.expectP and Text.Read.Lex.expect 73730c5 Implement overlapping type family instances. 875beaf Add functions that compare singletons for equality (with evidence) 5d60827 Merge branch 'master' of http://darcs.haskell.org/packages/base f251bf5 Make sum and product INLINABLE d7b5f52 GHC.IO.Buffer: use memmove instead of memcpy in slideContents 0862dcc BufferedIO: fix bug in writeBufNonBlocking introduced by commit 7d39e100 5e3aec6 Expose Data.Fixed.Fixed's constructor 0921387 Provide a way for OS X users to indicate a preference for the GMP framework d0a0ca7 Fix configure when we don't have a gmp library f6ee55a Clarify the wording of the 'insert' haddock; fixes #7421 5f19f95 Fix Data.Fixed.Fixed's Read instance; fixes #7483 e68158a Remove unused import ccb16c1 Comment out IsEven, isEven, and friends, because the type is ambiguous 104aeb7 Merge branch 'master' of http://darcs.haskell.org//packages/base b0d27b9 Expose new threadWaitSTM functions in Control.Concurrent (see #7216). f54bc5f Fix warnings 753e3e3 Fix ambiguity error on Windows 8564b7f Fix warnings on Windows 6c0743c Add Generic instances to GHC.Generics representation types 171f638 Possible fix for detecting Float/Double bd0faf7 Use the RTS getMonotonicTime to implement getMonotonicNSec; fixes #7299 946a2d1 Merge branch 'master' of darcs.haskell.org:/srv/darcs//packages/base c0d723e num010(ghci) is broken on OS X 32 (#7043) 94e6d7d Removes the assumption that CLK_TCK is a constant (#7519) 52f5545 integer-gmp: improve cross-compiling support GmpDerivedConstants.h edbc826 Rename tests to not start with a digit 71221e2 Grotesque hack on Unsafe.Coerce f9d7045 Merge branch 'master' of http://darcs.haskell.org//packages/base 38c54bd Merge branch 'master' of darcs.haskell.org:/srv/darcs//packages/base 2cd5138 typos 23517de Rename some numeric tests: nnnn -> Tnnnn 64a6151 Merge branch 'master' of darcs.haskell.org:/srv/darcs//packages/base 8768356 typos 7a49a34 Merge branch 'master' of darcs.haskell.org:/srv/darcs//packages/base 916be61 Revert "integer-gmp: improve cross-compiling support GmpDerivedConstants.h" 2ae4bcb Fix an 'if windows' test to cover Win64 too 07e79f5 fix negative numbers for * modifiers (#7457) c0e390f tabs -> spaces 7291418 add test for #7457 1cc5c9c Use capi for mkfifo, tcsetattr and tcgetattr (for Android) c7751c4 some more typos 49cb749 Release the FD lock before calling close() (#7646) 8129652 Remove the reliance on relative accuracy of short delays (#7656) 33d92b5 typo 2915195 Remove a redundant pragma 389fdc8 Follow testsuite changes 53f56f1 Fix detection rule to classify types as non-floating-point 1b91e70 Never try to use the system gmp on Windows e98090e Fix GMP_PREFER_FRAMEWORK 3743eb5 Follow changes in the testsuite be78f48 Follow changes in testsuite 0419c95 T3307 and environment001 just fail on MSYS 2e86f4f Resolve issue #7482 by removing the ability to create a new event manager. 298f0db Remove functions to step the system io manager in preparation for parallel io manager changes. 9a703bd Minor refactoring in GHC.Event.Thread to prepare for supporting per-capability IO managers. e963524 Refactor by introducing a boolean argument to newControl to determine whether the files created for a Control instance are registered with the RTS IO manager hooks. 38548ef Separated the IO manager into a timer manager and a file IO manager. bd94982 Specialized the TimerManager by removing the file monitoring support. 08e4e15 Removed control registration flag from Manager and TimerManager new functions. 3b911f5 Removed timer related features from Manager. e5ad3fb Use one IO manager per cap. be776ba Lock stripe the callback table in the IO managers. 0f8d659 Added support to backends for non-blocking poll() call. 107e81c Modify per-capability IO manager poll loop to avoid blocking (and context switching the OS thread) when the poll loop is heavily loaded. 18edb87 Allow backends to provide a command that register interest for an event source for exactly one event, and implement epoll implementation of this command. d584d8a Apply the epoll backend design (separate polling from registration) for the KQueue backend. 3d1b61f Added support for modifyFdOnce for the KQueue backend. 77fd94d Minor refactoring to simplify unregisterFd_ in Manager. edb6543 Refactor to handle activity on control files as special case. 8db9ad8 Manager takes a flag that indicates whether it should de-register a file registration once it has received a callback. adb5618 Minor clarification in registerFd_. 8cf7592 Minor simplification of calculation of new and old events in registerFd_. 778795d Implemented optimized registration and callbacks for the case when oneShot flag is set in Manager and the backend is KQueue or EPoll. 3bc0661 Wakeup is a no-op for KQueue and EPoll-based IO managers. dd48974 Use poll backend for TimerManager. de01f22 Use eventfd_write to write to wakeup eventfd in Control. 341296f Remove unnecessary import. e09e561 Remove UNPACK statement to eliminate warning about unusable UNPACK. 0df14e3 Added ioManagerCapabilitiesChanged function that is called from RTS to notify the IO manager that the number of capabilities has changed. dd54a09 Introduce IORef to refer to array of IO managers. cbe5c98 Replace use of numCapabilities with getNumCapabilities. adebaa4 Minor refactoring: pass eventManagerArray to startIOManagerThread. 12f3fef Parallel IO manager supports increasing and decreasing number of capabilities. d55070b removing trailing white spaces. 17b10ca preventing warnings. 99f5738 Making KQueue compilable. 1de63c7 renaming EventQueue to KQueue. 0fdb3fb Renaming QueueFd to KQueueFd. bedbb20 renaming parameters. 65309d8 Making KQueue.poll similar to EPoll.poll. a691b2d minor refactoring. 63981cb refactoring with guard. 3c0dab5 Improve comment on GHC.Event.Manager.closeFd_. de9b01b Added missing wakeup in GHC.Event.Manager.closeFd_. cca34b9 Avoid use of backend modifyFdOnce in Poll backend in unregisterFd_. 1025c8f Change GHC.Event.Manager.closeFd to unregister interest in the file with the backend. f500a2f Update closeFd_ to avoid unnecessary backend modifications. 1956ce5 closeFdWith closes fd after unregistering the fd with the backend. 54b00a7 Tidy up GHC.Event.Thread.closeFdWith. 62c2749 closeFdWith invokes callbacks only after the fd is closed. 50e65e1 Undo recent change to the type of GHC.Event.Thread.getSystemEventManager and update the commentary on this function. e88c6ef Avoid conditional compilation in GHC.Event.Manager. cd924e9 Fix wrong type in FFI call to eventfd_write in GHC.Event.Control. 5b81a90 ioManagerCapabilitiesChanged takes no arguments and instead gets the current enabled number of capabilities by executing getNumCapabilities after it acquires a lock on the IO managers array. f0d1822 Use (.&.) instead of mod in GHC.Event.Manager since the modulus is a power of 2. cbe3c39 Add some commentary in GHC.Event.Manager to the explain the poll loop. f182e7d Added UNPACK to emLock in GHC.Event.Manager Manager datatype. 7af45da Added NOINLINE directive to the numEnabledEventManagers IORef in GHC.Event.Thread. c9ca90d Removed unnecessary import from GHC.Event.Thread. 2abd38c Eliminate use of kevent64() calls. d8b94b3 Workaround buggy kqueue on os x. 5186ffc Removing unnecessary trailing spaces. ebf3787 Adding a comment about the workaround of the parallel IO manager on Mac. aceb3e8 Fix bug that caused ghci to create a large number of kqueues and pipes on OS X. 4a80762 Merge the new parallel I/O manager 3d53407 Implement poly-kinded Typeable 586f5a2 Only run dynamic004 with optimisation fb639c6 Export Proxy from Data.Typeable c301c61 Add isNewtype to GHC.Generics (FIX #7631) 65cd1c0 Change rules for RealFrac methods to pointfree, so that they can also fire in pointfree use. 90c9c83 Make 'length' into a good consumer, fixing Trac #876 6e04f05 Use fromException instead of cast when matching exceptions 9d604f8 base: use --host as target, not uname cc650e1 enable memo001/memo002 when fast a3f1fd1 Remove uses of compose(s) in tests 98949ab Add the IsList class, for OverloadedLists ab1d58b Merge branch 'master' of http://darcs.haskell.org/packages/base 25d1eaf Remove nhc98-specific files and content 36f2d30 Mark DEPRECATED pragmas with when they were added c3470c1 Remove DEPRECATED pragmas from a couple of tests a34f677 Remove some things deprecated since GHC 7.2 309c3a3 Give Control.Monad.Instances a proper DEPRECATED pragma 631a65b Merge branch 'master' into rule_fixes b7fc72b Define Functor instances for ArgOrder, OptDescr and ArgDescr e6f1209 Remove a redundant backwards compatibility hack b5c9939 Remove some always-true CPP tests from System.IO.Error 309d4f1 Add "deprecated in" comments to deprecated pragmas d58baf9 Remove block and unblock (deprecated since GHC 7.0) 6fc6859 Remove blocked (deprecated since 7.2) b641227 Fix documentation 7115def Typo fae4967 Merge branch 'master' into rule_fixes 8ca03bc Remove some functions deprecated since GHC 7.2. 8ff2942 Follow changes in GHC's build system 197125f Use correct type for poll on Mac/FreeBSD, fixes ticket #7714. 0e1b9bd integer-gmp: mpn_gcd_1 allocate one Word on stack instead of 'sizeof (__mpz_struct)' baa7eca Fix typo 90d1d92 Don't just fail if hGetBufSome is used on a non-FD: fall back on the slow path instead 69a8c2d Fix #7522 by checking for empty byte buffers a little more 3900186 Add test for #7522 740bee7 md5.c: fix a typo in the size argument of memset 3302951 throwTo is interruptible. 1e2e013 Build system refactoring 408998f add test for #7719 46548f7 Fix System.Timeout.timeout leaking Timeout exceptions (#7719). 7a3131e Implement faster System.Timeout.timeout for the threaded RTS. 7fadc60 Build fix for iOS; fixes #7759 424c7f2 Fix warnings 0b79c32 Add some more Data.Functor functions; fixes #7817 e3e9ada Add Debug.Trace.{traceId,traceShowId,traceM,traceShowM}; fixes #7626 6e06881 Fix #7853 f178826 Test fix for #7853 4eb3193 Improve documentation for mkTextEncoding fd6fb7c Add isLeft/isRight 557a9a8 Fix build on Windows 8a6e132 Fix build when gmp isn't installed c5a4de9 Update parallel IO manager to handle the invalid files in the same way as previous IO manager. 592e4ae Derive Typeable for RealWorld and (->), now that we can 2216b89 Support for Windows DBCS and new SBCS with MultiByteToWideChar 802e99a Add comprehensive test for codepage encodings+recovery for them d238ea4 Handle dependencies for .cmm files properly 14233fc Omit T7773 on Msys aba043a Fix build order when building with integer-simple 52719ad Fix build 9905899 More build ordering fixes 06bc377 More build fixes d77b3a0 Another build ordering fix f47ea8e Add an __hsbase_ prefix to the MD5 symbols (#7914) 8abb62b Merge branch 'master' of http://darcs.haskell.org/packages/base 02b9a24 Add code to convert from representation types, to existentially quantified singletons. 083a45e Merge branch 'master' of ssh://darcs.haskell.org/srv/darcs/packages/base 95853c7 Enable PolyKinds for Control.Category. 822ce01 Merge branch 'master' of ssh://darcs.haskell.org/srv/darcs/packages/base 3730af0 Revert "Add code to convert from representation types, to existentially quantified singletons." cb2f2d4 add Foldable and Traversable instances for Either a and (,) a dac845c Redo and cleanup the change replacing `unsafe*` with `toSing` de1ae80 Add tests for kind-polymorphic Control.Category 889b5bb Remove an import loop f3c261b Remove some unnecessary SOURCE imports 8d87b5b Re-jig SOURCE imports a8ede1e Revert accidental change b3afa0a Make GHC.Err depend on GHC.Integer ad6696e Comments 404327a GHC.Err is no longer a boot module; no GHC/Err.lhs-boot 4c6faba Fix import warnings 374fcdd Add an import to fix build ordering 68288cf Change a use of atomicModifyIORef to atomicModifyIORef' 55a5f05 Remove uses of RecordWildCards in GHC.Event.TimerManager 2d5eccd IO manager: Edit the timeout queue directly, rather than using an edit list bbf6c02 Add a test for #7653 c7ef98d Replace all atomicModifyIORef calls in GHC.Event.TimerManager f177fdb Use atomicModifyIORef' rather than atomicModifyIORef 5ae2385 expose new Word operation to swap endianness for Word{16,32,64} da7db19 add other architecture for bswap in a form of Stg functions. b9138a8 Fix some typos 72901d4 Revert "expose new Word operation to swap endianness for Word{16,32,64}" 089c686 One more GHC.Err import eliminated 7fef22a Clarification what 'atomic' means here. 3be6101 Add setEnv/unsetEnv to System.Environment; fixes #7427 9dc3418 Fix a comment 5257404 Update GHC.ForeignPtr to use addCFinalizerToWeak# f2ade3f Fix hClose002 with the threaded RTS IO manager 4780c7a Fix hSetBuffering004 to work with dynamic ghci 3508495 Ignore editor backup files 0ff54be Update to support closed type families. 44cff44 Fix build on OS X 3ae1bc4 Run "sh ./configure" rather than "sh configure"; part of #7992 8f23525 Catch an illegal pragma and fix a typo 7827f74 fix markup bugs 5e2a5dc Add a section of documentation about the interaction of threads and finalizers e40d433 Update export list for closed type families 0193f91 Follow GHC build system changes 5564980 Comparison primops return Int# (Fixes #6135) d3fbf77 Derive Show, Eq, Ord, Read for Control.Applicative.ZipList; fixes #5787 9cf8e57 Add atomicReadMVar to Control.Concurrent.MVar and friends. 38ff3b4 Implement tryAtomicReadMVar. 0bb58e2 Fix build. 9299fdf Rename atomicReadMVar and friends to readMVar, replacing old readMVar. c376c26 Minor rewording. 5a5ff27 Expose new Word operation to swap endianness for Word{16,32,64} 404c995 Fix #7787 af04f2b Add test for #7787 6aaf1e2 Comparison primops return Int# (Fixes #6135) 66cc86e Fix GHC.Enum on 32bit platforms; fixes #8072 d8b02c2 Fix bug in IO manager when number of capabilities is changed; fixes #8087 01aa22b Implement "TypeLevelReasoning" proposal at wiki:TypeLevelReasoning e7a9c06 Eliminate Equality.hs-boot and Proxy.hs-boot by moving instances 0cc90bf Comparison primops return Int# (Fixes #6135) ab1791f Remove some redundant warning suppression ca8a9f4 Add asProxyTypeOf and Trustworthy pragma to Data.Proxy 2505aba We need NegativeLiterals for GHC.Int or we get warnings bdde811 Mark the roles of Ptr and FunPtr as R, not P! 649219a Implement roles into Template Haskell. eb25664 Comparison primops return Int# (Fixes #6135) a57832b Change return type for emulated 64bit comparisons f4f5a17 Use primop wrappers instead of tagToEnum# c10454d Comments only 41c3ed2 Comments only 6170f97 Fingerprint: Add Show instance for easier debugging 8967959 Fingerprint: Add getFileHash 920bbbc Fix -Werror failure in GHC.Fingerprint 527803a Remove trailing whitespace from GHC.Fingerprint.* 797a368 Comments only 48a9fbc Fix GHC Trac #8186. a6c396b Improve pretty printing for Template Haskell operators cc99f64 Fix off-by-one error in the IO manager 28cf2e0 Switch IO manager to a mutable hashtable 67c0a98 GHC.Conc.Sync: Pass TSO to stackOverflow acac32c length001 passes now 7df9d83 Fix AMP warnings 3113270 EventManager: Gracefully handle an initial 'Finished' state (#8235) 17e2a5c Revert "GHC.Conc.Sync: Pass TSO to stackOverflow" 6cc1aae Revert "length001 passes now" 229513b Redo <= with a type synonym instead of a class, add instance for boolean singletons, remove (-) a1233f2 Update Git repo URL in `.cabal` file 8d59148 Update Git repo URL in `.cabal` file 9a91e51 Update Git repo URL in `.cabal` file 4abc8d4 Update Git repo URL in `.cabal` file a4cad04 Update Git repo URL in `base.cabal` fa34409 Add `Data` instance for `Data.Version` 2a5ac7b Define GHC.Types.Coercible acaa1c8 byteSwap16/32: Narrow the result to 16/32 bits 345c316 Follow changes in comparison primops (see #6135) d75ca3b Follow changes in comparison primops (see #6135) 907cd8c Add Data.Bool.bool (fixes #8302) 43ece17 Remove Hugs98 specific code 0f5eae0 Constant-fold `__GLASGOW_HASKELL__` CPP conditionals 8f9f100 Make `` obsolete and refactor away its use 3b6efce Replaced Text.Printf with extensible printf, and made comcommitant changes 98a63b9 Support new role annotation syntax. 0710184 Update use of role annotations to new syntax. b549d68 Add `{-# MINIMAL #-}` to `class Eq` and `class Ord` 1b608a0 Add `{-# MINIMAL #-}` annotations to typeclasses 2c2ead5 Trailing whitespaces 937fab7 Follow changes in comparison primops (see #6135) a4e9c7e Follow changes in comparison primops (see #6135) acb313a Trailing whitespaces ad89699 Follow changes in comparison primops (see #6135) f65cef6 Comments only 957511b Add Haddock docs for new `class FiniteBits` 77f32da Add Haddock `/Since: 4.7.0.0/` comments to new symbols 2642d9f Add Haddock `/Since: 4.6.0.0/` comments to symbols 0a5ecb5 Add Haddock `/Since: 4.5.[01].0/` comments to symbols 40c00af Add Haddock `/Since: 4.4.0.0/` comments to symbols 2ed1377 Remove obsolete pre-Haddock-2 `#hide` pragmas 4449dbc Add instance Monad (WrappedMonad m) to Control.Applicative (#8218) 35d55a6 Add type functions (-) and ToNat1; Turn FromNat1 into a closed family. 5e16d00 Add Foldable/Traversable instances for 'Const m' 1ab2b1f Add fmapCoerce to Functor class. a1b56fa Revert "Add fmapCoerce to Functor class." ad74a2a Documentation for GHC.Generics b857c29 Define typeRep in terms of new Proxy# 52767f1 Fix comment typo introduced in 6368362f44 deff0cc Add a few missing `{-# LANGUAGE CPP #-}`s a7e09b4 Modernize and refactor `base.cabal` a4f36a7 Drop redundant `{-# LANGUAGE #-}` pragmas 4503466 Remove obsolete `include/Nhc98BaseConfig.h` 0e33e3c Add `/Since: 4.7.0.0/` to new entities in fc904366 e864079 Add missing/remove redundant `{-# LANGUAGE CPP #-}`s 4fe151c Expose performMinorGC (#8257) 4d51685 Expose new internal exponentiation primitives 71e2958 Expose GMP's `mpz_gcdext()` as internal primitive b3caee6 Fix name of minor GC function. a29423d System.IO.Unsafe: cleanup: make unsafeFixIO pseudocode more valid 47dd3c2 Fix Windows build. c949f8b Add TH support for annotations (#8340) ccd6d58 Remove all but the basic operations on type-level literals. 40e7236 Rename someSymVal to someSymbolVal add3bae Add fixity declaration for type-level functions. 29ea943 Add TExp data type. 4d226b3 Add a method to the Quasi type class that adds new top-level declarations. 9caca0a Make a TExp a wrap a TH.Exp instead of a TH.ExpQ. 6b676e7 Add the TExpQ type alias. 18f2e52 Correctly pretty-print let and do expressions. bb89c59 Add support for top-level finalizers 8b08440 Add Template Haskell state. 982267f Merge New Template Haskell branch. a333f7b Add `instance Monoid a => Monoid (Const a b)` 0fcb06e Port ThreadDelay001 to the "time" library 4434dc9 Typo in documentation 98d6079 Rename (:=:) to (:~:) and add Data.Type.Coercion 3ea4d5a Clean-up implementation of GHC.TypeLits. 2fb746f Clarify docs for throwTo wrt atomicity (#8432) 6fc1c0f Fix hangs with -threaded on iOS (#8307) 478132f Add reifyAnnotations (#8397) c90b2dc Add Show and Read instances for Data.Ord.Down c503eff Spelling in commments db1a8c4 Remove now-unnecessary NOINLINE pragmas ec33d03 Make TExp's argument have nominal role (Trac #8459) 2630f4c Declare all language extensions via `{-# LANGUAGE #-}` bad2d6a Refactor & modernize `.cabal` to `cabal-version>=1.10` c8db315 Add aux files `config.{guess,sub}` and `install-sh` 0a39d19 Refactor & modernize `.cabal` to `cabal-version>=1.10` 944c190 Add overlooked files created by `configure` to `extra-tmp-files` b3fe43e Don't include `{Event,HsUnix}Config.h` in source distribution ae7587d GHC.Conc.Sync: Pass TSO to stackOverflow 71645bc Run length001 test with +RTS -K8m 536b791 Implement SPEC for SpecConstr as a built in type. cb08301 Add actual documentation for new SPEC type. 994ea5b Placate clang. 6220e6f Add missing `{-# LANGUAGE #-}` pragmas 845bb10 Modernize `ghc-prim.cabal` to `cabal-version>=1.10` fcd1390 Update aux files `config.{guess,sub}` and `install-sh` 273669e Update `bug-reports` URL and version constraints 7551d17 Add overlooked language extensions to `IntWord64.hs` d5afac8 Add side-channel attack resilient `powModSecInteger` 64296b4 Changed export list to create better haddock. Added eqT to exports. eb6725b Name changes and addition of gcastWith and (==) to Data.Type.Equality. 824ea41 Name change `CoercionT` to `CoercionType`, and addition of `repr`. ee24f27 Apply Gabor Lehel's suggestions. f497354 Expose two GMP primality operations 9265c88 Add new module Data.Type.Bool, defining &&, || and Not. 506cfd8 Add a couple of `/Since: 4.7.0.0/` annotations 218c2ea Export abstract `Text.Read.Lex.Number` type 2e73837 Add Ord instances for GHC.Generics (#7263) 336e94d Allow module reification (#1480) 28ef0bd Use addDependentFile in quoteFile. abd4fae Add primitives to write/read Integers to/from bytearrays 1415647 Clean-up Cmm of import/export primitives 00e04e8 Fix OSX RTS crash due to bad coercion. 33ed16b *Really* RTS crash due to bad coercion. 449f188 Rename `{import,export}Integer` 008e636 Add `Addr#` based `{import,export}Integer` variants 17c55a4 Optimize order of pattern matches for export operations d97951f Improve Haddock documentation 1e38f49 Spelling in comments 643f07c Handle ExitFailure (-sig) by killing process with signal 2ec9734 Add tests for the top level exception handler 14527c1 Fix up test topHandler03 by ignoring unhelpful shell output 775d13d Add `instance {Bits,FiniteBits} Bool` 87672e7 Update Autoconf tests for recent GMP version 160fb4c Avoid unsafeCoerce# in TopHandler cfe79fd Add fusion RULES for mapMaybe 3682558 Properly detect msys2/x64 shell as Windows. 8446ccf Use type synonym d9179a5 Kill trailing whitespaces 78e7066 Improve mkName, so that it correctly parses the name ^.. 4231ff3 s/therad/thread/ 8e2aa93 Improve error messages for partial functions in Data.Data ce3ff03 Try harder to demote results from `J#` to `S#` (re #8638) 2a28fde Use a more sensible `hashInteger` implementation fc8e15b Refactor and comment the smartJ# changes (re Trac #8638) 4cc6785 Make use of `quotRemInt#` primop in `quotRemInteger` f9c2888 Refactor `stgReallocForGMP` to use `memcpy` d71ced0 Add functions to compare Nat and Symbol types for equality. ce74d32 add 'Since' annotations and remove an unneeded import 2a33660 Refactor C-- wrappers to use macros for mpz_t access 4b859ee Add new `mpz_mul_si`-based primop (re #8647) 3b285ef Add new `mpz_{sub,add}_ui`-based primop (re #8647) 9e10e9c Hackishly fix parallel build failure with in-tree GMP 9143961 Document another unsafeDupablePerformIO limitation. aabc933 Wrap `gmpz_tdiv_{q,r,qr}_ui` to optimize `quot`/`rem` 67bcb32 Manually float out `int2Integer# INT_MINBOUND` a6243b3 Deprecate TH.global (Trac #8656) c0b5008 Temporary disable `mpz_gmpz_tdiv_qr_ui` to workaround #8661 7647997 Follow-up to a3878d17 069a49c Drop redundant formal parameter from TAKE1_UL1_RET2 7fdd026 Allocate initial 1-limb mpz_t on the Stack and introduce MPZ# type d075e1c Wrap `gmpz_fdiv_{q,r,qr}_ui` to optimize `div`/`mod` df1197a Fix in-tree GMP build (#8497) on OS X Mavericks 80c8c8c Use correct package id for `stg_INTLIKE_closure` import e0b3a05 Introduce new SIZEOF_MP_LIMB_T derived constant 531199d Dont use big/small-int primops on IL32P64 (i.e. Win/x86_64) for now 81b6bef go-ify foldr2 be3c7fa Add newline before two `/Since: 4.7.0.0/` occurences 836fd7c Add Hackage-supported `changelog.md` file 48e3524 Add `/Since: 4.7.0.0/` to `MkFixed` constructor a9848b9 Update `changelog.md` to contain more changes cfa0159 Add changelog entry for new `FiniteBits` class fcf0294 Improve Haddock markup in `Control.Concurrent.MVar` cc4ba35 Improve Haddock markup 276c462 Derive `FiniteBits` for integral newtype wrappers 38b7182 Comment typo 02dde83 Show docs for coerce and Coercible in GHC.Exts 7251d42 Document Coercible in GHC.Types 6c8cc4f Improve documentation of `integer-gmp` b6253fa Add Hackage-supported `changelog.md` c7a050f Fix a popular typo 5ad48fd Fix a popular typo bcd38ea Fix negation of `divMod`/`quotRem` results (fixes #8726) 2c2e1ec Add release note about new `SomeAsyncException` 70b7a19 Make Pred a type synonym of Type (issue #7021) 0390a02 Change type of equalityT to be more parallel with others. 56f47fd Add documentation to why Pred has become a type synonym. 7822166 Implement foldl with foldr 79dfb96 Inline maximum/minium a bit more aggresively 60ebfcf Improve list fusion for [n::Integer..m] 58c8934 Test case for #8374 61cf76d Wrong bug number 23916ec Expand comment for enumDeltaToInteger1 124e568 Use new bitwise Int# primops in Data.Bits (re #8791) 90f83fa Minor typo in comment c60da54 Fix typo in documentation of Data.Functor.($>) 4acc8ea Tweak Haddock markup in Control.Applicative 4f4f798 Minor fixes to Haddock markup d3ad3ee Add `withMVarMasked` (re #8818) 0c7507a Provide Typeable1..7 as type synonyms (see #8813) b0e2736 Language extension wibble (see #8813) 6505c17 Tweak Haddock markup in Data.Typeable 4775d00 Fix GMP v4 compatibility. 65d78dd Add new Data.Bits.Bits(zeroBits) method e467d93 Create Data.Coerce (#8745) 1d1ff77 Add some instances for Monoid/Applicative (#8797) fd26a47 Add Since-annotation to `Coercible` 65869be Tweak documentation and update changelog.md d3317d4 Tweak Haddock comments in `Data.Ord.Down` added in ebc85262c 0d66095 Workaround failed constant-folding for zeroBits 518706b Add shiftR and shiftL implementations to instance Bits Integer 16e2371 Comments only, about the "RA" and "RL" nomenclature for shifts 0efb246 Use not# rather than (`xor#` (-1)) for complement 6f338dd Add RULE for "map coerce = map" (#8767) 4245397 Remove misleading comment 722193b Update Coercible docs due to Safe Haskell adjustment a962e1e Note [Kind-changing of (~) and Coercible] 54c95ff Better Comment [Kind-changing of (~) and Coercible] f793302 Refer to the coercible paper in Coercible' docs 59ace8b Import Coercible from GHC.Types 99869ef Export Coercible in GHC.Types (#8894) db5a43e Add functions for comparing type-level Nats and Symbols. 1921238 Make argument types in popcnt.c match declared primop types 717fc49 Bump to 2.10.0.0 a8512f6 Comments only. c686179 Mark Data.Coerce as Unsafe (#8827) 260189a add /Since/ annotation d8072fa Typo a107737 s/FromList/isList in docs 8992d52 Update Cabal submodule to tip of v1.20 branch 241c660 Make qReport force its error message before printing it dbe0b8c Update Cabal submodule to latest tip of 1.20 branch dc4b66f Update Cabal submodule to fix Solaris build f964cd9 Take account of the AvailTC invariant when importing a6e68af Fold ghc-prim.git into ghc.git (re #8545) c83bec7 Fold base.git into ghc.git (re #8545) 85febc0 Fold integer-simple.git into ghc.git (re #8545) 670599d Fold integer-gmp.git into ghc.git (re #8545) 8bcb206 Fold template-haskell.git into ghc.git (re #8545) 41f5b7e Update `sync-all` and `packages` wrt to fold-in 1d2ffb6 Validate inferred theta. Fixes #8883 1bf6c0e Add reverse application operator Data.Function.(&) 44512e3 Add Data.List.sortOn function (re #9004 and #2659) dc2b8ae Fix sync-all error message introduced in 41f5b7e3e 7b04d35 Weaken constraints on Data.Complex functions bd7b973 Kill trailing whitespace in recently touched files 2eb40eb Normalize GHC Trac URLs 974a97e sync-all: Apply submodule url rewriting also to stuff in util/ f1f2d8f Remove some redundancy in sync-all bbf1cca More github url variants 33350ea Do not use basename() 386e874 Update Cabal source-repository entries (re #8545) 6074c5d Remove -fno-warn-amp sledgehammers for validate 35d95a2 Update submodule to final Cabal-1.20.0.0 release 3608f65 Deprecate the AMP warnings. 31dd5e5 testsuite/spec001: untabify, kill trailing whitespace 574ef42 ghc: Do not add a space in '-U __PIC__' e2b14c7 Use import list to hide new System.Exit.die 77ea2eb Add System.Exit.die (re #9016) 4ab8fc5 Kill whitespace after cpp's `-I` flag bcd989d Generalise type of recently added System.Exit.die a383139 ghc & docs: kill unused flags c29bf98 ghc: initial AArch64 patches 5a31f23 Be less untruthful about the prototypes of external functions 8586f60 Add the powerpc64le architecture 9ca17f8 Separate thousands when printing allocated bytes 4842dde Fix `make help` bb85759 Adapt .gitignore (re #8545) c6a31d2 Update integer-gmp's .gitignore file 33e585d Handle base et al. specially in foreachLibrary.mk 0a0115f Be more aggressive in `make clean` 31a7bb4 Add comments to explain the change to EF_ (Trac #8965) 98aab76 Be sure to UNPACK the size of an array 68a1e67 Make absolutely sure that 'done' and 'safeIndex' are strict in the index 134b722 Be less verbose when printing Names when we don't know what's in scope 79e46ae Don't eta-expand PAPs (fixes Trac #9020) 4ceb5de Some typos in comments 07388af Drop `template-haskell`'s build-dep on `containers` 95da409 rts: Fix potential memory leak in ProfHeap.c 111b845 rts: Fix possible int overflow in resize_nursery 6d11a0e coverity: Suppress some time-of-check-time-of-use reports f2595fd Check return value of sigaction fa0cbd2 Fix potential out-of-bound memory access 6ed7123 Check correct variable for NULL f17dcf0 Fix memleak in hp2ps fa5ac96 Don't require mk/config.mk for all cleanup targets c4e9f24 Test Trac #9036 0960a37 rm -rf ./docs/comm ba2e201 Do type-class defaulting even if there are insoluble constraints ef35d4c Remove the definition of die, which is now provided by System.Exit 7201e2a Update 32-bit perf numbers 3c990bf Start on 7.10.1 release notes 48e475e Fix annotation reification for home package modules 5f5e326 Add a comprehensive test for using Annotations from TH 7b967af tcrun045 should fail (implicit parameter as superclass) 2f3ea95 Print for-alls more often (Trac #9018) 0fe7268 annth_make, annth_compunits: Only run these tests if have_dynamic() a3896ab Improve implementation of unSubCo_maybe. ab8bb48 Fix scavenge_stack crash (#9045) 1d0798c Typo in comments 3a5c549 Typo in comment 4539400 rts: Add an initial Coverity model 7400810 Revert "rts: Add an initial Coverity model" 91cc88b Add Note [Role twiddling functions] to Coercion. 275ea0f rts: Add an initial Coverity model e597f5f rts: Fix leak of file archive handle b7278d3 rts: Fix memory leak when loading ELF objects 43b3bab Rts: Consistently use StgWord for sizes of bitmaps 05fcc33 Rts: Reuse scavenge_small_bitmap (#8742) 83a003f Don't inline non-register GlobalRegs 34db5cc Replace all #!/usr/bin/perl with #!/usr/bin/env perl b0534f7 Per-thread allocation counters and limits a05f8dd Update Haddock submodule ref. Fixes `cabal test'. 5bf22f0 Remove external core 54b31f7 fix rts exported symbols base_GHCziIOziException_allocationLimitExceeded_closure 2e03d86 Update comment now that we have per-gen weak pointer lists. 5141baf Improve docs for array indexing primops f0fcc41 Revert "Per-thread allocation counters and limits" 9f3e39d Fix over-zealous unused-import warning 1302d50 Add -fno-full-laziness to get consistent profiling output cdca791 Changed profiling output is fine (according to Simon Marlow) 675c547 Improve comments and tracing in SpecConstr 3c3ce82 Modularise pretty-printing for foralls 5b73dc5 Second go at fixing #9061 13a330e Fix Trac #9071, an egregious bug in TcDeriv.inferConstraints 02227dd Add a bit more typechecker tracing 59b4e6d Adding missing test files for #9071 22ed9ef Update transformers submodule to new v0.4 rel 76820ca Improve tracing in Simplifier 0f978b5 Refactor buildClass and mkDictSelId a bit, to avoid the no_unf argument 4088799 Mark evaluated arguments in dataConInstPat 35be701 Preserve evaluated-ness in CoreTidy b5ca10c Better error message in vectoriser 12332f1 Error message wibble, presumably due to recent changes in transformers c302a46 Update .gitignore 2f9a846 testsuite: fix cgrun051 exit code 3ed867f testsuite: fix cc004 3abf949 Require transformers for T5979 fe8a378 Revert output of T5979 2745164 Comments only, on inert_fsks and inert_no_eqs 770e16f In splitHsFunType, take account of prefix (->) b5cf17f Improve desugaring of lazy pattern match 315fff6 Typo in comment 1f8f927 Typo in note 4cfc1fa Lint should check that TyConAppCo doesn't have a synonym in the tycon position 21f17d0 Fix invariant in mkAppCoFlexible 214ad2d Fix globalRegMaybe for unregisterised build. 3fd7f54 Wibble to 4cfc1fae b036424 Update Haddock submodule. 0148a1c Add strict ver. of (<$>): (<$!>) to Control.Monad dd92e21 Set cabal files to default-language:Haskell2010 88c0870 Remove LANGUAGE pragrams implied by Haskell2010 fc0ed8a Add missing stack checks to stg_ap_* functions (#9001) 913b314 Avoid NondecreasingIndentation syntax in ghc-pkg 61fdafc Drop use of CPP in `bin-package-db` d4aa4e4 Drop default-extensions:CPP in hpc-bin.cabal 2dd80f6 Convert `ghc-bin.cabal` to use others-extensions e199891 Avoid trivial cases of NondecreasingIndentation 2389244 Add LANGUAGE pragmas to compiler/ source files 9a58cac Express OPTIONS_GHC as LANGUAGE pragmas 022f875 Refactoring around TyCon.isSynTyCon bc7d49a Only uninstall signal handlers if they were actually installed (#9068) 882978d ghc: Update containers submodule 4dac3a4 base: Document Foreign.ForeignPtr (#8475) b75d126 rts: remove stable-names from hashtable upon free 39aa1e9 integer-gmp: do not confuse ./configure (#8783) 3df1c51 Extract derived constants from nm output for various OSes differently. 3a61e6d Tighten up wording in the section on let-generalisation and MonoLocalBinds eab173b Remove the bit about External Core from flags.xml 4117551 Re-add 'classP' with a compatible implementation and a deprecation notice 135489d Provide deprecated backward compatible implementation to 'equalP' a8cba19 Catch some typos 3a04ce2 Fix below warning by including "unistd.h" also a15d243 Harden imports in `DeriveConstants.hs` module 7e78faf Coercible: Unwrap newtypes before coercing under tycons 94c5767 Coercible: Test case for now broken(?) corner case 7d958ce Tweaks to note; also fixed unicode quotes bc58d2e Simple eta reduction in call to adjustMatchResults, just a tidy-up d8d9711 Make the unifier a fixpoint even for the free kind vars of a tyvar d41aa76 Better pretty-printing for ClsInst 02437a1 More debug info for failures in typeKind and kindFunResult 427e205 White space only 4dea15a Bump bytes-allocated for T3064 b33f321 Typos in comments 864759c test.mk: Be liberal in accepting GHC_PKG output bbe9e7c Store IfExtNames for PatSyn matchers and wrappers in interface file, and reconstruct PatSyn type from the corresponding matcher function's type. From git at git.haskell.org Sun May 25 07:22:40 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 25 May 2014 07:22:40 +0000 (UTC) Subject: [commit: ghc] wip/pattern-synonyms: Pattern synonyms have no implicit Ids (939d2ac) Message-ID: <20140525072240.7C1CD2406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/pattern-synonyms Link : http://ghc.haskell.org/trac/ghc/changeset/939d2ac005b9401eaf6ffd8dad64bc2f332cbe48/ghc >--------------------------------------------------------------- commit 939d2ac005b9401eaf6ffd8dad64bc2f332cbe48 Author: Simon Peyton Jones Date: Tue Apr 29 13:10:09 2014 +0100 Pattern synonyms have no implicit Ids >--------------------------------------------------------------- 939d2ac005b9401eaf6ffd8dad64bc2f332cbe48 compiler/iface/IfaceSyn.lhs | 6 ------ compiler/iface/TcIface.lhs | 5 ++++- compiler/main/HscTypes.lhs | 20 +++++++++++--------- 3 files changed, 15 insertions(+), 16 deletions(-) diff --git a/compiler/iface/IfaceSyn.lhs b/compiler/iface/IfaceSyn.lhs index f8c35ba..40daad1 100644 --- a/compiler/iface/IfaceSyn.lhs +++ b/compiler/iface/IfaceSyn.lhs @@ -59,7 +59,6 @@ import BooleanFormula ( BooleanFormula ) import Control.Monad import System.IO.Unsafe -import Data.Maybe ( isJust ) infixl 3 &&& \end{code} @@ -1004,11 +1003,6 @@ ifaceDeclImplicitBndrs (IfaceClass {ifCtxt = sc_ctxt, ifName = cls_tc_occ, dc_occ = mkClassDataConOcc cls_tc_occ is_newtype = n_sigs + n_ctxt == 1 -- Sigh -ifaceDeclImplicitBndrs (IfacePatSyn{ ifName = ps_occ, ifPatWrapper = wrapper_name }) - = [wrap_occ | isJust wrapper_name] - where - wrap_occ = mkDataConWrapperOcc ps_occ - ifaceDeclImplicitBndrs _ = [] -- ----------------------------------------------------------------------------- diff --git a/compiler/iface/TcIface.lhs b/compiler/iface/TcIface.lhs index 7fc7758..d293a78 100644 --- a/compiler/iface/TcIface.lhs +++ b/compiler/iface/TcIface.lhs @@ -590,7 +590,10 @@ tc_iface_decl _ _ (IfacePatSyn{ ifName = occ_name , ifPatArgs = args }) = do { name <- lookupIfaceTop occ_name ; matcher <- tcExt "Matcher" matcher_name - ; wrapper <- maybe (return Nothing) (fmap Just . tcExt "Wrapper") wrapper_name + ; wrapper <- case wrapper_name of + Nothing -> return Nothing + Just wn -> do { wid <- tcExt "Wrapper" wn + ; return (Just wid) } ; argNames <- mapM (newIfaceName . mkVarOccFS) args ; return $ AConLike . PatSynCon $ buildPatSyn name is_infix matcher wrapper argNames } diff --git a/compiler/main/HscTypes.lhs b/compiler/main/HscTypes.lhs index d0f59a1..875badf 100644 --- a/compiler/main/HscTypes.lhs +++ b/compiler/main/HscTypes.lhs @@ -1505,15 +1505,17 @@ implicitTyThings :: TyThing -> [TyThing] implicitTyThings (AnId _) = [] implicitTyThings (ACoAxiom _cc) = [] implicitTyThings (ATyCon tc) = implicitTyConThings tc -implicitTyThings (AConLike cl) = case cl of - RealDataCon dc -> - -- For data cons add the worker and (possibly) wrapper - map AnId (dataConImplicitIds dc) - PatSynCon ps -> - -- For bidirectional pattern synonyms, add the wrapper - case patSynWrapper ps of - Nothing -> [] - Just id -> [AnId id] +implicitTyThings (AConLike cl) = implicitConLikeThings cl + +implicitConLikeThings :: ConLike -> [TyThing] +implicitConLikeThings (RealDataCon dc) + = map AnId (dataConImplicitIds dc) + -- For data cons add the worker and (possibly) wrapper + +implicitConLikeThings (PatSynCon {}) + = [] -- Pattern synonyms have no implicit Ids; the wrapper and matcher + -- are not "implicit"; they are simply new top-level bindings, + -- and they have their own declaration in an interface fiel implicitClassThings :: Class -> [TyThing] implicitClassThings cl From git at git.haskell.org Sun May 25 07:22:42 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 25 May 2014 07:22:42 +0000 (UTC) Subject: [commit: ghc] wip/pattern-synonyms: Move comments around and re-factor psTheta (f2d60d2) Message-ID: <20140525072242.F40752406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/pattern-synonyms Link : http://ghc.haskell.org/trac/ghc/changeset/f2d60d2d928ffb9703712ed72873829d506031b7/ghc >--------------------------------------------------------------- commit f2d60d2d928ffb9703712ed72873829d506031b7 Author: Simon Peyton Jones Date: Tue Apr 29 13:11:33 2014 +0100 Move comments around and re-factor psTheta Cosmetic changes only in here. The only significant change is splitting psTheta into two fields >--------------------------------------------------------------- f2d60d2d928ffb9703712ed72873829d506031b7 compiler/basicTypes/PatSyn.lhs | 83 +++++++++++++++++++++++++++++++++-------- compiler/typecheck/TcPat.lhs | 2 +- compiler/typecheck/TcPatSyn.lhs | 57 +--------------------------- 3 files changed, 70 insertions(+), 72 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc f2d60d2d928ffb9703712ed72873829d506031b7 From git at git.haskell.org Sun May 25 07:22:45 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 25 May 2014 07:22:45 +0000 (UTC) Subject: [commit: ghc] wip/pattern-synonyms: Store IfExtNames for PatSyn matchers and wrappers in interface file (005b078) Message-ID: <20140525072245.838A62406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/pattern-synonyms Link : http://ghc.haskell.org/trac/ghc/changeset/005b0788f6f5e37b364481fc61b7e93c9fa4670e/ghc >--------------------------------------------------------------- commit 005b0788f6f5e37b364481fc61b7e93c9fa4670e Author: Dr. ERDI Gergo Date: Fri Apr 18 19:21:37 2014 +0800 Store IfExtNames for PatSyn matchers and wrappers in interface file >--------------------------------------------------------------- 005b0788f6f5e37b364481fc61b7e93c9fa4670e compiler/iface/IfaceSyn.lhs | 21 ++++++++++++++------- compiler/iface/MkIface.lhs | 6 +++++- compiler/iface/TcIface.lhs | 9 ++++++--- 3 files changed, 25 insertions(+), 11 deletions(-) diff --git a/compiler/iface/IfaceSyn.lhs b/compiler/iface/IfaceSyn.lhs index fb194e0..ec4fbea 100644 --- a/compiler/iface/IfaceSyn.lhs +++ b/compiler/iface/IfaceSyn.lhs @@ -60,6 +60,7 @@ import HsBinds import Control.Monad import System.IO.Unsafe +import Data.Maybe ( isJust ) infixl 3 &&& \end{code} @@ -121,8 +122,9 @@ data IfaceDecl ifExtName :: Maybe FastString } | IfacePatSyn { ifName :: OccName, -- Name of the pattern synonym - ifPatHasWrapper :: Bool, ifPatIsInfix :: Bool, + ifPatMatcher :: IfExtName, + ifPatWrapper :: Maybe IfExtName, ifPatUnivTvs :: [IfaceTvBndr], ifPatExTvs :: [IfaceTvBndr], ifPatProvCtxt :: IfaceContext, @@ -187,7 +189,7 @@ instance Binary IfaceDecl where put_ bh a3 put_ bh a4 - put_ bh (IfacePatSyn name a2 a3 a4 a5 a6 a7 a8 a9) = do + put_ bh (IfacePatSyn name a2 a3 a4 a5 a6 a7 a8 a9 a10) = do putByte bh 6 put_ bh (occNameFS name) put_ bh a2 @@ -198,6 +200,7 @@ instance Binary IfaceDecl where put_ bh a7 put_ bh a8 put_ bh a9 + put_ bh a10 get bh = do h <- getByte bh @@ -254,8 +257,9 @@ instance Binary IfaceDecl where a7 <- get bh a8 <- get bh a9 <- get bh + a10 <- get bh occ <- return $! mkOccNameFS dataName a1 - return (IfacePatSyn occ a2 a3 a4 a5 a6 a7 a8 a9) + return (IfacePatSyn occ a2 a3 a4 a5 a6 a7 a8 a9 a10) _ -> panic (unwords ["Unknown IfaceDecl tag:", show h]) data IfaceSynTyConRhs @@ -1016,10 +1020,10 @@ ifaceDeclImplicitBndrs (IfaceClass {ifCtxt = sc_ctxt, ifName = cls_tc_occ, dc_occ = mkClassDataConOcc cls_tc_occ is_newtype = n_sigs + n_ctxt == 1 -- Sigh -ifaceDeclImplicitBndrs (IfacePatSyn{ ifName = ps_occ, ifPatHasWrapper = has_wrapper }) - = [wrap_occ | has_wrapper] +ifaceDeclImplicitBndrs (IfacePatSyn{ ifName = ps_occ, ifPatWrapper = wrapper_name }) + = [wrap_occ | isJust wrapper_name] where - wrap_occ = mkDataConWrapperOcc ps_occ -- Id namespace + wrap_occ = mkDataConWrapperOcc ps_occ ifaceDeclImplicitBndrs _ = [] @@ -1104,7 +1108,7 @@ pprIfaceDecl (IfaceAxiom {ifName = name, ifTyCon = tycon, ifAxBranches = branche = hang (ptext (sLit "axiom") <+> ppr name <> dcolon) 2 (vcat $ map (pprAxBranch $ Just tycon) branches) -pprIfaceDecl (IfacePatSyn { ifName = name, ifPatHasWrapper = has_wrap, +pprIfaceDecl (IfacePatSyn { ifName = name, ifPatWrapper = wrapper, ifPatIsInfix = is_infix, ifPatUnivTvs = _univ_tvs, ifPatExTvs = _ex_tvs, ifPatProvCtxt = prov_ctxt, ifPatReqCtxt = req_ctxt, @@ -1112,6 +1116,7 @@ pprIfaceDecl (IfacePatSyn { ifName = name, ifPatHasWrapper = has_wrap, ifPatTy = ty }) = pprPatSynSig name has_wrap args' ty' (pprCtxt prov_ctxt) (pprCtxt req_ctxt) where + has_wrap = isJust wrapper args' = case (is_infix, map snd args) of (True, [left_ty, right_ty]) -> InfixPatSyn (pprParendIfaceType left_ty) (pprParendIfaceType right_ty) @@ -1393,6 +1398,8 @@ freeNamesIfDecl d at IfaceAxiom{} = freeNamesIfTc (ifTyCon d) &&& fnList freeNamesIfAxBranch (ifAxBranches d) freeNamesIfDecl d at IfacePatSyn{} = + unitNameSet (ifPatMatcher d) &&& + maybe emptyNameSet unitNameSet (ifPatWrapper d) &&& freeNamesIfTvBndrs (ifPatUnivTvs d) &&& freeNamesIfTvBndrs (ifPatExTvs d) &&& freeNamesIfContext (ifPatProvCtxt d) &&& diff --git a/compiler/iface/MkIface.lhs b/compiler/iface/MkIface.lhs index 6c87961..4a26906 100644 --- a/compiler/iface/MkIface.lhs +++ b/compiler/iface/MkIface.lhs @@ -1490,7 +1490,8 @@ dataConToIfaceDecl dataCon patSynToIfaceDecl :: PatSyn -> IfaceDecl patSynToIfaceDecl ps = IfacePatSyn { ifName = getOccName . getName $ ps - , ifPatHasWrapper = isJust $ patSynWrapper ps + , ifPatMatcher = matcher + , ifPatWrapper = wrapper , ifPatIsInfix = patSynIsInfix ps , ifPatUnivTvs = toIfaceTvBndrs univ_tvs' , ifPatExTvs = toIfaceTvBndrs ex_tvs' @@ -1509,6 +1510,9 @@ patSynToIfaceDecl ps (env1, univ_tvs') = tidyTyVarBndrs emptyTidyEnv univ_tvs (env2, ex_tvs') = tidyTyVarBndrs env1 ex_tvs + matcher = idName (patSynMatcher ps) + wrapper = fmap idName (patSynWrapper ps) + -------------------------- coAxiomToIfaceDecl :: CoAxiom br -> IfaceDecl diff --git a/compiler/iface/TcIface.lhs b/compiler/iface/TcIface.lhs index 980796a..85a2c7d 100644 --- a/compiler/iface/TcIface.lhs +++ b/compiler/iface/TcIface.lhs @@ -584,7 +584,8 @@ tc_iface_decl _ _ (IfaceAxiom { ifName = ax_occ, ifTyCon = tc ; return (ACoAxiom axiom) } tc_iface_decl _ _ (IfacePatSyn{ ifName = occ_name - , ifPatHasWrapper = has_wrapper + , ifPatMatcher = matcher_name + , ifPatWrapper = wrapper_name , ifPatIsInfix = is_infix , ifPatUnivTvs = univ_tvs , ifPatExTvs = ex_tvs @@ -594,6 +595,8 @@ tc_iface_decl _ _ (IfacePatSyn{ ifName = occ_name , ifPatTy = pat_ty }) = do { name <- lookupIfaceTop occ_name ; traceIf (ptext (sLit "tc_iface_decl") <+> ppr name) + ; _matcher <- tcExt "Matcher" matcher_name + ; wrapper <- maybe (return Nothing) (fmap Just . tcExt "Wrapper") wrapper_name ; bindIfaceTyVars univ_tvs $ \univ_tvs -> do { bindIfaceTyVars ex_tvs $ \ex_tvs -> do { bindIfaceIdVars args $ \args -> do @@ -603,11 +606,11 @@ tc_iface_decl _ _ (IfacePatSyn{ ifName = occ_name ; pat_ty <- tcIfaceType pat_ty ; return (prov_theta, req_theta, pat_ty) } ; bindIfaceTyVar (fsLit "r", toIfaceKind liftedTypeKind) $ \tv -> do - { patsyn <- buildPatSyn name is_infix has_wrapper args univ_tvs ex_tvs prov_theta req_theta pat_ty tv + { patsyn <- buildPatSyn name is_infix (isJust wrapper) args univ_tvs ex_tvs prov_theta req_theta pat_ty tv ; return (AConLike (PatSynCon patsyn)) }}}}} where mk_doc n = ptext (sLit "Pattern synonym") <+> ppr n - + tcExt s name = forkM (ptext (sLit s) <+> ppr name) $ tcIfaceExtId name tc_ax_branches :: TyCon -> [IfaceAxBranch] -> IfL [CoAxBranch] tc_ax_branches tc if_branches = foldlM (tc_ax_branch (tyConKind tc)) [] if_branches From git at git.haskell.org Sun May 25 07:22:47 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 25 May 2014 07:22:47 +0000 (UTC) Subject: [commit: ghc] wip/pattern-synonyms: Reconstruct patsyn type from matcher type (e0108c6) Message-ID: <20140525072247.E5B6B2406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/pattern-synonyms Link : http://ghc.haskell.org/trac/ghc/changeset/e0108c62e48a382a27b1ab41d83b547b882fdb87/ghc >--------------------------------------------------------------- commit e0108c62e48a382a27b1ab41d83b547b882fdb87 Author: Dr. ERDI Gergo Date: Fri Apr 18 23:39:19 2014 +0800 Reconstruct patsyn type from matcher type >--------------------------------------------------------------- e0108c62e48a382a27b1ab41d83b547b882fdb87 compiler/iface/BuildTyCl.lhs | 31 ++++++++++++++----------- compiler/iface/IfaceSyn.lhs | 55 ++++++++------------------------------------ compiler/iface/MkIface.lhs | 16 ++----------- compiler/iface/TcIface.lhs | 36 ++++------------------------- 4 files changed, 33 insertions(+), 105 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc e0108c62e48a382a27b1ab41d83b547b882fdb87 From git at git.haskell.org Sun May 25 07:22:50 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 25 May 2014 07:22:50 +0000 (UTC) Subject: [commit: ghc] wip/pattern-synonyms: Fold mkPatSyn{Matcher, Wrapper}Id into TcPatSyn (fac9054) Message-ID: <20140525072253.676BD2406F@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/pattern-synonyms Link : http://ghc.haskell.org/trac/ghc/changeset/fac9054210a2ce4a51f987d667d8744d130fd8a7/ghc >--------------------------------------------------------------- commit fac9054210a2ce4a51f987d667d8744d130fd8a7 Author: Dr. ERDI Gergo Date: Fri Apr 18 19:50:04 2014 +0800 Fold mkPatSyn{Matcher,Wrapper}Id into TcPatSyn >--------------------------------------------------------------- fac9054210a2ce4a51f987d667d8744d130fd8a7 compiler/iface/BuildTyCl.lhs | 56 ++++------------------------------------- compiler/iface/TcIface.lhs | 7 +++--- compiler/typecheck/TcPatSyn.lhs | 30 ++++++++++++---------- 3 files changed, 25 insertions(+), 68 deletions(-) diff --git a/compiler/iface/BuildTyCl.lhs b/compiler/iface/BuildTyCl.lhs index d0e3232..0d6fb43 100644 --- a/compiler/iface/BuildTyCl.lhs +++ b/compiler/iface/BuildTyCl.lhs @@ -16,7 +16,7 @@ module BuildTyCl ( buildSynTyCon, buildAlgTyCon, buildDataCon, - buildPatSyn, mkPatSynMatcherId, mkPatSynWrapperId, + buildPatSyn, TcMethInfo, buildClass, distinctAbstractTyConRhs, totallyAbstractTyConRhs, mkNewTyConRhs, mkDataTyConRhs, @@ -37,8 +37,6 @@ import MkId import Class import TyCon import Type -import TypeRep -import TcType import Id import Coercion @@ -185,24 +183,15 @@ mkDataConStupidTheta tycon arg_tys univ_tvs ------------------------------------------------------ -buildPatSyn :: Name -> Bool -> Bool +buildPatSyn :: Name -> Bool + -> Id -> Maybe Id -> [Var] -> [TyVar] -> [TyVar] -- Univ and ext -> ThetaType -> ThetaType -- Prov and req -> Type -- Result type - -> TyVar -> TcRnIf m n PatSyn -buildPatSyn src_name declared_infix has_wrapper args univ_tvs ex_tvs prov_theta req_theta pat_ty tv - = do { (matcher, _, _) <- mkPatSynMatcherId src_name args - univ_tvs ex_tvs - prov_theta req_theta - pat_ty tv - ; wrapper <- case has_wrapper of - False -> return Nothing - True -> fmap Just $ - mkPatSynWrapperId src_name args - (univ_tvs ++ ex_tvs) (prov_theta ++ req_theta) - pat_ty +buildPatSyn src_name declared_infix matcher wrapper args univ_tvs ex_tvs prov_theta req_theta pat_ty + = do { pprTrace "buildPatSyn: matcher:" (ppr (idType matcher)) $ return () ; return $ mkPatSyn src_name declared_infix args univ_tvs ex_tvs @@ -211,41 +200,6 @@ buildPatSyn src_name declared_infix has_wrapper args univ_tvs ex_tvs prov_theta matcher wrapper } -mkPatSynMatcherId :: Name - -> [Var] - -> [TyVar] - -> [TyVar] - -> ThetaType -> ThetaType - -> Type - -> TyVar - -> TcRnIf n m (Id, Type, Type) -mkPatSynMatcherId name args univ_tvs ex_tvs prov_theta req_theta pat_ty res_tv - = do { matcher_name <- newImplicitBinder name mkMatcherOcc - - ; let res_ty = TyVarTy res_tv - cont_ty = mkSigmaTy ex_tvs prov_theta $ - mkFunTys (map varType args) res_ty - - ; let matcher_tau = mkFunTys [pat_ty, cont_ty, res_ty] res_ty - matcher_sigma = mkSigmaTy (res_tv:univ_tvs) req_theta matcher_tau - matcher_id = mkVanillaGlobal matcher_name matcher_sigma - ; return (matcher_id, res_ty, cont_ty) } - -mkPatSynWrapperId :: Name - -> [Var] - -> [TyVar] - -> ThetaType - -> Type - -> TcRnIf n m Id -mkPatSynWrapperId name args qtvs theta pat_ty - = do { wrapper_name <- newImplicitBinder name mkDataConWrapperOcc - - ; let wrapper_tau = mkFunTys (map varType args) pat_ty - wrapper_sigma = mkSigmaTy qtvs theta wrapper_tau - - ; let wrapper_id = mkVanillaGlobal wrapper_name wrapper_sigma - ; return wrapper_id } - \end{code} diff --git a/compiler/iface/TcIface.lhs b/compiler/iface/TcIface.lhs index 85a2c7d..06f402d 100644 --- a/compiler/iface/TcIface.lhs +++ b/compiler/iface/TcIface.lhs @@ -595,7 +595,7 @@ tc_iface_decl _ _ (IfacePatSyn{ ifName = occ_name , ifPatTy = pat_ty }) = do { name <- lookupIfaceTop occ_name ; traceIf (ptext (sLit "tc_iface_decl") <+> ppr name) - ; _matcher <- tcExt "Matcher" matcher_name + ; matcher <- tcExt "Matcher" matcher_name ; wrapper <- maybe (return Nothing) (fmap Just . tcExt "Wrapper") wrapper_name ; bindIfaceTyVars univ_tvs $ \univ_tvs -> do { bindIfaceTyVars ex_tvs $ \ex_tvs -> do @@ -605,9 +605,8 @@ tc_iface_decl _ _ (IfacePatSyn{ ifName = occ_name ; req_theta <- tcIfaceCtxt req_ctxt ; pat_ty <- tcIfaceType pat_ty ; return (prov_theta, req_theta, pat_ty) } - ; bindIfaceTyVar (fsLit "r", toIfaceKind liftedTypeKind) $ \tv -> do - { patsyn <- buildPatSyn name is_infix (isJust wrapper) args univ_tvs ex_tvs prov_theta req_theta pat_ty tv - ; return (AConLike (PatSynCon patsyn)) }}}}} + ; patsyn <- buildPatSyn name is_infix matcher wrapper args univ_tvs ex_tvs prov_theta req_theta pat_ty + ; return (AConLike (PatSynCon patsyn)) }}}} where mk_doc n = ptext (sLit "Pattern synonym") <+> ppr n tcExt s name = forkM (ptext (sLit s) <+> ppr name) $ tcIfaceExtId name diff --git a/compiler/typecheck/TcPatSyn.lhs b/compiler/typecheck/TcPatSyn.lhs index 7c9f876..30b18c7 100644 --- a/compiler/typecheck/TcPatSyn.lhs +++ b/compiler/typecheck/TcPatSyn.lhs @@ -33,6 +33,7 @@ import Data.Monoid import Bag import TcEvidence import BuildTyCl +import TypeRep #include "HsVersions.h" \end{code} @@ -176,10 +177,15 @@ tcPatSynMatcher :: Located Name -> TcM (Id, LHsBinds Id) tcPatSynMatcher (L loc name) lpat args univ_tvs ex_tvs ev_binds prov_dicts req_dicts prov_theta req_theta pat_ty = do { res_tv <- zonkQuantifiedTyVar =<< newFlexiTyVar liftedTypeKind - ; (matcher_id, res_ty, cont_ty) <- mkPatSynMatcherId name args - univ_tvs ex_tvs - prov_theta req_theta - pat_ty res_tv + ; matcher_name <- newImplicitBinder name mkMatcherOcc + ; let res_ty = TyVarTy res_tv + cont_ty = mkSigmaTy ex_tvs prov_theta $ + mkFunTys (map varType args) res_ty + + ; let matcher_tau = mkFunTys [pat_ty, cont_ty, res_ty] res_ty + matcher_sigma = mkSigmaTy (res_tv:univ_tvs) req_theta matcher_tau + matcher_id = mkVanillaGlobal matcher_name matcher_sigma + ; traceTc "tcPatSynMatcher" (ppr name $$ ppr (idType matcher_id)) ; let matcher_lid = L loc matcher_id @@ -262,18 +268,16 @@ tc_pat_syn_wrapper_from_expr :: Located Name -> TcM (Id, LHsBinds Id) tc_pat_syn_wrapper_from_expr (L loc name) lexpr args univ_tvs ex_tvs theta pat_ty = do { let qtvs = univ_tvs ++ ex_tvs - ; (subst, qtvs') <- tcInstSkolTyVars qtvs - ; let theta' = substTheta subst theta + ; (subst, wrapper_tvs) <- tcInstSkolTyVars qtvs + ; let wrapper_theta = substTheta subst theta pat_ty' = substTy subst pat_ty args' = map (\arg -> setVarType arg $ substTy subst (varType arg)) args - - ; wrapper_id <- mkPatSynWrapperId name args qtvs theta pat_ty - ; let wrapper_name = getName wrapper_id - wrapper_lname = L loc wrapper_name - -- (wrapper_tvs, wrapper_theta, wrapper_tau) = tcSplitSigmaTy (idType wrapper_id) - wrapper_tvs = qtvs' - wrapper_theta = theta' wrapper_tau = mkFunTys (map varType args') pat_ty' + wrapper_sigma = mkSigmaTy wrapper_tvs wrapper_theta wrapper_tau + + ; wrapper_name <- newImplicitBinder name mkDataConWrapperOcc + ; let wrapper_lname = L loc wrapper_name + wrapper_id = mkVanillaGlobal wrapper_name wrapper_sigma ; let wrapper_args = map (noLoc . VarPat . Var.varName) args' wrapper_match = mkMatch wrapper_args lexpr EmptyLocalBinds From git at git.haskell.org Sun May 25 07:22:53 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 25 May 2014 07:22:53 +0000 (UTC) Subject: [commit: ghc] wip/pattern-synonyms: Comments and tracing only (fd75cea) Message-ID: <20140525072254.1421F2406B@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/pattern-synonyms Link : http://ghc.haskell.org/trac/ghc/changeset/fd75ceae17d99e183c7c43c1b94511f21839da3d/ghc >--------------------------------------------------------------- commit fd75ceae17d99e183c7c43c1b94511f21839da3d Author: Simon Peyton Jones Date: Tue Apr 29 13:11:51 2014 +0100 Comments and tracing only >--------------------------------------------------------------- fd75ceae17d99e183c7c43c1b94511f21839da3d compiler/coreSyn/CorePrep.lhs | 1 + compiler/iface/LoadIface.lhs | 3 ++- compiler/main/TidyPgm.lhs | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/compiler/coreSyn/CorePrep.lhs b/compiler/coreSyn/CorePrep.lhs index 60cb60e..c754aae 100644 --- a/compiler/coreSyn/CorePrep.lhs +++ b/compiler/coreSyn/CorePrep.lhs @@ -196,6 +196,7 @@ corePrepTopBinds initialCorePrepEnv binds mkDataConWorkers :: [TyCon] -> [CoreBind] -- See Note [Data constructor workers] +-- c.f. Note [Injecting implicit bindings] in TidyPgm mkDataConWorkers data_tycons = [ NonRec id (Var id) -- The ice is thin here, but it works | tycon <- data_tycons, -- CorePrep will eta-expand it diff --git a/compiler/iface/LoadIface.lhs b/compiler/iface/LoadIface.lhs index 2824d92..30b2f0b 100644 --- a/compiler/iface/LoadIface.lhs +++ b/compiler/iface/LoadIface.lhs @@ -417,7 +417,6 @@ loadDecl ignore_prags mod (_version, decl) = do { -- Populate the name cache with final versions of all -- the names associated with the decl main_name <- lookupOrig mod (ifName decl) --- ; traceIf (text "Loading decl for " <> ppr main_name) -- Typecheck the thing, lazily -- NB. Firstly, the laziness is there in case we never need the @@ -491,6 +490,8 @@ loadDecl ignore_prags mod (_version, decl) pprPanic "loadDecl" (ppr main_name <+> ppr n $$ ppr (decl)) ; implicit_names <- mapM (lookupOrig mod) (ifaceDeclImplicitBndrs decl) + +-- ; traceIf (text "Loading decl for " <> ppr main_name $$ ppr implicit_names) ; return $ (main_name, thing) : -- uses the invariant that implicit_names and -- implictTyThings are bijective diff --git a/compiler/main/TidyPgm.lhs b/compiler/main/TidyPgm.lhs index b299015..e974c82 100644 --- a/compiler/main/TidyPgm.lhs +++ b/compiler/main/TidyPgm.lhs @@ -562,7 +562,7 @@ Oh: two other reasons for injecting them late: There is one sort of implicit binding that is injected still later, namely those for data constructor workers. Reason (I think): it's really just a code generation trick.... binding itself makes no sense. -See CorePrep Note [Data constructor workers]. +See Note [Data constructor workers] in CorePrep. \begin{code} getTyConImplicitBinds :: TyCon -> [CoreBind] From git at git.haskell.org Sun May 25 07:22:55 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 25 May 2014 07:22:55 +0000 (UTC) Subject: [commit: ghc] wip/pattern-synonyms: Update Haddock to new PatSyn representation (a3e52bb) Message-ID: <20140525072255.B04A12406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/pattern-synonyms Link : http://ghc.haskell.org/trac/ghc/changeset/a3e52bbd4c2af0bb3124d313a294dccd783cb7fd/ghc >--------------------------------------------------------------- commit a3e52bbd4c2af0bb3124d313a294dccd783cb7fd Author: Dr. ERDI Gergo Date: Sun May 25 15:22:22 2014 +0800 Update Haddock to new PatSyn representation >--------------------------------------------------------------- a3e52bbd4c2af0bb3124d313a294dccd783cb7fd utils/haddock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/haddock b/utils/haddock index a19af87..57aa591 160000 --- a/utils/haddock +++ b/utils/haddock @@ -1 +1 @@ -Subproject commit a19af87d6bfee1abc6c179f79eb391b381a26d81 +Subproject commit 57aa591362d7c8ba21285fccd6a958629a422091 From git at git.haskell.org Mon May 26 14:25:55 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 26 May 2014 14:25:55 +0000 (UTC) Subject: [commit: ghc] master: Fix yet another bug in 'deriving' for polykinded classes (Trac #7269) (b1436f5) Message-ID: <20140526142555.B044C2406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/b1436f55da2b0e005ac09be6651a2c4d934027ec/ghc >--------------------------------------------------------------- commit b1436f55da2b0e005ac09be6651a2c4d934027ec Author: Simon Peyton Jones Date: Mon May 26 15:25:30 2014 +0100 Fix yet another bug in 'deriving' for polykinded classes (Trac #7269) This patch makes the code a bit simpler if anything. >--------------------------------------------------------------- b1436f55da2b0e005ac09be6651a2c4d934027ec compiler/typecheck/TcDeriv.lhs | 26 +++++++--------------- compiler/typecheck/TcHsType.lhs | 24 +++++++++++--------- testsuite/tests/deriving/should_compile/all.T | 1 + testsuite/tests/deriving/should_fail/T7959.stderr | 2 +- .../tests/deriving/should_fail/drvfail005.stderr | 4 ++-- .../tests/deriving/should_fail/drvfail009.stderr | 6 ++--- 6 files changed, 29 insertions(+), 34 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc b1436f55da2b0e005ac09be6651a2c4d934027ec From git at git.haskell.org Mon May 26 16:03:41 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 26 May 2014 16:03:41 +0000 (UTC) Subject: [commit: ghc] master: Add missing test file T7269 (db869e7) Message-ID: <20140526160341.52EEA2406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/db869e7521387db0513d1dc2b49641ce32688cdd/ghc >--------------------------------------------------------------- commit db869e7521387db0513d1dc2b49641ce32688cdd Author: Simon Peyton Jones Date: Mon May 26 17:03:23 2014 +0100 Add missing test file T7269 >--------------------------------------------------------------- db869e7521387db0513d1dc2b49641ce32688cdd testsuite/tests/deriving/should_compile/T7269.hs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/testsuite/tests/deriving/should_compile/T7269.hs b/testsuite/tests/deriving/should_compile/T7269.hs new file mode 100644 index 0000000..2d7331b --- /dev/null +++ b/testsuite/tests/deriving/should_compile/T7269.hs @@ -0,0 +1,13 @@ +{-# LANGUAGE PolyKinds #-} +{-# LANGUAGE MultiParamTypeClasses, StandaloneDeriving, GeneralizedNewtypeDeriving #-} + +module T7269 where + +class C (a :: k) + +instance C Int + +newtype MyInt = MyInt Int deriving C + +newtype YourInt = YourInt Int +deriving instance C YourInt From git at git.haskell.org Tue May 27 11:56:35 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 27 May 2014 11:56:35 +0000 (UTC) Subject: [commit: ghc] master: Replace DeriveDataTypeable by AutoDeriveTypeable (6ed5430) Message-ID: <20140527115635.B3F0A2406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/6ed54303e2d3f1ef19df1312331a1740eca3ccdc/ghc >--------------------------------------------------------------- commit 6ed54303e2d3f1ef19df1312331a1740eca3ccdc Author: Herbert Valerio Riedel Date: Tue May 27 13:49:30 2014 +0200 Replace DeriveDataTypeable by AutoDeriveTypeable This is a first step towards addressing #9111 This results in the following additional Typeable (exported) instances being generated (list was compiled by diff'ing hoogle txt output): instance Typeable CFile instance Typeable 'CFile instance Typeable CFpos instance Typeable 'CFpos instance Typeable CJmpBuf instance Typeable 'CJmpBuf instance Typeable ChItem instance Typeable QSem instance Typeable ID instance Typeable 'ID instance Typeable CONST instance Typeable Qi instance Typeable Qr instance Typeable Mp instance Typeable ConstrRep instance Typeable Fixity instance Typeable 'Prefix instance Typeable 'Infix instance Typeable Constr instance Typeable DataType instance Typeable DataRep instance Typeable Data instance Typeable HasResolution instance Typeable IsList Signed-off-by: Herbert Valerio Riedel >--------------------------------------------------------------- 6ed54303e2d3f1ef19df1312331a1740eca3ccdc libraries/base/Control/Concurrent/Chan.hs | 2 +- libraries/base/Control/Concurrent/QSem.hs | 2 +- libraries/base/Control/Concurrent/QSemN.hs | 2 +- libraries/base/Control/Exception/Base.hs | 2 +- libraries/base/Data/Coerce.hs | 2 +- libraries/base/Data/Complex.hs | 2 +- libraries/base/Data/Data.hs | 2 +- libraries/base/Data/Dynamic.hs | 2 +- libraries/base/Data/Either.hs | 2 +- libraries/base/Data/Fixed.hs | 2 +- libraries/base/Data/Unique.hs | 2 +- libraries/base/Data/Version.hs | 2 +- libraries/base/Foreign/C/Types.hs | 2 +- libraries/base/Foreign/Ptr.hs | 2 +- libraries/base/GHC/Conc/Windows.hs | 2 +- libraries/base/GHC/Exts.hs | 2 +- libraries/base/GHC/ForeignPtr.hs | 2 +- libraries/base/GHC/IO/Exception.hs | 2 +- libraries/base/GHC/IO/FD.hs | 2 +- libraries/base/GHC/IO/Handle/Types.hs | 2 +- libraries/base/GHC/IOArray.hs | 2 +- libraries/base/GHC/IORef.hs | 2 +- libraries/base/GHC/Int.hs | 2 +- libraries/base/GHC/MVar.hs | 2 +- libraries/base/System/Mem/StableName.hs | 2 +- libraries/base/System/Posix/Types.hs | 2 +- libraries/base/System/Timeout.hs | 2 +- libraries/base/base.cabal | 1 + 28 files changed, 28 insertions(+), 27 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 6ed54303e2d3f1ef19df1312331a1740eca3ccdc From git at git.haskell.org Tue May 27 12:03:39 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 27 May 2014 12:03:39 +0000 (UTC) Subject: [commit: ghc] wip/pattern-synonyms: No need to store argument names (just types) in PatSyn (0b81bca) Message-ID: <20140527120339.E2BFB2406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/pattern-synonyms Link : http://ghc.haskell.org/trac/ghc/changeset/0b81bcaf368eb4b81f8d12d53ed6e8c322491e60/ghc >--------------------------------------------------------------- commit 0b81bcaf368eb4b81f8d12d53ed6e8c322491e60 Author: Dr. ERDI Gergo Date: Tue May 27 19:13:01 2014 +0800 No need to store argument names (just types) in PatSyn >--------------------------------------------------------------- 0b81bcaf368eb4b81f8d12d53ed6e8c322491e60 compiler/basicTypes/PatSyn.lhs | 20 ++++++++------------ compiler/iface/BuildTyCl.lhs | 7 ++----- compiler/iface/IfaceSyn.lhs | 9 +++------ compiler/iface/MkIface.lhs | 4 +--- compiler/iface/TcIface.lhs | 6 ++---- compiler/typecheck/TcPat.lhs | 2 +- compiler/typecheck/TcPatSyn.lhs | 2 +- 7 files changed, 18 insertions(+), 32 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 0b81bcaf368eb4b81f8d12d53ed6e8c322491e60 From git at git.haskell.org Tue May 27 12:03:42 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 27 May 2014 12:03:42 +0000 (UTC) Subject: [commit: ghc] wip/pattern-synonyms: Revert "Reconstruct patsyn type from matcher type" (9883474) Message-ID: <20140527120342.7229F2406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/pattern-synonyms Link : http://ghc.haskell.org/trac/ghc/changeset/9883474b53176c022920c066989f8d542221639a/ghc >--------------------------------------------------------------- commit 9883474b53176c022920c066989f8d542221639a Author: Dr. ERDI Gergo Date: Tue May 27 20:02:47 2014 +0800 Revert "Reconstruct patsyn type from matcher type" >--------------------------------------------------------------- 9883474b53176c022920c066989f8d542221639a compiler/iface/BuildTyCl.lhs | 16 ++++++++---- compiler/iface/IfaceSyn.lhs | 61 ++++++++++++++++++++++++++++++++++++-------- compiler/iface/MkIface.lhs | 13 +++++++++- compiler/iface/TcIface.lhs | 22 +++++++++++++--- 4 files changed, 93 insertions(+), 19 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 9883474b53176c022920c066989f8d542221639a From git at git.haskell.org Tue May 27 13:17:00 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 27 May 2014 13:17:00 +0000 (UTC) Subject: [commit: ghc] master: Store IfExtNames for PatSyn matchers and wrappers in interface file. This way, the Ids for the matchers/wrappers are reused by importing modules, and thus unfoldings are kept. (ac2796e) Message-ID: <20140527131700.AB9D42406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/ac2796e6ddbd54c5762c53e2fcf29f20ea162fd5/ghc >--------------------------------------------------------------- commit ac2796e6ddbd54c5762c53e2fcf29f20ea162fd5 Author: Dr. ERDI Gergo Date: Tue May 27 21:16:41 2014 +0800 Store IfExtNames for PatSyn matchers and wrappers in interface file. This way, the Ids for the matchers/wrappers are reused by importing modules, and thus unfoldings are kept. Also updates haddock submodule to accomodate tweaks in PatSyn representation >--------------------------------------------------------------- ac2796e6ddbd54c5762c53e2fcf29f20ea162fd5 compiler/basicTypes/PatSyn.lhs | 103 +++++++++++++++++++++++++++++----------- compiler/coreSyn/CorePrep.lhs | 1 + compiler/iface/BuildTyCl.lhs | 81 ++++++++----------------------- compiler/iface/IfaceSyn.lhs | 28 ++++++----- compiler/iface/LoadIface.lhs | 3 +- compiler/iface/MkIface.lhs | 13 ++--- compiler/iface/TcIface.lhs | 35 +++++--------- compiler/main/HscTypes.lhs | 20 ++++---- compiler/main/TidyPgm.lhs | 2 +- compiler/typecheck/TcPat.lhs | 4 +- compiler/typecheck/TcPatSyn.lhs | 89 ++++++++-------------------------- utils/haddock | 2 +- 12 files changed, 170 insertions(+), 211 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc ac2796e6ddbd54c5762c53e2fcf29f20ea162fd5 From git at git.haskell.org Tue May 27 14:14:07 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 27 May 2014 14:14:07 +0000 (UTC) Subject: [commit: ghc] master: Assert that matcher-derived PatSyn types match the (redundant) stored types in IfacePatSyn (fb74d71) Message-ID: <20140527141407.719D42406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/fb74d71756042fe954b2a82d208041df56a08377/ghc >--------------------------------------------------------------- commit fb74d71756042fe954b2a82d208041df56a08377 Author: Dr. ERDI Gergo Date: Tue May 27 21:48:42 2014 +0800 Assert that matcher-derived PatSyn types match the (redundant) stored types in IfacePatSyn >--------------------------------------------------------------- fb74d71756042fe954b2a82d208041df56a08377 compiler/iface/BuildTyCl.lhs | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/compiler/iface/BuildTyCl.lhs b/compiler/iface/BuildTyCl.lhs index eb5db54..f2d6f7e 100644 --- a/compiler/iface/BuildTyCl.lhs +++ b/compiler/iface/BuildTyCl.lhs @@ -193,7 +193,14 @@ buildPatSyn :: Name -> Bool -> PatSyn buildPatSyn src_name declared_infix matcher wrapper args univ_tvs ex_tvs prov_theta req_theta pat_ty - = mkPatSyn src_name declared_infix + = ASSERT((and [ univ_tvs == univ_tvs' + , ex_tvs == ex_tvs' + , pat_ty `eqType` pat_ty' + , prov_theta `eqTypes` prov_theta' + , req_theta `eqTypes` req_theta' + , args `eqTypes` args' + ])) + mkPatSyn src_name declared_infix args univ_tvs ex_tvs prov_theta req_theta @@ -201,12 +208,10 @@ buildPatSyn src_name declared_infix matcher wrapper matcher wrapper where - -- TODO: assert that these match the ones in the parameters - ((_:_univ_tvs'), _req_theta', tau) = tcSplitSigmaTy $ idType matcher - ([_pat_ty', cont_sigma, _], _) = tcSplitFunTys tau - (_ex_tvs', _prov_theta', cont_tau) = tcSplitSigmaTy cont_sigma - (_args', _) = tcSplitFunTys cont_tau - + ((_:univ_tvs'), req_theta', tau) = tcSplitSigmaTy $ idType matcher + ([pat_ty', cont_sigma, _], _) = tcSplitFunTys tau + (ex_tvs', prov_theta', cont_tau) = tcSplitSigmaTy cont_sigma + (args', _) = tcSplitFunTys cont_tau \end{code} From git at git.haskell.org Tue May 27 22:15:59 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 27 May 2014 22:15:59 +0000 (UTC) Subject: [commit: ghc] master: Test Trac #9144 (2745dfb) Message-ID: <20140527221559.5C0CC2406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/2745dfb56414269ea53e75136166a5ed0452b2af/ghc >--------------------------------------------------------------- commit 2745dfb56414269ea53e75136166a5ed0452b2af Author: Simon Peyton Jones Date: Tue May 27 22:27:44 2014 +0100 Test Trac #9144 >--------------------------------------------------------------- 2745dfb56414269ea53e75136166a5ed0452b2af testsuite/tests/polykinds/T9144.hs | 34 ++++++++++++++++++++++++++++++++++ testsuite/tests/polykinds/T9144.stderr | 7 +++++++ testsuite/tests/polykinds/all.T | 1 + 3 files changed, 42 insertions(+) diff --git a/testsuite/tests/polykinds/T9144.hs b/testsuite/tests/polykinds/T9144.hs new file mode 100644 index 0000000..0a9ef08 --- /dev/null +++ b/testsuite/tests/polykinds/T9144.hs @@ -0,0 +1,34 @@ +{-# LANGUAGE PolyKinds, DataKinds, TypeFamilies, GADTs, RankNTypes #-} + +module T9144 where + +import Data.Proxy +import GHC.TypeLits + +data family Sing (a :: k) + +data SomeSing :: KProxy k -> * where + SomeSing :: forall (a :: k). Sing a -> SomeSing ('KProxy :: KProxy k) + +class kproxy ~ 'KProxy => SingKind (kproxy :: KProxy k) where + fromSing :: forall (a :: k). Sing a -> DemoteRep ('KProxy :: KProxy k) + toSing :: DemoteRep ('KProxy :: KProxy k) -> SomeSing ('KProxy :: KProxy k) + +type family DemoteRep (kproxy :: KProxy k) :: * + +data Foo = Bar Nat +data FooTerm = BarTerm Integer + +data instance Sing (x :: Foo) where + SBar :: Sing n -> Sing (Bar n) + +type instance DemoteRep ('KProxy :: KProxy Nat) = Integer +type instance DemoteRep ('KProxy :: KProxy Foo) = FooTerm + +instance SingKind ('KProxy :: KProxy Nat) where + fromSing = undefined + toSing = undefined + +instance SingKind ('KProxy :: KProxy Foo) where + fromSing (SBar n) = BarTerm (fromSing n) + toSing n = case toSing n of SomeSing n' -> SomeSing (SBar n') diff --git a/testsuite/tests/polykinds/T9144.stderr b/testsuite/tests/polykinds/T9144.stderr new file mode 100644 index 0000000..f2c6553 --- /dev/null +++ b/testsuite/tests/polykinds/T9144.stderr @@ -0,0 +1,7 @@ + +T9144.hs:34:26: + Couldn't match type ?Integer? with ?FooTerm? + Expected type: DemoteRep 'KProxy + Actual type: DemoteRep 'KProxy + In the first argument of ?toSing?, namely ?n? + In the expression: toSing n diff --git a/testsuite/tests/polykinds/all.T b/testsuite/tests/polykinds/all.T index 96faa67..09c7254 100644 --- a/testsuite/tests/polykinds/all.T +++ b/testsuite/tests/polykinds/all.T @@ -101,3 +101,4 @@ test('T7481', normal, compile_fail,['']) test('T8705', normal, compile, ['']) test('T8985', normal, compile, ['']) test('T9106', normal, compile_fail, ['']) +test('T9144', normal, compile_fail, ['']) From git at git.haskell.org Wed May 28 08:17:18 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 28 May 2014 08:17:18 +0000 (UTC) Subject: [commit: ghc] master: T4006, environment001, T3307 all work on msys2 (b95dbb5) Message-ID: <20140528081718.2BBCC2406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/b95dbb516616ed9a1f7b7263a78455ddaa7e80fd/ghc >--------------------------------------------------------------- commit b95dbb516616ed9a1f7b7263a78455ddaa7e80fd Author: Simon Peyton Jones Date: Wed May 28 09:12:34 2014 +0100 T4006, environment001, T3307 all work on msys2 >--------------------------------------------------------------- b95dbb516616ed9a1f7b7263a78455ddaa7e80fd libraries/base/tests/IO/all.T | 6 ++---- libraries/base/tests/all.T | 3 ++- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/libraries/base/tests/IO/all.T b/libraries/base/tests/IO/all.T index 94d75f0..e15c84d 100644 --- a/libraries/base/tests/IO/all.T +++ b/libraries/base/tests/IO/all.T @@ -121,8 +121,7 @@ test('concio002', reqlib('process'), compile_and_run, ['']) test('T2122', extra_clean(['T2122-test']), compile_and_run, ['']) test('T3307', - [when(msys(), expect_fail), # Doesn't work on MSYS; see #5599 - extra_clean(['chinese-file-??', 'chinese-name'])], + [extra_clean(['chinese-file-??', 'chinese-name'])], run_command, ['$MAKE -s --no-print-directory T3307-test']) test('T4855', normal, compile_and_run, ['']) @@ -148,8 +147,7 @@ test('encoding003', normal, compile_and_run, ['']) test('encoding004', normal, compile_and_run, ['']) test('environment001', - [when(msys(), expect_fail), # Doesn't work on MSYS; see #5599 - extra_clean(['environment001'])], + [extra_clean(['environment001'])], run_command, ['$MAKE -s --no-print-directory environment001-test']) diff --git a/libraries/base/tests/all.T b/libraries/base/tests/all.T index 21e3d0c..31c6344 100644 --- a/libraries/base/tests/all.T +++ b/libraries/base/tests/all.T @@ -114,7 +114,8 @@ test('weak001', normal, compile_and_run, ['']) # cat: write error: Permission denied # Seems to be a known problem, e.g. # http://mingw-users.1079350.n2.nabble.com/Bug-re-Unicode-on-the-console-td3121717.html -test('T4006', when(msys(), expect_fail), compile_and_run, ['']) +# May 2014: seems to work on msys2 +test('T4006', normal, compile_and_run, ['']) test('T5943', normal, compile_and_run, ['']) test('T5962', normal, compile_and_run, ['']) From git at git.haskell.org Wed May 28 08:17:20 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 28 May 2014 08:17:20 +0000 (UTC) Subject: [commit: ghc] master: Use mkTcEqPred rather than mkEqPred in the type checker (8668c54) Message-ID: <20140528081720.9AE7B2406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/8668c549e8d558ab27126a743c23b0894ce19523/ghc >--------------------------------------------------------------- commit 8668c549e8d558ab27126a743c23b0894ce19523 Author: Simon Peyton Jones Date: Wed May 28 09:16:16 2014 +0100 Use mkTcEqPred rather than mkEqPred in the type checker Type.mkEqPred has an assertion warning for kind compatibility. But during type checking we may form equality predicates with incompatible kinds; hence TcType.mkTcEqPred, which does not check. We were calling the former instead of the latter in a couple of places, leading to spurious debug warnings. >--------------------------------------------------------------- 8668c549e8d558ab27126a743c23b0894ce19523 compiler/typecheck/TcCanonical.lhs | 2 +- compiler/typecheck/TcErrors.lhs | 2 +- compiler/typecheck/TcSMonad.lhs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/compiler/typecheck/TcCanonical.lhs b/compiler/typecheck/TcCanonical.lhs index 670f4cf..43cbb2c 100644 --- a/compiler/typecheck/TcCanonical.lhs +++ b/compiler/typecheck/TcCanonical.lhs @@ -1262,7 +1262,7 @@ checkKind new_ev s1 k1 s2 k2 -- See Note [Equalities with incompatible kinds] do { traceTcS "canEqLeaf: incompatible kinds" (vcat [ppr k1, ppr k2]) -- Create a derived kind-equality, and solve it - ; mw <- newDerived kind_co_loc (mkEqPred k1 k2) + ; mw <- newDerived kind_co_loc (mkTcEqPred k1 k2) ; case mw of Nothing -> return () Just kev -> emitWorkNC [kev] diff --git a/compiler/typecheck/TcErrors.lhs b/compiler/typecheck/TcErrors.lhs index 4732769..88894b4 100644 --- a/compiler/typecheck/TcErrors.lhs +++ b/compiler/typecheck/TcErrors.lhs @@ -793,7 +793,7 @@ misMatchOrCND ctxt ct oriented ty1 ty2 -- or there is no context, don't report the context = misMatchMsg oriented ty1 ty2 | otherwise - = couldNotDeduce givens ([mkEqPred ty1 ty2], orig) + = couldNotDeduce givens ([mkTcEqPred ty1 ty2], orig) where givens = getUserGivens ctxt orig = TypeEqOrigin { uo_actual = ty1, uo_expected = ty2 } diff --git a/compiler/typecheck/TcSMonad.lhs b/compiler/typecheck/TcSMonad.lhs index 4e391dc..ec9b6e3 100644 --- a/compiler/typecheck/TcSMonad.lhs +++ b/compiler/typecheck/TcSMonad.lhs @@ -1393,7 +1393,7 @@ checkWellStagedDFun pred dfun_id loc bind_lvl = TcM.topIdLvl dfun_id pprEq :: TcType -> TcType -> SDoc -pprEq ty1 ty2 = pprType $ mkEqPred ty1 ty2 +pprEq ty1 ty2 = pprParendType ty1 <+> char '~' <+> pprParendType ty2 isTouchableMetaTyVarTcS :: TcTyVar -> TcS Bool isTouchableMetaTyVarTcS tv From git at git.haskell.org Wed May 28 08:17:22 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 28 May 2014 08:17:22 +0000 (UTC) Subject: [commit: ghc] master: No need to call defaultKind in mkTcEqPred (3c1f2f7) Message-ID: <20140528081723.1EC862406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/3c1f2f74897198638f84f8f3af06a2c80b02b29a/ghc >--------------------------------------------------------------- commit 3c1f2f74897198638f84f8f3af06a2c80b02b29a Author: Simon Peyton Jones Date: Wed May 28 09:16:53 2014 +0100 No need to call defaultKind in mkTcEqPred >--------------------------------------------------------------- 3c1f2f74897198638f84f8f3af06a2c80b02b29a compiler/typecheck/TcType.lhs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/typecheck/TcType.lhs b/compiler/typecheck/TcType.lhs index 530397a..b093d80 100644 --- a/compiler/typecheck/TcType.lhs +++ b/compiler/typecheck/TcType.lhs @@ -736,7 +736,7 @@ mkTcEqPred :: TcType -> TcType -> Type mkTcEqPred ty1 ty2 = mkTyConApp eqTyCon [k, ty1, ty2] where - k = defaultKind (typeKind ty1) + k = typeKind ty1 \end{code} @isTauTy@ tests for nested for-alls. It should not be called on a boxy type. From git at git.haskell.org Wed May 28 15:28:04 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 28 May 2014 15:28:04 +0000 (UTC) Subject: [commit: ghc] master: Fix comment typo (e80089e) Message-ID: <20140528152804.8F0282406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/e80089ecb772a9c8149b0a4f9dc03c57aa22418a/ghc >--------------------------------------------------------------- commit e80089ecb772a9c8149b0a4f9dc03c57aa22418a Author: Jan Stolarek Date: Wed May 28 17:27:29 2014 +0200 Fix comment typo >--------------------------------------------------------------- e80089ecb772a9c8149b0a4f9dc03c57aa22418a compiler/typecheck/TcExpr.lhs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compiler/typecheck/TcExpr.lhs b/compiler/typecheck/TcExpr.lhs index 12f2438..48c4cbf 100644 --- a/compiler/typecheck/TcExpr.lhs +++ b/compiler/typecheck/TcExpr.lhs @@ -500,7 +500,8 @@ for conditionals: to support expressions like this: ifThenElse :: Maybe a -> (a -> b) -> b -> b - ifThenElse (Just a) f _ = f a ifThenElse Nothing _ e = e + ifThenElse (Just a) f _ = f a + ifThenElse Nothing _ e = e example :: String example = if Just 2 From git at git.haskell.org Thu May 29 01:28:40 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 29 May 2014 01:28:40 +0000 (UTC) Subject: [commit: ghc] master: Update Haddock submodule. (a518500) Message-ID: <20140529012840.B02282406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/a518500f46a02219097868d7c11d209ef8ff32fe/ghc >--------------------------------------------------------------- commit a518500f46a02219097868d7c11d209ef8ff32fe Author: Mateusz Kowalczyk Date: Thu May 29 03:26:35 2014 +0200 Update Haddock submodule. This doesn't make any actual changes as to what the source looked like at previous commit we were pointing to but I made some foolish reverts that I now have to accomodate for. Sorry! >--------------------------------------------------------------- a518500f46a02219097868d7c11d209ef8ff32fe utils/haddock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/haddock b/utils/haddock index 57aa591..c4f6201 160000 --- a/utils/haddock +++ b/utils/haddock @@ -1 +1 @@ -Subproject commit 57aa591362d7c8ba21285fccd6a958629a422091 +Subproject commit c4f6201356b29023ecbd2f7bf1c91e5318586765 From git at git.haskell.org Fri May 30 01:36:48 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 30 May 2014 01:36:48 +0000 (UTC) Subject: [commit: ghc] master: Update T4891, T8639_api to follow 73c08ab10 (GHCi naming changes) (dcc6e04) Message-ID: <20140530013648.10B382406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/dcc6e04f00ded0c025f86e5d7555d599b1f77f71/ghc >--------------------------------------------------------------- commit dcc6e04f00ded0c025f86e5d7555d599b1f77f71 Author: Edward Z. Yang Date: Thu May 29 16:58:02 2014 -0700 Update T4891, T8639_api to follow 73c08ab10 (GHCi naming changes) Signed-off-by: Edward Z. Yang >--------------------------------------------------------------- dcc6e04f00ded0c025f86e5d7555d599b1f77f71 testsuite/tests/ghc-api/T4891/T4891.hs | 1 - testsuite/tests/ghc-api/T4891/T4891.stdout | 16 ++++++++-------- testsuite/tests/ghc-api/T8639_api.stdout | 2 +- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/testsuite/tests/ghc-api/T4891/T4891.hs b/testsuite/tests/ghc-api/T4891/T4891.hs index ca4aff9..854bf62 100644 --- a/testsuite/tests/ghc-api/T4891/T4891.hs +++ b/testsuite/tests/ghc-api/T4891/T4891.hs @@ -20,7 +20,6 @@ import Unsafe.Coerce import Control.Monad import Data.Maybe import Bag -import PrelNames (iNTERACTIVE) import Outputable import GhcMonad import X diff --git a/testsuite/tests/ghc-api/T4891/T4891.stdout b/testsuite/tests/ghc-api/T4891/T4891.stdout index 47eb152..8ad0b4e 100644 --- a/testsuite/tests/ghc-api/T4891/T4891.stdout +++ b/testsuite/tests/ghc-api/T4891/T4891.stdout @@ -1,20 +1,20 @@ ===== -Name: GHC.Types.False +Name: False OccString: 'False' -DataCon: GHC.Types.False +DataCon: False ===== Name: : OccString: ':' DataCon: : ===== -Name: X.:-> +Name: :-> OccString: ':->' -DataCon: X.:-> +DataCon: :-> ===== -Name: X.:->. +Name: :->. OccString: ':->.' -DataCon: X.:->. +DataCon: :->. ===== -Name: X.:->.+ +Name: :->.+ OccString: ':->.+' -DataCon: X.:->.+ +DataCon: :->.+ diff --git a/testsuite/tests/ghc-api/T8639_api.stdout b/testsuite/tests/ghc-api/T8639_api.stdout index 659a1dd..7218302 100644 --- a/testsuite/tests/ghc-api/T8639_api.stdout +++ b/testsuite/tests/ghc-api/T8639_api.stdout @@ -1,2 +1,2 @@ 3 -GHC.Types.Bool +Bool From git at git.haskell.org Fri May 30 01:36:50 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 30 May 2014 01:36:50 +0000 (UTC) Subject: [commit: ghc] master: Add .gitignore for autogenerated test files. (6c5017a) Message-ID: <20140530013650.B960E2406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/6c5017a8ca2df6c20eef7edf9caeeece26f06cac/ghc >--------------------------------------------------------------- commit 6c5017a8ca2df6c20eef7edf9caeeece26f06cac Author: Edward Z. Yang Date: Thu May 29 17:07:06 2014 -0700 Add .gitignore for autogenerated test files. I used this shell command to automatically generate the lists: for i in `git ls-files -o --exclude-standard --directory`; do echo "`basename $i`" >> "`dirname "$i"`/.gitignore"; done Signed-off-by: Edward Z. Yang >--------------------------------------------------------------- 6c5017a8ca2df6c20eef7edf9caeeece26f06cac libraries/base/tests/.gitignore | 93 ++++++++++++++++++++++ libraries/base/tests/Concurrent/.gitignore | 5 ++ libraries/base/tests/IO/.gitignore | 75 +++++++++++++++++ libraries/base/tests/Numeric/.gitignore | 10 +++ libraries/base/tests/System/.gitignore | 8 ++ libraries/base/tests/Text.Printf/.gitignore | 2 + libraries/template-haskell/tests/.gitignore | 2 + .../tests/annotations/should_compile/th/.gitignore | 1 + testsuite/tests/callarity/perf/.gitignore | 1 + testsuite/tests/callarity/should_run/.gitignore | 1 + testsuite/tests/callarity/unittest/.gitignore | 1 + testsuite/tests/codeGen/should_run/.gitignore | 11 +++ testsuite/tests/concurrent/should_run/.gitignore | 6 ++ testsuite/tests/cpranal/should_run/.gitignore | 1 + testsuite/tests/deSugar/should_run/.gitignore | 1 + testsuite/tests/deriving/should_run/.gitignore | 1 + testsuite/tests/driver/.gitignore | 1 + .../T5315.stdout => driver/T7835/.gitignore} | 0 testsuite/tests/driver/T8526/.gitignore | 1 + testsuite/tests/driver/T8602/.gitignore | 1 + testsuite/tests/ffi/should_run/.gitignore | 1 + testsuite/tests/ghc-api/.gitignore | 2 + testsuite/tests/ghci/scripts/.gitignore | 2 + testsuite/tests/numeric/should_run/.gitignore | 2 + testsuite/tests/patsyn/should_run/.gitignore | 2 +- testsuite/tests/perf/should_run/.gitignore | 8 ++ testsuite/tests/primops/should_run/.gitignore | 2 + testsuite/tests/quasiquotation/.gitignore | 1 + testsuite/tests/rts/.gitignore | 13 +++ testsuite/tests/simplCore/should_run/.gitignore | 4 + .../tests/stranal/should_run/T8425/.gitignore | 1 + testsuite/tests/th/.gitignore | 2 + .../tests/typecheck/should_compile/.gitignore | 1 + testsuite/tests/typecheck/should_run/.gitignore | 3 + 34 files changed, 265 insertions(+), 1 deletion(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 6c5017a8ca2df6c20eef7edf9caeeece26f06cac From git at git.haskell.org Fri May 30 01:36:53 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 30 May 2014 01:36:53 +0000 (UTC) Subject: [commit: ghc] master: Fix bitrotted GHC API test T6145. (cd14075) Message-ID: <20140530013653.176752406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/cd14075fe62a730f2438391f0448edbd1bcf15a2/ghc >--------------------------------------------------------------- commit cd14075fe62a730f2438391f0448edbd1bcf15a2 Author: Edward Z. Yang Date: Thu May 29 17:20:50 2014 -0700 Fix bitrotted GHC API test T6145. Signed-off-by: Edward Z. Yang >--------------------------------------------------------------- cd14075fe62a730f2438391f0448edbd1bcf15a2 testsuite/tests/ghc-api/.gitignore | 1 + testsuite/tests/ghc-api/T6145.hs | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/testsuite/tests/ghc-api/.gitignore b/testsuite/tests/ghc-api/.gitignore index 08e22eb..f52a1f9 100644 --- a/testsuite/tests/ghc-api/.gitignore +++ b/testsuite/tests/ghc-api/.gitignore @@ -1,2 +1,3 @@ T8628 T8639_api +T6145 diff --git a/testsuite/tests/ghc-api/T6145.hs b/testsuite/tests/ghc-api/T6145.hs index 98e8bd0..13b80ee 100644 --- a/testsuite/tests/ghc-api/T6145.hs +++ b/testsuite/tests/ghc-api/T6145.hs @@ -27,15 +27,15 @@ main = do l <- loadModule d let ts=typecheckedSource l -- liftIO (putStr (showSDocDebug (ppr ts))) - let fs=filterBag (isDataCon . snd) ts + let fs=filterBag isDataCon ts return $ not $ isEmptyBag fs removeFile "Test.hs" print ok where isDataCon (L _ (AbsBinds { abs_binds = bs })) - = not (isEmptyBag (filterBag (isDataCon . snd) bs)) + = not (isEmptyBag (filterBag isDataCon bs)) isDataCon (L l (f at FunBind {})) - | (MG (m:_) _ _) <- fun_matches f, + | (MG (m:_) _ _ _) <- fun_matches f, (L _ (c at ConPatOut{}):_)<-hsLMatchPats m, (L l _)<-pat_con c = isGoodSrcSpan l -- Check that the source location is a good one From git at git.haskell.org Fri May 30 01:36:55 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 30 May 2014 01:36:55 +0000 (UTC) Subject: [commit: ghc] master: Add missing stderr file for tcrun045. (a23f131) Message-ID: <20140530013655.CC54C2406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/a23f13132a373ffc2758d6294ecdbbdb8404bae7/ghc >--------------------------------------------------------------- commit a23f13132a373ffc2758d6294ecdbbdb8404bae7 Author: Edward Z. Yang Date: Thu May 29 17:29:25 2014 -0700 Add missing stderr file for tcrun045. Signed-off-by: Edward Z. Yang >--------------------------------------------------------------- a23f13132a373ffc2758d6294ecdbbdb8404bae7 .../{should_fail/tcfail211.stderr => should_run/tcrun045.stderr} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testsuite/tests/typecheck/should_fail/tcfail211.stderr b/testsuite/tests/typecheck/should_run/tcrun045.stderr similarity index 90% copy from testsuite/tests/typecheck/should_fail/tcfail211.stderr copy to testsuite/tests/typecheck/should_run/tcrun045.stderr index 3adb97c..82826c2 100644 --- a/testsuite/tests/typecheck/should_fail/tcfail211.stderr +++ b/testsuite/tests/typecheck/should_run/tcrun045.stderr @@ -1,5 +1,5 @@ -tcfail211.hs:5:1: +tcrun045.hs:24:1: Illegal implict parameter ??imp::Int? In the context: (?imp::Int) While checking the super-classes of class ?D? From git at git.haskell.org Fri May 30 01:36:58 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 30 May 2014 01:36:58 +0000 (UTC) Subject: [commit: ghc] master: s/implict/implicit/i (fc6a952) Message-ID: <20140530013658.31B5A2406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/fc6a9525baad53ba3aa5acd545470df738ca54a9/ghc >--------------------------------------------------------------- commit fc6a9525baad53ba3aa5acd545470df738ca54a9 Author: Edward Z. Yang Date: Thu May 29 17:25:41 2014 -0700 s/implict/implicit/i Signed-off-by: Edward Z. Yang >--------------------------------------------------------------- fc6a9525baad53ba3aa5acd545470df738ca54a9 compiler/iface/LoadIface.lhs | 10 +++++----- compiler/main/HscTypes.lhs | 2 +- compiler/main/TidyPgm.lhs | 2 +- compiler/typecheck/TcValidity.lhs | 4 ++-- testsuite/tests/typecheck/should_fail/T8912.stderr | 2 +- testsuite/tests/typecheck/should_fail/tcfail041.stderr | 2 +- testsuite/tests/typecheck/should_fail/tcfail211.stderr | 2 +- testsuite/tests/typecheck/should_run/tcrun045.stderr | 2 +- 8 files changed, 13 insertions(+), 13 deletions(-) diff --git a/compiler/iface/LoadIface.lhs b/compiler/iface/LoadIface.lhs index 30b2f0b..8f02282 100644 --- a/compiler/iface/LoadIface.lhs +++ b/compiler/iface/LoadIface.lhs @@ -392,7 +392,7 @@ compiler expects. -- the declaration itself, will find the fully-glorious Name -- -- We handle ATs specially. They are not main declarations, but also not --- implict things (in particular, adding them to `implicitTyThings' would mess +-- implicit things (in particular, adding them to `implicitTyThings' would mess -- things up in the renaming/type checking of source programs). ----------------------------------------------------- @@ -445,11 +445,11 @@ loadDecl ignore_prags mod (_version, decl) -- [ "MkT" -> , "x" -> , ... ] -- (where the "MkT" is the *Name* associated with MkT, etc.) -- - -- We do this by mapping the implict_names to the associated + -- We do this by mapping the implicit_names to the associated -- TyThings. By the invariant on ifaceDeclImplicitBndrs and -- implicitTyThings, we can use getOccName on the implicit -- TyThings to make this association: each Name's OccName should - -- be the OccName of exactly one implictTyThing. So the key is + -- be the OccName of exactly one implicitTyThing. So the key is -- to define a "mini-env" -- -- [ 'MkT' -> , 'x' -> , ... ] @@ -457,7 +457,7 @@ loadDecl ignore_prags mod (_version, decl) -- -- However, there is a subtlety: due to how type checking needs -- to be staged, we can't poke on the forkM'd thunks inside the - -- implictTyThings while building this mini-env. + -- implicitTyThings while building this mini-env. -- If we poke these thunks too early, two problems could happen: -- (1) When processing mutually recursive modules across -- hs-boot boundaries, poking too early will do the @@ -494,7 +494,7 @@ loadDecl ignore_prags mod (_version, decl) -- ; traceIf (text "Loading decl for " <> ppr main_name $$ ppr implicit_names) ; return $ (main_name, thing) : -- uses the invariant that implicit_names and - -- implictTyThings are bijective + -- implicitTyThings are bijective [(n, lookup n) | n <- implicit_names] } where diff --git a/compiler/main/HscTypes.lhs b/compiler/main/HscTypes.lhs index 875badf..8843d95 100644 --- a/compiler/main/HscTypes.lhs +++ b/compiler/main/HscTypes.lhs @@ -1484,7 +1484,7 @@ Examples: IfaceClass decl happens to use IfaceDecl recursively for the associated types, but that's irrelevant here.) - * Dictionary function Ids are not implict. + * Dictionary function Ids are not implicit. * Axioms for newtypes are implicit (same as above), but axioms for data/type family instances are *not* implicit (like DFunIds). diff --git a/compiler/main/TidyPgm.lhs b/compiler/main/TidyPgm.lhs index e974c82..9904bb0 100644 --- a/compiler/main/TidyPgm.lhs +++ b/compiler/main/TidyPgm.lhs @@ -520,7 +520,7 @@ of exceptions, and finally I gave up the battle: Note [Injecting implicit bindings] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -We inject the implict bindings right at the end, in CoreTidy. +We inject the implicit bindings right at the end, in CoreTidy. Some of these bindings, notably record selectors, are not constructed in an optimised form. E.g. record selector for data T = MkT { x :: {-# UNPACK #-} !Int } diff --git a/compiler/typecheck/TcValidity.lhs b/compiler/typecheck/TcValidity.lhs index 6177657..aa5ed07 100644 --- a/compiler/typecheck/TcValidity.lhs +++ b/compiler/typecheck/TcValidity.lhs @@ -508,7 +508,7 @@ okIPCtxt (SpecInstCtxt {}) = False okIPCtxt _ = True badIPPred :: PredType -> SDoc -badIPPred pred = ptext (sLit "Illegal implict parameter") <+> quotes (ppr pred) +badIPPred pred = ptext (sLit "Illegal implicit parameter") <+> quotes (ppr pred) check_eq_pred :: DynFlags -> UserTypeCtxt -> PredType -> TcType -> TcType -> TcM () @@ -652,7 +652,7 @@ unambiguous. See Note [Impedence matching] in TcBinds. This test is very conveniently implemented by calling tcSubType This neatly takes account of the functional dependecy stuff above, -and implict parameter (see Note [Implicit parameters and ambiguity]). +and implicit parameter (see Note [Implicit parameters and ambiguity]). What about this, though? g :: C [a] => Int diff --git a/testsuite/tests/typecheck/should_fail/T8912.stderr b/testsuite/tests/typecheck/should_fail/T8912.stderr index 24607c2..ad343f3 100644 --- a/testsuite/tests/typecheck/should_fail/T8912.stderr +++ b/testsuite/tests/typecheck/should_fail/T8912.stderr @@ -1,6 +1,6 @@ T8912.hs:7:10: - Illegal implict parameter ??imp::Int? + Illegal implicit parameter ??imp::Int? In the context: (?imp::Int) While checking an instance declaration In the instance declaration for ?C [a]? diff --git a/testsuite/tests/typecheck/should_fail/tcfail041.stderr b/testsuite/tests/typecheck/should_fail/tcfail041.stderr index ba5d4a1..c81d309 100644 --- a/testsuite/tests/typecheck/should_fail/tcfail041.stderr +++ b/testsuite/tests/typecheck/should_fail/tcfail041.stderr @@ -1,6 +1,6 @@ tcfail041.hs:5:1: - Illegal implict parameter ??imp::Int? + Illegal implicit parameter ??imp::Int? In the context: (?imp::Int) While checking the super-classes of class ?D? In the class declaration for ?D? diff --git a/testsuite/tests/typecheck/should_fail/tcfail211.stderr b/testsuite/tests/typecheck/should_fail/tcfail211.stderr index 3adb97c..0d9d23d 100644 --- a/testsuite/tests/typecheck/should_fail/tcfail211.stderr +++ b/testsuite/tests/typecheck/should_fail/tcfail211.stderr @@ -1,6 +1,6 @@ tcfail211.hs:5:1: - Illegal implict parameter ??imp::Int? + Illegal implicit parameter ??imp::Int? In the context: (?imp::Int) While checking the super-classes of class ?D? In the class declaration for ?D? diff --git a/testsuite/tests/typecheck/should_run/tcrun045.stderr b/testsuite/tests/typecheck/should_run/tcrun045.stderr index 82826c2..4017279 100644 --- a/testsuite/tests/typecheck/should_run/tcrun045.stderr +++ b/testsuite/tests/typecheck/should_run/tcrun045.stderr @@ -1,6 +1,6 @@ tcrun045.hs:24:1: - Illegal implict parameter ??imp::Int? + Illegal implicit parameter ??imp::Int? In the context: (?imp::Int) While checking the super-classes of class ?D? In the class declaration for ?D? From git at git.haskell.org Fri May 30 01:37:00 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 30 May 2014 01:37:00 +0000 (UTC) Subject: [commit: ghc] master: Refresh recomp006 error message. (a53fc11) Message-ID: <20140530013702.A95CD2406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/a53fc117511fe87db534ad658d3412b16ee8d4e9/ghc >--------------------------------------------------------------- commit a53fc117511fe87db534ad658d3412b16ee8d4e9 Author: Edward Z. Yang Date: Thu May 29 17:35:53 2014 -0700 Refresh recomp006 error message. Signed-off-by: Edward Z. Yang >--------------------------------------------------------------- a53fc117511fe87db534ad658d3412b16ee8d4e9 testsuite/tests/driver/recomp006/recomp006.stderr | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/testsuite/tests/driver/recomp006/recomp006.stderr b/testsuite/tests/driver/recomp006/recomp006.stderr index 7119ff5..25b48f3 100644 --- a/testsuite/tests/driver/recomp006/recomp006.stderr +++ b/testsuite/tests/driver/recomp006/recomp006.stderr @@ -1,6 +1,7 @@ A.hs:8:8: - Couldn't match expected type ?Int? with actual type ?(t0, t1)? + Couldn't match expected type ?Int? + with actual type ?(Integer, Integer)? In the expression: (2, 3) In the expression: (1, (2, 3)) In an equation for ?f?: f = (1, (2, 3)) From git at git.haskell.org Fri May 30 01:37:03 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 30 May 2014 01:37:03 +0000 (UTC) Subject: [commit: ghc] master: Remove obsolete -fno-warn-amp from spec001 (0c1974c) Message-ID: <20140530013703.24B492406B@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/0c1974c8262f1609ecb7dec438d8cd167f788a5c/ghc >--------------------------------------------------------------- commit 0c1974c8262f1609ecb7dec438d8cd167f788a5c Author: Edward Z. Yang Date: Thu May 29 17:36:48 2014 -0700 Remove obsolete -fno-warn-amp from spec001 Signed-off-by: Edward Z. Yang >--------------------------------------------------------------- 0c1974c8262f1609ecb7dec438d8cd167f788a5c testsuite/tests/simplCore/should_compile/spec001.hs | 1 - 1 file changed, 1 deletion(-) diff --git a/testsuite/tests/simplCore/should_compile/spec001.hs b/testsuite/tests/simplCore/should_compile/spec001.hs index f4b4dd0..5a6fb03 100644 --- a/testsuite/tests/simplCore/should_compile/spec001.hs +++ b/testsuite/tests/simplCore/should_compile/spec001.hs @@ -1,6 +1,5 @@ {-# LANGUAGE CPP, UnboxedTuples, MagicHash, StandaloneDeriving, DeriveDataTypeable #-} {-# OPTIONS_GHC -O #-} -{-# OPTIONS_GHC -fno-warn-amp #-} -- In GHC 6.4, compiling this module gave a Core Lint failure following the -- specialier, because a function was floated out that had a RULE that From git at git.haskell.org Fri May 30 03:09:20 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 30 May 2014 03:09:20 +0000 (UTC) Subject: [commit: ghc] master: Per-capability nursery weak pointer lists, fixes #9075 (723095b) Message-ID: <20140530030920.49D0C2406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/723095b0e4c5838c7eefd757af56ab2a7c614801/ghc >--------------------------------------------------------------- commit 723095b0e4c5838c7eefd757af56ab2a7c614801 Author: Edward Z. Yang Date: Thu May 29 20:05:51 2014 -0700 Per-capability nursery weak pointer lists, fixes #9075 Signed-off-by: Edward Z. Yang >--------------------------------------------------------------- 723095b0e4c5838c7eefd757af56ab2a7c614801 rts/Capability.c | 2 ++ rts/Capability.h | 5 +++++ rts/PrimOps.cmm | 9 ++++---- rts/RetainerProfile.c | 6 ++++++ rts/RtsStartup.c | 5 ++++- rts/sm/GC.c | 3 +++ rts/sm/MarkWeak.c | 35 ++++++++++++++++++++++++++++++++ rts/sm/MarkWeak.h | 1 + utils/deriveConstants/DeriveConstants.hs | 2 ++ 9 files changed, 63 insertions(+), 5 deletions(-) diff --git a/rts/Capability.c b/rts/Capability.c index 16b71b7..805a35b 100644 --- a/rts/Capability.c +++ b/rts/Capability.c @@ -273,6 +273,8 @@ initCapability( Capability *cap, nat i ) cap->mut_lists[g] = NULL; } + cap->weak_ptr_list_hd = NULL; + cap->weak_ptr_list_tl = NULL; cap->free_tvar_watch_queues = END_STM_WATCH_QUEUE; cap->free_invariant_check_queues = END_INVARIANT_CHECK_QUEUE; cap->free_trec_chunks = END_STM_CHUNK_LIST; diff --git a/rts/Capability.h b/rts/Capability.h index f342d92..d36d502 100644 --- a/rts/Capability.h +++ b/rts/Capability.h @@ -79,6 +79,11 @@ struct Capability_ { // full pinned object blocks allocated since the last GC bdescr *pinned_object_blocks; + // per-capability weak pointer list associated with nursery (older + // lists stored in generation object) + StgWeak *weak_ptr_list_hd; + StgWeak *weak_ptr_list_tl; + // Context switch flag. When non-zero, this means: stop running // Haskell code, and switch threads. int context_switch; diff --git a/rts/PrimOps.cmm b/rts/PrimOps.cmm index 1dc232d..84bcea5 100644 --- a/rts/PrimOps.cmm +++ b/rts/PrimOps.cmm @@ -577,10 +577,11 @@ stg_mkWeakzh ( gcptr key, StgWeak_finalizer(w) = finalizer; StgWeak_cfinalizers(w) = stg_NO_FINALIZER_closure; - ACQUIRE_LOCK(sm_mutex); - StgWeak_link(w) = generation_weak_ptr_list(W_[g0]); - generation_weak_ptr_list(W_[g0]) = w; - RELEASE_LOCK(sm_mutex); + StgWeak_link(w) = Capability_weak_ptr_list_hd(MyCapability()); + Capability_weak_ptr_list_hd(MyCapability()) = w; + if (Capability_weak_ptr_list_tl(MyCapability()) == NULL) { + Capability_weak_ptr_list_tl(MyCapability()) = w; + } IF_DEBUG(weak, ccall debugBelch(stg_weak_msg,w)); diff --git a/rts/RetainerProfile.c b/rts/RetainerProfile.c index bdfc831..bfc9624 100644 --- a/rts/RetainerProfile.c +++ b/rts/RetainerProfile.c @@ -1781,6 +1781,12 @@ computeRetainerSet( void ) // // The following code assumes that WEAK objects are considered to be roots // for retainer profilng. + for (n = 0; n < n_capabilities; n++) { + // NB: after a GC, all nursery weak_ptr_lists have been migrated + // to the global lists living in the generations + ASSERT(capabilities[n]->weak_ptr_list_hd == NULL); + ASSERT(capabilities[n]->weak_ptr_list_tl == NULL); + } for (g = 0; g < RtsFlags.GcFlags.generations; g++) { for (weak = generations[g].weak_ptr_list; weak != NULL; weak = weak->link) { // retainRoot((StgClosure *)weak); diff --git a/rts/RtsStartup.c b/rts/RtsStartup.c index 15e48a6..06e888c 100644 --- a/rts/RtsStartup.c +++ b/rts/RtsStartup.c @@ -304,7 +304,7 @@ hs_add_root(void (*init_root)(void) STG_UNUSED) static void hs_exit_(rtsBool wait_foreign) { - nat g; + nat g, i; if (hs_init_count <= 0) { errorBelch("warning: too many hs_exit()s"); @@ -336,6 +336,9 @@ hs_exit_(rtsBool wait_foreign) exitScheduler(wait_foreign); /* run C finalizers for all active weak pointers */ + for (i = 0; i < n_capabilities; i++) { + runAllCFinalizers(capabilities[i]->weak_ptr_list_hd); + } for (g = 0; g < RtsFlags.GcFlags.generations; g++) { runAllCFinalizers(generations[g].weak_ptr_list); } diff --git a/rts/sm/GC.c b/rts/sm/GC.c index d22a31e..61432ea 100644 --- a/rts/sm/GC.c +++ b/rts/sm/GC.c @@ -286,6 +286,9 @@ GarbageCollect (nat collect_gen, memInventory(DEBUG_gc); #endif + // do this *before* we start scavenging + collectFreshWeakPtrs(); + // check sanity *before* GC IF_DEBUG(sanity, checkSanity(rtsFalse /* before GC */, major_gc)); diff --git a/rts/sm/MarkWeak.c b/rts/sm/MarkWeak.c index af953cd..0324f3b 100644 --- a/rts/sm/MarkWeak.c +++ b/rts/sm/MarkWeak.c @@ -25,6 +25,8 @@ #include "Storage.h" #include "Threads.h" +#include "sm/Sanity.h" + /* ----------------------------------------------------------------------------- Weak Pointers @@ -341,6 +343,39 @@ static void tidyThreadList (generation *gen) } } +#ifdef DEBUG +static void checkWeakPtrSanity(StgWeak *hd, StgWeak *tl) +{ + StgWeak *w, *prev; + for (w = hd; w != NULL; prev = w, w = w->link) { + ASSERT(INFO_PTR_TO_STRUCT(UNTAG_CLOSURE((StgClosure*)w)->header.info)->type == WEAK); + checkClosure((StgClosure*)w); + } + if (tl != NULL) { + ASSERT(prev == tl); + } +} +#endif + +void collectFreshWeakPtrs() +{ + nat i; + generation *gen = &generations[0]; + // move recently allocated weak_ptr_list to the old list as well + for (i = 0; i < n_capabilities; i++) { + Capability *cap = capabilities[i]; + if (cap->weak_ptr_list_tl != NULL) { + IF_DEBUG(sanity, checkWeakPtrSanity(cap->weak_ptr_list_hd, cap->weak_ptr_list_tl)); + cap->weak_ptr_list_tl->link = gen->weak_ptr_list; + gen->weak_ptr_list = cap->weak_ptr_list_hd; + cap->weak_ptr_list_tl = NULL; + cap->weak_ptr_list_hd = NULL; + } else { + ASSERT(cap->weak_ptr_list_hd == NULL); + } + } +} + /* ----------------------------------------------------------------------------- Evacuate every weak pointer object on the weak_ptr_list, and update the link fields. diff --git a/rts/sm/MarkWeak.h b/rts/sm/MarkWeak.h index f9bacfa..bd0231d 100644 --- a/rts/sm/MarkWeak.h +++ b/rts/sm/MarkWeak.h @@ -20,6 +20,7 @@ extern StgWeak *old_weak_ptr_list; extern StgTSO *resurrected_threads; extern StgTSO *exception_threads; +void collectFreshWeakPtrs ( void ); void initWeakForGC ( void ); rtsBool traverseWeakPtrList ( void ); void markWeakPtrList ( void ); diff --git a/utils/deriveConstants/DeriveConstants.hs b/utils/deriveConstants/DeriveConstants.hs index d15f619..9bf2160 100644 --- a/utils/deriveConstants/DeriveConstants.hs +++ b/utils/deriveConstants/DeriveConstants.hs @@ -349,6 +349,8 @@ wanteds = concat ,structField C "Capability" "context_switch" ,structField C "Capability" "interrupt" ,structField C "Capability" "sparks" + ,structField C "Capability" "weak_ptr_list_hd" + ,structField C "Capability" "weak_ptr_list_tl" ,structField Both "bdescr" "start" ,structField Both "bdescr" "free" From git at git.haskell.org Fri May 30 08:05:14 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 30 May 2014 08:05:14 +0000 (UTC) Subject: [commit: ghc] master: Disable FixEither tests in TcCoercible (5a392ca) Message-ID: <20140530080514.A9DD02406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/5a392ca14b3698d1be5166dd7a6a40b268e948e5/ghc >--------------------------------------------------------------- commit 5a392ca14b3698d1be5166dd7a6a40b268e948e5 Author: Joachim Breitner Date: Fri May 30 10:04:10 2014 +0200 Disable FixEither tests in TcCoercible This fixes #9153. It has not been noticed before because this TcCoercible does not run with "make fast=YES" >--------------------------------------------------------------- 5a392ca14b3698d1be5166dd7a6a40b268e948e5 testsuite/tests/typecheck/should_run/TcCoercible.hs | 7 ++++--- testsuite/tests/typecheck/should_run/TcCoercible.stdout | 2 -- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/testsuite/tests/typecheck/should_run/TcCoercible.hs b/testsuite/tests/typecheck/should_run/TcCoercible.hs index 7bb8e48..2849840 100644 --- a/testsuite/tests/typecheck/should_run/TcCoercible.hs +++ b/testsuite/tests/typecheck/should_run/TcCoercible.hs @@ -23,7 +23,8 @@ newtype NonEtad a b = NonEtad (Either b a) deriving Show newtype Fix f = Fix (f (Fix f)) deriving instance Show (f (Fix f)) => Show (Fix f) -newtype FixEither a = FixEither (Either a (FixEither a)) deriving Show +-- Later, however, this stopped working (#9117) +-- newtype FixEither a = FixEither (Either a (FixEither a)) deriving Show -- This ensures that explicitly given constraints are consulted, even -- at higher depths @@ -59,8 +60,8 @@ main = do print (coerce $ (Fix (Left ()) :: Fix (Either ())) :: Either () (Fix (Either ()))) print (coerce $ (Left () :: Either () (Fix (Either ()))) :: Fix (Either ())) - print (coerce $ (FixEither (Left age) :: FixEither Age) :: Either Int (FixEither Int)) - print (coerce $ (Left one :: Either Int (FixEither Age)) :: FixEither Age) + -- print (coerce $ (FixEither (Left age) :: FixEither Age) :: Either Int (FixEither Int)) + -- print (coerce $ (Left one :: Either Int (FixEither Age)) :: FixEither Age) print (coerce $ True :: Fam Int) print (coerce $ FamInt True :: Bool) diff --git a/testsuite/tests/typecheck/should_run/TcCoercible.stdout b/testsuite/tests/typecheck/should_run/TcCoercible.stdout index 7b8071f..8ac2181 100644 --- a/testsuite/tests/typecheck/should_run/TcCoercible.stdout +++ b/testsuite/tests/typecheck/should_run/TcCoercible.stdout @@ -14,7 +14,5 @@ List [1] NonEtad (Right 1) Left () Fix (Left ()) -Left 1 -FixEither (Left (Age 1)) FamInt True True From git at git.haskell.org Fri May 30 08:49:57 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 30 May 2014 08:49:57 +0000 (UTC) Subject: [commit: ghc] master: Fix missing unlockClosure() call in tryReadMVar (#9148) (96a95f0) Message-ID: <20140530084957.BF7182406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/96a95f0513de785a185fd8a46c7ed2643f698295/ghc >--------------------------------------------------------------- commit 96a95f0513de785a185fd8a46c7ed2643f698295 Author: Simon Marlow Date: Fri May 30 08:47:26 2014 +0100 Fix missing unlockClosure() call in tryReadMVar (#9148) >--------------------------------------------------------------- 96a95f0513de785a185fd8a46c7ed2643f698295 rts/PrimOps.cmm | 1 + testsuite/tests/concurrent/should_run/all.T | 1 + testsuite/tests/concurrent/should_run/tryReadMVar2.hs | 15 +++++++++++++++ 3 files changed, 17 insertions(+) diff --git a/rts/PrimOps.cmm b/rts/PrimOps.cmm index 84bcea5..4d7baca 100644 --- a/rts/PrimOps.cmm +++ b/rts/PrimOps.cmm @@ -1786,6 +1786,7 @@ stg_tryReadMVarzh ( P_ mvar, /* :: MVar a */ ) LOCK_CLOSURE(mvar, info); if (StgMVar_value(mvar) == stg_END_TSO_QUEUE_closure) { + unlockClosure(mvar, info); return (0, stg_NO_FINALIZER_closure); } diff --git a/testsuite/tests/concurrent/should_run/all.T b/testsuite/tests/concurrent/should_run/all.T index d4e76c6..0b502c3 100644 --- a/testsuite/tests/concurrent/should_run/all.T +++ b/testsuite/tests/concurrent/should_run/all.T @@ -78,6 +78,7 @@ test('readMVar1', normal, compile_and_run, ['']) test('readMVar2', normal, compile_and_run, ['']) test('readMVar3', normal, compile_and_run, ['']) test('tryReadMVar1', normal, compile_and_run, ['']) +test('tryReadMVar2', normal, compile_and_run, ['']) test('T7970', normal, compile_and_run, ['']) diff --git a/testsuite/tests/concurrent/should_run/tryReadMVar2.hs b/testsuite/tests/concurrent/should_run/tryReadMVar2.hs new file mode 100644 index 0000000..13b8a45 --- /dev/null +++ b/testsuite/tests/concurrent/should_run/tryReadMVar2.hs @@ -0,0 +1,15 @@ +module Main where + +import Control.Concurrent +import Control.Monad + +main = do + m <- newEmptyMVar + done <- newEmptyMVar + let q = 200000 + forkIO (do mapM (\n -> putMVar m n) [1..q]; putMVar done ()) + forkIO (do replicateM_ q $ readMVar m; putMVar done ()) + forkIO (do replicateM_ q $ tryReadMVar m; putMVar done ()) + forkIO (do replicateM_ q $ takeMVar m; putMVar done ()) + replicateM_ 4 $ takeMVar done + From git at git.haskell.org Fri May 30 08:50:00 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 30 May 2014 08:50:00 +0000 (UTC) Subject: [commit: ghc] master: Just formatting (660c3f9) Message-ID: <20140530085001.EC3C92406F@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/660c3f9d8534e3b249b27ab4024939d204366cc7/ghc >--------------------------------------------------------------- commit 660c3f9d8534e3b249b27ab4024939d204366cc7 Author: Simon Marlow Date: Fri May 16 10:19:45 2014 +0100 Just formatting >--------------------------------------------------------------- 660c3f9d8534e3b249b27ab4024939d204366cc7 compiler/iface/MkIface.lhs | 26 +++++++++++++++--------- compiler/main/HscMain.hs | 28 ++++++++++++++------------ compiler/main/HscTypes.lhs | 49 +++++++++++++++++++++++++++++----------------- 3 files changed, 64 insertions(+), 39 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 660c3f9d8534e3b249b27ab4024939d204366cc7 From git at git.haskell.org Fri May 30 08:50:02 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 30 May 2014 08:50:02 +0000 (UTC) Subject: [commit: ghc] master: mkHiPath & mkObjPath didn't need to be in IO (a8d81af) Message-ID: <20140530085002.A504D2406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/a8d81afa5eeecab04a4cf8eef577c689b0ebcd3e/ghc >--------------------------------------------------------------- commit a8d81afa5eeecab04a4cf8eef577c689b0ebcd3e Author: Simon Marlow Date: Fri May 16 10:18:03 2014 +0100 mkHiPath & mkObjPath didn't need to be in IO >--------------------------------------------------------------- a8d81afa5eeecab04a4cf8eef577c689b0ebcd3e compiler/main/Finder.lhs | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/compiler/main/Finder.lhs b/compiler/main/Finder.lhs index c0e9f8a..cbfd4e4 100644 --- a/compiler/main/Finder.lhs +++ b/compiler/main/Finder.lhs @@ -434,8 +434,8 @@ mkHomeModLocation2 :: DynFlags mkHomeModLocation2 dflags mod src_basename ext = do let mod_basename = moduleNameSlashes mod - obj_fn <- mkObjPath dflags src_basename mod_basename - hi_fn <- mkHiPath dflags src_basename mod_basename + obj_fn = mkObjPath dflags src_basename mod_basename + hi_fn = mkHiPath dflags src_basename mod_basename return (ModLocation{ ml_hs_file = Just (src_basename <.> ext), ml_hi_file = hi_fn, @@ -445,7 +445,7 @@ mkHiOnlyModLocation :: DynFlags -> Suffix -> FilePath -> String -> IO ModLocation mkHiOnlyModLocation dflags hisuf path basename = do let full_basename = path basename - obj_fn <- mkObjPath dflags full_basename basename + obj_fn = mkObjPath dflags full_basename basename return ModLocation{ ml_hs_file = Nothing, ml_hi_file = full_basename <.> hisuf, -- Remove the .hi-boot suffix from @@ -461,16 +461,15 @@ mkObjPath :: DynFlags -> FilePath -- the filename of the source file, minus the extension -> String -- the module name with dots replaced by slashes - -> IO FilePath -mkObjPath dflags basename mod_basename - = do let + -> FilePath +mkObjPath dflags basename mod_basename = obj_basename <.> osuf + where odir = objectDir dflags osuf = objectSuf dflags obj_basename | Just dir <- odir = dir mod_basename | otherwise = basename - return (obj_basename <.> osuf) -- | Constructs the filename of a .hi file for a given source file. -- Does /not/ check whether the .hi file exists @@ -478,16 +477,15 @@ mkHiPath :: DynFlags -> FilePath -- the filename of the source file, minus the extension -> String -- the module name with dots replaced by slashes - -> IO FilePath -mkHiPath dflags basename mod_basename - = do let + -> FilePath +mkHiPath dflags basename mod_basename = hi_basename <.> hisuf + where hidir = hiDir dflags hisuf = hiSuf dflags hi_basename | Just dir <- hidir = dir mod_basename | otherwise = basename - return (hi_basename <.> hisuf) -- ----------------------------------------------------------------------------- From git at git.haskell.org Fri May 30 08:50:04 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 30 May 2014 08:50:04 +0000 (UTC) Subject: [commit: ghc] master: Remove deprecated -optdep options (994d5e3) Message-ID: <20140530085005.1C17A2406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/994d5e3cfc32cb624b63683205dd8fd876171d0c/ghc >--------------------------------------------------------------- commit 994d5e3cfc32cb624b63683205dd8fd876171d0c Author: Simon Marlow Date: Fri May 16 10:19:19 2014 +0100 Remove deprecated -optdep options >--------------------------------------------------------------- 994d5e3cfc32cb624b63683205dd8fd876171d0c compiler/main/DynFlags.hs | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs index a275416..8aa4375 100644 --- a/compiler/main/DynFlags.hs +++ b/compiler/main/DynFlags.hs @@ -2189,16 +2189,9 @@ dynamic_flags = [ -------- ghc -M ----------------------------------------------------- , Flag "dep-suffix" (hasArg addDepSuffix) - , Flag "optdep-s" (hasArgDF addDepSuffix "Use -dep-suffix instead") , Flag "dep-makefile" (hasArg setDepMakefile) - , Flag "optdep-f" (hasArgDF setDepMakefile "Use -dep-makefile instead") - , Flag "optdep-w" (NoArg (deprecate "doesn't do anything")) , Flag "include-pkg-deps" (noArg (setDepIncludePkgDeps True)) - , Flag "optdep--include-prelude" (noArgDF (setDepIncludePkgDeps True) "Use -include-pkg-deps instead") - , Flag "optdep--include-pkg-deps" (noArgDF (setDepIncludePkgDeps True) "Use -include-pkg-deps instead") , Flag "exclude-module" (hasArg addDepExcludeMod) - , Flag "optdep--exclude-module" (hasArgDF addDepExcludeMod "Use -exclude-module instead") - , Flag "optdep-x" (hasArgDF addDepExcludeMod "Use -exclude-module instead") -------- Linking ---------------------------------------------------- , Flag "no-link" (noArg (\d -> d{ ghcLink=NoLink })) @@ -3190,16 +3183,9 @@ noArg fn = NoArg (upd fn) noArgM :: (DynFlags -> DynP DynFlags) -> OptKind (CmdLineP DynFlags) noArgM fn = NoArg (updM fn) -noArgDF :: (DynFlags -> DynFlags) -> String -> OptKind (CmdLineP DynFlags) -noArgDF fn deprec = NoArg (upd fn >> deprecate deprec) - hasArg :: (String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags) hasArg fn = HasArg (upd . fn) -hasArgDF :: (String -> DynFlags -> DynFlags) -> String -> OptKind (CmdLineP DynFlags) -hasArgDF fn deprec = HasArg (\s -> do upd (fn s) - deprecate deprec) - sepArg :: (String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags) sepArg fn = SepArg (upd . fn) From git at git.haskell.org Fri May 30 09:25:46 2014 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 30 May 2014 09:25:46 +0000 (UTC) Subject: [commit: ghc] master: Improve Note [Order of Coercible Instances] about Trac #9117 (9e10963) Message-ID: <20140530092546.F13EC2406D@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/9e10963e394680dbb1b964c66cb428a2aa03df09/ghc >--------------------------------------------------------------- commit 9e10963e394680dbb1b964c66cb428a2aa03df09 Author: Simon Peyton Jones Date: Fri May 30 10:25:21 2014 +0100 Improve Note [Order of Coercible Instances] about Trac #9117 >--------------------------------------------------------------- 9e10963e394680dbb1b964c66cb428a2aa03df09 compiler/typecheck/TcInteract.lhs | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/compiler/typecheck/TcInteract.lhs b/compiler/typecheck/TcInteract.lhs index 832b8ee..5870938 100644 --- a/compiler/typecheck/TcInteract.lhs +++ b/compiler/typecheck/TcInteract.lhs @@ -2092,18 +2092,31 @@ getCoercibleInst (in negated form). Note [Order of Coercible Instances] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - At first glance, the order of the various coercible instances doesn't matter, as incoherence is no issue here: We do not care how the evidence is constructed, as long as it is. -But since the solver does not backtrack, the order does matter, as otherwise we may run -into dead ends. If case 4 (coercing under type constructors) were tried before -case 3 (unwrapping newtypes), which is tempting, as it yields solutions faster -and builds smaller evidence turns, then using a role annotation this can -prevent the solver from finding an otherwise possible solution. See T9117.hs -for the code. +But because of role annotations, the order *can* matter: + + newtype T a = MkT [a] + type role T nominal + + type family F a + type instance F Int = Bool + +Here T's declared role is more restrictive than its inferred role +(representational) would be. If MkT is not in scope, so that the +newtype-unwrapping instance is not available, then this coercible +instance would fail: + Coercible (T Bool) (T (F Int) +But MkT was in scope, *and* if we used it before decomposing on T, +we'd unwrap the newtype (on both sides) to get + Coercible Bool (F Int) +whic succeeds. +So our current decision is to apply case 3 (newtype-unwrapping) first, +followed by decomposition (case 4). This is strictly more powerful +if the newtype constructor is in scope. See Trac #9117 for a discussion. Note [Instance and Given overlap] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~