simonpj [Tue, 20 Feb 2001 09:39:00 +0000 (09:39 +0000)]
[project @ 2001-02-20 09:38:59 by simonpj]
Back end changes [CgExpr, ClosureInfo, CoreSat, CoreUtils,
~~~~~~~~~~~~~~~~ CmdLineOpts, HscMain, CoreToStg, StgSyn]
* Move CoreTidy and interface-file dumping *before* CoreSat.
In this way interface files are not in A-normal form, so
they are less bulky, and a bit easier to use as input to
the optimiser.
So now CoreSat is regarded as a pre-pass to CoreToStg.
Since CoreTidy pins on utterly-final IdInfo, CoreSat has to
be very careful not to change the arity of any function.
* CoreSat uses OrdList instead of lists to collect floating binds
This in turn meant I could simplify the FloatingBind type a bit
* Greatly simplfy the StgBinderInfo data type. It was
gathering far more information than we needed.
* Add a flag -fkeep-stg-types, which keeps type abstractions
and applications in STG code, for the benefit of code generators
that are typed; notably the .NET ILX code generator.
simonpj [Tue, 20 Feb 2001 08:57:46 +0000 (08:57 +0000)]
[project @ 2001-02-20 08:57:46 by simonpj]
Add fundeps tests
qrczak [Tue, 20 Feb 2001 03:41:31 +0000 (03:41 +0000)]
[project @ 2001-02-20 03:41:31 by qrczak]
Remove unbalanced #endif.
rrt [Mon, 19 Feb 2001 16:18:38 +0000 (16:18 +0000)]
[project @ 2001-02-19 16:18:38 by rrt]
Use Sleep under mingw rather than sleep (which is obsolete), and try using
fork under cygwin (it should work by now, shurely...).
rrt [Mon, 19 Feb 2001 16:10:23 +0000 (16:10 +0000)]
[project @ 2001-02-19 16:10:23 by rrt]
Don't declare unused struct termios on mingwin.
rrt [Mon, 19 Feb 2001 16:07:48 +0000 (16:07 +0000)]
[project @ 2001-02-19 16:07:48 by rrt]
Move if #ifndefs so that no code is compiled on win32; the code that was
compiled was doing nothing useful, and probably shouldn't have been.
rrt [Mon, 19 Feb 2001 14:54:48 +0000 (14:54 +0000)]
[project @ 2001-02-19 14:54:48 by rrt]
Add -mno-cygwin to CPPFLAGS on i386-unknown-mingw32 to stop configure.h
getting lots of bogus headers that aren't there. I'm not at all sure why
this hasn't caused problems before...
simonmar [Mon, 19 Feb 2001 12:35:31 +0000 (12:35 +0000)]
[project @ 2001-02-19 12:35:31 by simonmar]
fix the GHC_HAPPY_OPTS hack to correctly detect happy 1.10
simonmar [Mon, 19 Feb 2001 12:13:49 +0000 (12:13 +0000)]
[project @ 2001-02-19 12:13:49 by simonmar]
Rather than implement -K (which would probably need another primop),
simply bump the maximum stack size to 8M. It dynamically grows
anyhow.
sewardj [Mon, 19 Feb 2001 11:38:55 +0000 (11:38 +0000)]
[project @ 2001-02-19 11:38:55 by sewardj]
Expand on comments re StString lifting activity
sewardj [Mon, 19 Feb 2001 10:15:54 +0000 (10:15 +0000)]
[project @ 2001-02-19 10:15:54 by sewardj]
Fix two bugs exposed when trying to boot HEAD on sparc with NCG and -O:
1. StScratchWords on sparc were in the wrong place; they were
immediately above %fp and should have been immediately below.
Fixed. Also removed a suspicious-looking "+1" in the x86
version of same.
2. (Potentially affects all platforms): Lift strings out from
top-level literal data, and place them at the end of the block.
The motivating example (bug) was:
Stix:
(DataSegment)
Bogon.ping_closure :
(Data P_ Addr.A#_static_info)
(Data StgAddr (Str `alalal'))
(Data P_ (0))
results in:
.data
.align 8
.global Bogon_ping_closure
Bogon_ping_closure:
.long Addr_Azh_static_info
.long .Ln1a8
.Ln1a8:
.byte 0x61
.byte 0x6C
.byte 0x61
.byte 0x6C
.byte 0x61
.byte 0x6C
.byte 0x00
.long 0
ie, the Str is planted in-line, when what we really meant was to place
a _reference_ to the string there. This is Way Wrong (tm). Fixed.
qrczak [Mon, 19 Feb 2001 09:06:23 +0000 (09:06 +0000)]
[project @ 2001-02-19 09:06:23 by qrczak]
Oops, I broke it yesterday; don't use autoheader.
(I don't see my yesterday's commit log. I changed #define to #undef
in autoconf templates.)
qrczak [Sun, 18 Feb 2001 17:22:50 +0000 (17:22 +0000)]
[project @ 2001-02-18 17:22:49 by qrczak]
Change #define to #undef in autoconf templates.
qrczak [Sun, 18 Feb 2001 14:45:15 +0000 (14:45 +0000)]
[project @ 2001-02-18 14:45:15 by qrczak]
Recent Unicode and future ISO-10646 finally decided that the character
code space ends at U+10FFFF. Let ghc follow the rules: maxBound::Char
is now '\x10FFFF', etc.
sebc [Sat, 17 Feb 2001 20:21:50 +0000 (20:21 +0000)]
[project @ 2001-02-17 20:21:50 by sebc]
The LIBM variable was between two Readline related variables. Cleaned up.
sebc [Sat, 17 Feb 2001 19:52:56 +0000 (19:52 +0000)]
[project @ 2001-02-17 19:52:56 by sebc]
Make LIBM be detected by autoconf.
simonmar [Fri, 16 Feb 2001 17:35:01 +0000 (17:35 +0000)]
[project @ 2001-02-16 17:35:01 by simonmar]
Today's doc hacking.
sewardj [Fri, 16 Feb 2001 12:07:10 +0000 (12:07 +0000)]
[project @ 2001-02-16 12:07:10 by sewardj]
Remove ghc-$(ProjectVersion) from GhcBinDistPrlScripts, since it's not
a perl script any more.
sewardj [Fri, 16 Feb 2001 11:39:37 +0000 (11:39 +0000)]
[project @ 2001-02-16 11:39:37 by sewardj]
Remove ghc-stats from GhcBinDistLibPrlScripts.
simonmar [Fri, 16 Feb 2001 09:53:51 +0000 (09:53 +0000)]
[project @ 2001-02-16 09:53:51 by simonmar]
deLam the contents of an _scc_: they don't disappear at code
generation time.
qrczak [Thu, 15 Feb 2001 22:34:48 +0000 (22:34 +0000)]
[project @ 2001-02-15 22:34:48 by qrczak]
Use ${1+"$@"} instead of "$@". How stupid are those shells.
qrczak [Thu, 15 Feb 2001 19:43:18 +0000 (19:43 +0000)]
[project @ 2001-02-15 19:43:18 by qrczak]
Use "$@" instead of $* to pass commandline arguments safely.
simonmar [Thu, 15 Feb 2001 17:33:53 +0000 (17:33 +0000)]
[project @ 2001-02-15 17:33:53 by simonmar]
More documentation rewriting... I'm particularly proud of the "flag
reference" section, please check it out.
sewardj [Thu, 15 Feb 2001 17:22:15 +0000 (17:22 +0000)]
[project @ 2001-02-15 17:22:15 by sewardj]
Correct usage info for tryPutMVar#.
sewardj [Thu, 15 Feb 2001 14:30:35 +0000 (14:30 +0000)]
[project @ 2001-02-15 14:30:35 by sewardj]
VoidRep call/return support for interpreted code.
sewardj [Thu, 15 Feb 2001 14:30:07 +0000 (14:30 +0000)]
[project @ 2001-02-15 14:27:36 by sewardj]
VoidRep call/return support for the interpreter.
simonmar [Thu, 15 Feb 2001 12:38:35 +0000 (12:38 +0000)]
[project @ 2001-02-15 12:38:35 by simonmar]
re-order the WithHc and WithGhc tests: now if you specify
--with-ghc=<ghc>, then WithHc also gets <ghc> if you don't set it
explicitly. Previously it got whatever ghc was in the PATH, which
would fail if there wasn't a ghc in the PATH at all.
simonmar [Thu, 15 Feb 2001 10:02:43 +0000 (10:02 +0000)]
[project @ 2001-02-15 10:02:43 by simonmar]
changes to support tryPutMVar which I forgot in the main commit.
rrt [Wed, 14 Feb 2001 14:28:49 +0000 (14:28 +0000)]
[project @ 2001-02-14 14:28:49 by rrt]
Remove -l from library name in libraries list (oops!)
simonmar [Wed, 14 Feb 2001 14:14:55 +0000 (14:14 +0000)]
[project @ 2001-02-14 14:14:55 by simonmar]
simple tryPutMVar test.
simonmar [Wed, 14 Feb 2001 14:02:58 +0000 (14:02 +0000)]
[project @ 2001-02-14 14:02:58 by simonmar]
Tidy the type we get back from typecheckExpr.
simonmar [Wed, 14 Feb 2001 13:56:50 +0000 (13:56 +0000)]
[project @ 2001-02-14 13:56:50 by simonmar]
add tryPutMVarzh_fast
simonmar [Wed, 14 Feb 2001 12:59:35 +0000 (12:59 +0000)]
[project @ 2001-02-14 12:59:34 by simonmar]
- make putMVar block rather than raise an exception when it encounters a
full MVar (to match the semantics in our recent paper on async excpetions).
- add tryPutMVar, a non-blocking version of putMVar.
rrt [Wed, 14 Feb 2001 12:43:24 +0000 (12:43 +0000)]
[project @ 2001-02-14 12:43:24 by rrt]
Turn off linking under Windows until it's fixed (that's linking, there's no
hope of fixing Windows).
rrt [Wed, 14 Feb 2001 12:41:15 +0000 (12:41 +0000)]
[project @ 2001-02-14 12:41:15 by rrt]
Add winmm to libraries for RTS under Windows, where it's now used for
threadDelay.
rrt [Wed, 14 Feb 2001 12:37:10 +0000 (12:37 +0000)]
[project @ 2001-02-14 12:37:10 by rrt]
Remove inadvertently committed debugging gumph.
rrt [Wed, 14 Feb 2001 12:36:06 +0000 (12:36 +0000)]
[project @ 2001-02-14 12:36:06 by rrt]
Make isDirectory work on Windows (dirent.d_name is a char *, not a char []);
also getDirectoryContents (readdir helpfully sets errno to ENOENT when we've
read the last entry, rather than leaving it at 0).
Windows is *not* the way of the future.
rrt [Wed, 14 Feb 2001 12:32:48 +0000 (12:32 +0000)]
[project @ 2001-02-14 12:32:48 by rrt]
Remove an out-of-date comment and correct a Windows wibble.
simonmar [Wed, 14 Feb 2001 11:54:33 +0000 (11:54 +0000)]
[project @ 2001-02-14 11:54:33 by simonmar]
PrimOp dependency wibble
sewardj [Wed, 14 Feb 2001 11:36:07 +0000 (11:36 +0000)]
[project @ 2001-02-14 11:36:07 by sewardj]
Remove support for directly loading .so's/.DLL's from the cmd line
in interactive mode and instead support the -lfooble mechanism.
sewardj [Wed, 14 Feb 2001 11:03:59 +0000 (11:03 +0000)]
[project @ 2001-02-14 11:03:59 by sewardj]
Show error messages generated from failed .so/.DLL load attempts.
sewardj [Wed, 14 Feb 2001 11:02:36 +0000 (11:02 +0000)]
[project @ 2001-02-14 11:02:36 by sewardj]
Allow addDLL to return error message strings to caller.
simonmar [Wed, 14 Feb 2001 10:33:05 +0000 (10:33 +0000)]
[project @ 2001-02-14 10:33:05 by simonmar]
Fix for tail-calling on HP-UX, and a lengthy explanation, thanks to
Andy Bennet <andy_bennet@hp.com>.
simonmar [Wed, 14 Feb 2001 09:50:00 +0000 (09:50 +0000)]
[project @ 2001-02-14 09:50:00 by simonmar]
add -ldl to SRC_HC_OPTS if GhcWithInterpreter=YES and HaveLibDL=YES.
qrczak [Tue, 13 Feb 2001 18:37:53 +0000 (18:37 +0000)]
[project @ 2001-02-13 18:37:53 by qrczak]
Fix evalExpr's comment: it's Bool again, not Maybe.
simonmar [Tue, 13 Feb 2001 18:08:44 +0000 (18:08 +0000)]
[project @ 2001-02-13 18:08:44 by simonmar]
beginnings of a documentation revamp
simonmar [Tue, 13 Feb 2001 18:01:23 +0000 (18:01 +0000)]
[project @ 2001-02-13 18:01:22 by simonmar]
style nitpicking
sewardj [Tue, 13 Feb 2001 17:48:25 +0000 (17:48 +0000)]
[project @ 2001-02-13 17:48:25 by sewardj]
Improve detection and rejection of unboxed tuples.
qrczak [Tue, 13 Feb 2001 17:40:37 +0000 (17:40 +0000)]
[project @ 2001-02-13 17:40:37 by qrczak]
No, please don't pass hsc2hs/Main.hs through cpp :-)
It corrupts __GLASGOW_HASKELL__ in strings (because of string gaps).
I moved the system-dependent thing to KludgedSystem (it should be
named better as it no longer contains only the system function)
so it does not require cpp.
(I keep it in sync with QForeign, which is easier if the same source
can work in both places.)
sewardj [Tue, 13 Feb 2001 17:13:39 +0000 (17:13 +0000)]
[project @ 2001-02-13 17:13:39 by sewardj]
* Turn off -O when --interactive is engaged.
* Check and abort if --interactive is used together with any non-std Way.
simonmar [Tue, 13 Feb 2001 16:58:34 +0000 (16:58 +0000)]
[project @ 2001-02-13 16:58:34 by simonmar]
markup fix
rrt [Tue, 13 Feb 2001 16:11:27 +0000 (16:11 +0000)]
[project @ 2001-02-13 16:11:27 by rrt]
Make work again on Windows. Main.hs has to be passed through CPP now.
qrczak [Tue, 13 Feb 2001 15:53:10 +0000 (15:53 +0000)]
[project @ 2001-02-13 15:53:10 by qrczak]
Main.hs is not passed through cpp, so I moved #ifdefed defaultCompiler
to module KludgedSystem which is passed through cpp.
sewardj [Tue, 13 Feb 2001 15:51:57 +0000 (15:51 +0000)]
[project @ 2001-02-13 15:51:57 by sewardj]
In interactive mode, pre-load into the runtime linker any .so/.o/.DLL
files specified on the command line.
rrt [Tue, 13 Feb 2001 15:23:33 +0000 (15:23 +0000)]
[project @ 2001-02-13 15:23:33 by rrt]
Remove typos, and NO_LARGE_TUPLES, which was the wrong way round anyway (so
we never had large tuples).
rrt [Tue, 13 Feb 2001 15:12:42 +0000 (15:12 +0000)]
[project @ 2001-02-13 15:12:42 by rrt]
Update tests not to use deprecated features (except that I had to write
Exception.catch everywhere instead of catch for some reason, because ghc
complained that catch was ambiguous (Exception. vs PrelException.).
Also add some cases to make mingwin work.
rrt [Tue, 13 Feb 2001 15:09:02 +0000 (15:09 +0000)]
[project @ 2001-02-13 15:09:02 by rrt]
Make it work on Cygwin. Story of my life.
simonmar [Tue, 13 Feb 2001 14:34:40 +0000 (14:34 +0000)]
[project @ 2001-02-13 14:34:40 by simonmar]
oops, back out accidental changes
simonmar [Tue, 13 Feb 2001 14:18:49 +0000 (14:18 +0000)]
[project @ 2001-02-13 14:18:49 by simonmar]
Don't build HS*.o for ways other than the normal way.
sewardj [Tue, 13 Feb 2001 13:11:07 +0000 (13:11 +0000)]
[project @ 2001-02-13 13:11:07 by sewardj]
Add more general support for linking .so's into the running image.
sewardj [Tue, 13 Feb 2001 13:10:14 +0000 (13:10 +0000)]
[project @ 2001-02-13 13:10:14 by sewardj]
Move library names from extra_ld_opts to extra_libraries.
sewardj [Tue, 13 Feb 2001 13:09:36 +0000 (13:09 +0000)]
[project @ 2001-02-13 13:09:36 by sewardj]
Properly handle loading .so's in interactive mode.
simonmar [Tue, 13 Feb 2001 11:11:06 +0000 (11:11 +0000)]
[project @ 2001-02-13 11:11:06 by simonmar]
make this compile with profiling on (it probably won't work, though).
rrt [Tue, 13 Feb 2001 11:10:28 +0000 (11:10 +0000)]
[project @ 2001-02-13 11:10:28 by rrt]
Use MM timers on Windows even when not profiling, as threadDelay needs it
to work properly.
Flush stdout when quitting (in RtsUtils), as Linux glibc probably works now,
and it reveals error messages that are otherwise truncated when one's
program segfaults.
simonmar [Tue, 13 Feb 2001 10:57:24 +0000 (10:57 +0000)]
[project @ 2001-02-13 10:57:24 by simonmar]
do the dlopen() check a better way.
simonmar [Tue, 13 Feb 2001 10:47:34 +0000 (10:47 +0000)]
[project @ 2001-02-13 10:47:33 by simonmar]
update the configure system to find dlopen(), whether it lives in -ldl
or in the standard C library.
I'd like to take this opportunity to throw a few bricks in the general
direction of whoever invented this godforsaken tool.
sewardj [Tue, 13 Feb 2001 10:12:45 +0000 (10:12 +0000)]
[project @ 2001-02-13 10:12:45 by sewardj]
PrelCError_HC_OPTS = +RTS -K4m -RTS
simonmar [Tue, 13 Feb 2001 09:35:45 +0000 (09:35 +0000)]
[project @ 2001-02-13 09:35:45 by simonmar]
compile ByteCodeItbls with -fvia-C
sewardj [Mon, 12 Feb 2001 16:40:34 +0000 (16:40 +0000)]
[project @ 2001-02-12 16:40:34 by sewardj]
Free the local symbol table at the end of the ocResolve_ phase; we
won't need it after that.
simonmar [Mon, 12 Feb 2001 16:08:48 +0000 (16:08 +0000)]
[project @ 2001-02-12 16:08:48 by simonmar]
comment typo
sewardj [Mon, 12 Feb 2001 13:36:49 +0000 (13:36 +0000)]
[project @ 2001-02-12 13:36:49 by sewardj]
Fix up inter-package dependencies so the run-time linker doesn't barf.
simonmar [Mon, 12 Feb 2001 13:33:47 +0000 (13:33 +0000)]
[project @ 2001-02-12 13:33:46 by simonmar]
Clean up temporary files between compilations, but cache preprocessed
modules that we might re-use.
sewardj [Mon, 12 Feb 2001 13:30:15 +0000 (13:30 +0000)]
[project @ 2001-02-12 13:30:15 by sewardj]
ocGetNames_ELF: don't load symbols in "special" (bogus!) sections >=
SHN_LORESERVE, since they don't exist.
sewardj [Mon, 12 Feb 2001 13:15:59 +0000 (13:15 +0000)]
[project @ 2001-02-12 13:15:59 by sewardj]
Make lang depend on data (since it does, really.)
simonmar [Mon, 12 Feb 2001 13:14:13 +0000 (13:14 +0000)]
[project @ 2001-02-12 13:14:13 by simonmar]
check for ThreadRelocated when unblocking a thread blocked on
delivering an async exception.
sebc [Mon, 12 Feb 2001 13:13:29 +0000 (13:13 +0000)]
[project @ 2001-02-12 13:13:29 by sebc]
Add support for MacOS X.
sewardj [Mon, 12 Feb 2001 13:03:17 +0000 (13:03 +0000)]
[project @ 2001-02-12 13:03:17 by sewardj]
include Hash.h
sewardj [Mon, 12 Feb 2001 12:46:23 +0000 (12:46 +0000)]
[project @ 2001-02-12 12:46:23 by sewardj]
Teach the runtime linker about local symbols, so that we don't have to
rely on batch linkers to resolve local symbols in libraries at
library-build-time.
sewardj [Mon, 12 Feb 2001 12:44:11 +0000 (12:44 +0000)]
[project @ 2001-02-12 12:44:11 by sewardj]
debug print wibble
simonmar [Mon, 12 Feb 2001 12:25:50 +0000 (12:25 +0000)]
[project @ 2001-02-12 12:25:50 by simonmar]
#include "Linker.h"
simonmar [Mon, 12 Feb 2001 12:22:01 +0000 (12:22 +0000)]
[project @ 2001-02-12 12:22:01 by simonmar]
add some assertions
sewardj [Mon, 12 Feb 2001 12:08:44 +0000 (12:08 +0000)]
[project @ 2001-02-12 12:08:44 by sewardj]
GNU ld 2.9.1 on sparc can't handle object files lacking a symbol table.
Give it a bogus symbol to keep it happy (a.k.a a workaround.)
sewardj [Mon, 12 Feb 2001 11:39:48 +0000 (11:39 +0000)]
[project @ 2001-02-12 11:39:48 by sewardj]
Check for unboxed tuples and barf, rather than silently generate bogus
code. (There will be a proper user-level check higher up, too; this is
just for our sanity.)
sewardj [Mon, 12 Feb 2001 11:38:49 +0000 (11:38 +0000)]
[project @ 2001-02-12 11:38:49 by sewardj]
The linker is initialised from the Haskell world now.
simonmar [Mon, 12 Feb 2001 10:15:19 +0000 (10:15 +0000)]
[project @ 2001-02-12 10:15:19 by simonmar]
- Don't need -optc-DGHCI now
- a couple of wibbles
simonmar [Mon, 12 Feb 2001 10:13:43 +0000 (10:13 +0000)]
[project @ 2001-02-12 10:13:43 by simonmar]
GhcWithInterpreter is now YES by default on supported architectures.
chak [Mon, 12 Feb 2001 04:55:33 +0000 (04:55 +0000)]
[project @ 2001-02-12 04:55:33 by chak]
Finish SimonM's "non-optional GHCi RTS" patch.
simonmar [Sun, 11 Feb 2001 17:51:08 +0000 (17:51 +0000)]
[project @ 2001-02-11 17:51:07 by simonmar]
Bite the bullet and make GHCi support non-optional in the RTS. GHC
4.11 should be able to build GHCi without any additional tweaks now.
- the Linker is split into two parts: LinkerBasic.c, containing the
routines required by the rest of the RTS, and Linker.c, containing
the linker proper, which is not referred to from the rest of the RTS.
Only Linker.c requires -ldl, so programs which don't make use of the
linker (everything except GHC, in other words) won't need -ldl.
simonmar [Sun, 11 Feb 2001 17:18:13 +0000 (17:18 +0000)]
[project @ 2001-02-11 17:18:13 by simonmar]
Remove GhcReportCompiles - it was pretty cool, but got lost somewhere
on the road to GHCi, and we never really used it anyhow.
simonmar [Sun, 11 Feb 2001 17:14:48 +0000 (17:14 +0000)]
[project @ 2001-02-11 17:14:48 by simonmar]
cruftbuster
simonmar [Sun, 11 Feb 2001 17:12:35 +0000 (17:12 +0000)]
[project @ 2001-02-11 17:12:35 by simonmar]
- remove flag settings for modules which don't exist
- remove all heap-size settings less than 16m, and set the default to 16m.
- remove pre-ghc-4.08 compatibility cruft; the compiler requires 4.08 now.
simonmar [Sun, 11 Feb 2001 17:01:46 +0000 (17:01 +0000)]
[project @ 2001-02-11 17:01:46 by simonmar]
Remove some duplicate Makefile gunk, and collect the symbolic link
code together in mk/target.mk.
simonmar [Sun, 11 Feb 2001 16:48:21 +0000 (16:48 +0000)]
[project @ 2001-02-11 16:48:21 by simonmar]
clean up a little
simonmar [Sun, 11 Feb 2001 16:32:48 +0000 (16:32 +0000)]
[project @ 2001-02-11 16:32:48 by simonmar]
Create ghci-$(ProjectVersion) and ghci-inplace mini-scripts, and a
ghci->ghci-$(ProjectVersion) link.
I put these in here rather than ghc/compiler, because ghc/compiler
already has a ghci subdirectory.
simonmar [Sun, 11 Feb 2001 14:33:27 +0000 (14:33 +0000)]
[project @ 2001-02-11 14:33:27 by simonmar]
Experimental implementation of a bizarre, and probably not well
thought out, idea I had last week: making GHCi extensible, in Haskell.
Two new commands:
:def <name> <expr>
:undef <name>
:def defines a new command, :<name>, with the semantics that
(<expr> :: String -> IO String)
is run, passed the argument to :<name>, and the resulting string is
fed back through GHCi's command-line interpreter (\n may be used to
separate commands in the returned string). <expr> is compiled once,
when the :def command is entered.
Simple example:
Prelude> :def date (\s -> Time.getClockTime >>= print >> return "")
Prelude> :date
Sun Feb 11 13:44:28 GMT 2001
Prelude>
Implementing built-in GHCi commands with macros:
Prelude> :def mycd (\s -> Directory.setCurrentDirectory s >> return "")
Prelude> :mycd /home/simonm
Prelude> :!ls
...
Define new functions from the command-line:
Prelude> :! echo "module Tmp where" >/tmp/Tmp.hs
Prelude> :def let (\s -> return (":! echo " ++ s ++ ">> /tmp/Tmp.hs\n:load /tmp/Tmp.hs"))
Prelude> :let x = 42
Compiling Tmp ... compilation IS required
Ok, modules loaded: Tmp.
Tmp> x
42
Tmp> :let y = x
Compiling Tmp ... compilation IS required
Ok, modules loaded: Tmp.
Tmp> y
42
Tmp>
I'm sure the possibilities are endless...
simonmar [Sun, 11 Feb 2001 13:13:37 +0000 (13:13 +0000)]
[project @ 2001-02-11 13:13:37 by simonmar]
Replace some OS-specific ifdefs which should really be ARCH-specific.
Fixes FreeBSD support.
qrczak [Sun, 11 Feb 2001 09:36:00 +0000 (09:36 +0000)]
[project @ 2001-02-11 09:36:00 by qrczak]
Reverse the 'default' list.
qrczak [Sat, 10 Feb 2001 10:43:25 +0000 (10:43 +0000)]
[project @ 2001-02-10 10:43:25 by qrczak]
Move kludgedSystem (renamed to system) to a separate module.
This avoids ugly interactions with the C preprocessor (string gaps,
__GLASGOW_HASKELL__ in strings).
simonmar [Fri, 9 Feb 2001 17:29:59 +0000 (17:29 +0000)]
[project @ 2001-02-09 17:29:59 by simonmar]
remove the bug report location in the welcome msg; it pushed the
message over 80 columns and is available from the ghc homepage in any
case.
sewardj [Fri, 9 Feb 2001 17:23:57 +0000 (17:23 +0000)]
[project @ 2001-02-09 17:23:57 by sewardj]
Avoid unused-var warnings.