summaryrefslogtreecommitdiff
path: root/ghc/compiler/utils/FastString.lhs
Commit message (Collapse)AuthorAgeFilesLines
* Reorganisation of the source treeSimon Marlow2006-04-071-499/+0
| | | | | | | | | | | | | | | Most of the other users of the fptools build system have migrated to Cabal, and with the move to darcs we can now flatten the source tree without losing history, so here goes. The main change is that the ghc/ subdir is gone, and most of what it contained is now at the top level. The build system now makes no pretense at being multi-project, it is just the GHC build system. No doubt this will break many things, and there will be a period of instability while we fix the dependencies. A straightforward build should work, but I haven't yet fixed binary/source distributions. Changes to the Building Guide will follow, too.
* Fix CPP failure by adding space before hASH_TBL_SIZEsimonpj@microsoft.com2006-02-091-1/+1
|
* add -dfaststring-stats to dump some stats about the FastString hash tableSimon Marlow2006-02-081-0/+25
|
* [project @ 2006-01-10 09:47:51 by simonmar]simonmar2006-01-101-0/+6
| | | | Fix compilation with GHC 6.2.x, hopefully
* [project @ 2006-01-09 13:25:50 by simonmar]simonmar2006-01-091-9/+18
| | | | | | | | Fix up to compile with GHC 5.04.x again. Also includes a fix for a memory error I discovered along the way: should fix the "scavenge_one" crash in the stage2 build of recent HEADs.
* [project @ 2006-01-06 16:30:17 by simonmar]simonmar2006-01-061-388/+352
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for UTF-8 source files GHC finally has support for full Unicode in source files. Source files are now assumed to be UTF-8 encoded, and the full range of Unicode characters can be used, with classifications recognised using the implementation from Data.Char. This incedentally means that only the stage2 compiler will recognise Unicode in source files, because I was too lazy to port the unicode classifier code into libcompat. Additionally, the following synonyms for keywords are now recognised: forall symbol (U+2200) forall right arrow (U+2192) -> left arrow (U+2190) <- horizontal ellipsis (U+22EF) .. there are probably more things we could add here. This will break some source files if Latin-1 characters are being used. In most cases this should result in a UTF-8 decoding error. Later on if we want to support more encodings (perhaps with a pragma to specify the encoding), I plan to do it by recoding into UTF-8 before parsing. Internally, there were some pretty big changes: - FastStrings are now stored in UTF-8 - Z-encoding has been moved right to the back end. Previously we used to Z-encode every identifier on the way in for simplicity, and only decode when we needed to show something to the user. Instead, we now keep every string in its UTF-8 encoding, and Z-encode right before printing it out. To avoid Z-encoding the same string multiple times, the Z-encoding is cached inside the FastString the first time it is requested. This speeds up the compiler - I've measured some definite improvement in parsing at least, and I expect compilations overall to be faster too. It also cleans up a lot of cruft from the OccName interface. Z-encoding is nicely hidden inside the Outputable instance for Names & OccNames now. - StringBuffers are UTF-8 too, and are now represented as ForeignPtrs. - I've put together some test cases, not by any means exhaustive, but there are some interesting UTF-8 decoding error cases that aren't obvious. Also, take a look at unicode001.hs for a demo.
* [project @ 2005-08-12 14:43:04 by simonpj]simonpj2005-08-121-1/+1
| | | | Fix typos
* [project @ 2005-08-12 12:36:59 by simonmar]simonmar2005-08-121-44/+20
| | | | | | | | | | | | | | Use a better string hash: the previous one only took into account 3 characters from the string (0, N/2, N), leading to some bad collisions with lots of similar strings (eg. local names generated by the compiler). Worse, it had a bug in the N==2 case, which meant that it ignored one of the characters in the string completely. We now traverse the whole string, using the algorithm from Data.Hash which seems to work reasonably well. For good measure, I quadrupled the size of the hash table too, from 1000 to 4000 entries.
* [project @ 2005-08-02 14:56:50 by simonmar]simonmar2005-08-021-0/+3
| | | | | - move instance Show FastString into FastString module - instance Outputable FastString should use ftext instead of unpackFS
* [project @ 2005-05-21 15:12:00 by panne]panne2005-05-211-1/+1
| | | | Warning police: Use non-deprecated form of "foreign import"
* [project @ 2005-03-31 10:16:33 by simonmar]simonmar2005-03-311-0/+2
| | | | | | | Tweaks to get the GHC sources through Haddock. Doesn't quite work yet, because Haddock complains about the recursive modules. Haddock needs to understand SOURCE imports (it can probably just ignore them as a first attempt).
* [project @ 2004-08-13 13:04:50 by simonmar]simonmar2004-08-131-3/+12
| | | | Merge backend-hacking-branch onto HEAD. Yay!
* [project @ 2003-10-09 11:58:39 by simonpj]simonpj2003-10-091-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ------------------------- GHC heart/lung transplant ------------------------- This major commit changes the way that GHC deals with importing types and functions defined in other modules, during renaming and typechecking. On the way I've changed or cleaned up numerous other things, including many that I probably fail to mention here. Major benefit: GHC should suck in many fewer interface files when compiling (esp with -O). (You can see this with -ddump-rn-stats.) It's also some 1500 lines of code shorter than before. ** So expect bugs! I can do a 3-stage bootstrap, and run ** the test suite, but you may be doing stuff I havn't tested. ** Don't update if you are relying on a working HEAD. In particular, (a) External Core and (b) GHCi are very little tested. But please, please DO test this version! ------------------------ Big things ------------------------ Interface files, version control, and importing declarations ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * There is a totally new data type for stuff that lives in interface files: Original names IfaceType.IfaceExtName Types IfaceType.IfaceType Declarations (type,class,id) IfaceSyn.IfaceDecl Unfoldings IfaceSyn.IfaceExpr (Previously we used HsSyn for type/class decls, and UfExpr for unfoldings.) The new data types are in iface/IfaceType and iface/IfaceSyn. They are all instances of Binary, so they can be written into interface files. Previous engronkulation concering the binary instance of RdrName has gone away -- RdrName is not an instance of Binary any more. Nor does Binary.lhs need to know about the ``current module'' which it used to, which made it specialised to GHC. A good feature of this is that the type checker for source code doesn't need to worry about the possibility that we might be typechecking interface file stuff. Nor does it need to do renaming; we can typecheck direct from IfaceSyn, saving a whole pass (module TcIface) * Stuff from interface files is sucked in *lazily*, rather than being eagerly sucked in by the renamer. Instead, we use unsafeInterleaveIO to capture a thunk for the unfolding of an imported function (say). If that unfolding is every pulled on, TcIface will scramble over the unfolding, which may in turn pull in the interface files of things mentioned in the unfolding. The External Package State is held in a mutable variable so that it can be side-effected by this lazy-sucking-in process (which may happen way later, e.g. when the simplifier runs). In effect, the EPS is a kind of lazy memo table, filled in as we suck things in. Or you could think of it as a global symbol table, populated on demand. * This lazy sucking is very cool, but it can lead to truly awful bugs. The intent is that updates to the symbol table happen atomically, but very bad things happen if you read the variable for the table, and then force a thunk which updates the table. Updates can get lost that way. I regret this subtlety. One example of the way it showed up is that the top level of TidyPgm (which updates the global name cache) to be much more disciplined about those updates, since TidyPgm may itself force thunks which allocate new names. * Version numbering in interface files has changed completely, fixing one major bug with ghc --make. Previously, the version of A.f changed only if A.f's type and unfolding was textually different. That missed changes to things that A.f's unfolding mentions; which was fixed by eagerly sucking in all of those things, and listing them in the module's usage list. But that didn't work with --make, because they might have been already sucked in. Now, A.f's version changes if anything reachable from A.f (via interface files) changes. A module with unchanged source code needs recompiling only if the versions of any of its free variables changes. [This isn't quite right for dictionary functions and rules, which aren't mentioned explicitly in the source. There are extensive comments in module MkIface, where all version-handling stuff is done.] * We don't need equality on HsDecls any more (because they aren't used in interface files). Instead we have a specialised equality for IfaceSyn (eqIfDecl etc), which uses IfaceEq instead of Bool as its result type. See notes in IfaceSyn. * The horrid bit of the renamer that tried to predict what instance decls would be needed has gone entirely. Instead, the type checker simply sucks in whatever instance decls it needs, when it needs them. Easy! Similarly, no need for 'implicitModuleFVs' and 'implicitTemplateHaskellFVs' etc. Hooray! Types and type checking ~~~~~~~~~~~~~~~~~~~~~~~ * Kind-checking of types is far far tidier (new module TcHsTypes replaces the badly-named TcMonoType). Strangely, this was one of my original goals, because the kind check for types is the Right Place to do type splicing, but it just didn't fit there before. * There's a new representation for newtypes in TypeRep.lhs. Previously they were represented using "SourceTypes" which was a funny compromise. Now they have their own constructor in the Type datatype. SourceType has turned back into PredType, which is what it used to be. * Instance decl overlap checking done lazily. Consider instance C Int b instance C a Int These were rejected before as overlapping, because when seeking (C Int Int) one couldn't tell which to use. But there's no problem when seeking (C Bool Int); it can only be the second. So instead of checking for overlap when adding a new instance declaration, we check for overlap when looking up an Inst. If we find more than one matching instance, we see if any of the candidates dominates the others (in the sense of being a substitution instance of all the others); and only if not do we report an error. ------------------------ Medium things ------------------------ * The TcRn monad is generalised a bit further. It's now based on utils/IOEnv.lhs, the IO monad with an environment. The desugarer uses the monad too, so that anything it needs can get faulted in nicely. * Reduce the number of wired-in things; in particular Word and Integer are no longer wired in. The latter required HsLit.HsInteger to get a Type argument. The 'derivable type classes' data types (:+:, :*: etc) are not wired in any more either (see stuff about derivable type classes below). * The PersistentComilerState is now held in a mutable variable in the HscEnv. Previously (a) it was passed to and then returned by many top-level functions, which was painful; (b) it was invariably accompanied by the HscEnv. This change tidies up top-level plumbing without changing anything important. * Derivable type classes are treated much more like 'deriving' clauses. Previously, the Ids for the to/from functions lived inside the TyCon, but now the TyCon simply records their existence (with a simple boolean). Anyone who wants to use them must look them up in the environment. This in turn makes it easy to generate the to/from functions (done in types/Generics) using HsSyn (like TcGenDeriv for ordinary derivings) instead of CoreSyn, which in turn means that (a) we don't have to figure out all the type arguments etc; and (b) it'll be type-checked for us. Generally, the task of generating the code has become easier, which is good for Manuel, who wants to make it more sophisticated. * A Name now says what its "parent" is. For example, the parent of a data constructor is its type constructor; the parent of a class op is its class. This relationship corresponds exactly to the Avail data type; there may be other places we can exploit it. (I made the change so that version comparison in interface files would be a bit easier; but in fact it tided up other things here and there (see calls to Name.nameParent). For example, the declaration pool, of declararations read from interface files, but not yet used, is now keyed only by the 'main' name of the declaration, not the subordinate names. * New types OccEnv and OccSet, with the usual operations. OccNames can be efficiently compared, because they have uniques, thanks to the hashing implementation of FastStrings. * The GlobalRdrEnv is now keyed by OccName rather than RdrName. Not only does this halve the size of the env (because we don't need both qualified and unqualified versions in the env), but it's also more efficient because we can use a UniqFM instead of a FiniteMap. Consequential changes to Provenance, which has moved to RdrName. * External Core remains a bit of a hack, as it was before, done with a mixture of HsDecls (so that recursiveness and argument variance is still inferred), and IfaceExprs (for value declarations). It's not thoroughly tested. ------------------------ Minor things ------------------------ * DataCon fields dcWorkId, dcWrapId combined into a single field dcIds, that is explicit about whether the data con is a newtype or not. MkId.mkDataConWorkId and mkDataConWrapId are similarly combined into MkId.mkDataConIds * Choosing the boxing strategy is done for *source* type decls only, and hence is now in TcTyDecls, not DataCon. * WiredIn names are distinguished by their n_sort field, not by their location, which was rather strange * Define Maybes.mapCatMaybes :: (a -> Maybe b) -> [a] -> [b] and use it here and there * Much better pretty-printing of interface files (--show-iface) Many, many other small things. ------------------------ File changes ------------------------ * New iface/ subdirectory * Much of RnEnv has moved to iface/IfaceEnv * MkIface and BinIface have moved from main/ to iface/ * types/Variance has been absorbed into typecheck/TcTyDecls * RnHiFiles and RnIfaces have vanished entirely. Their work is done by iface/LoadIface * hsSyn/HsCore has gone, replaced by iface/IfaceSyn * typecheck/TcIfaceSig has gone, replaced by iface/TcIface * typecheck/TcMonoType has been renamed to typecheck/TcHsType * basicTypes/Var.hi-boot and basicTypes/Generics.hi-boot have gone altogether
* [project @ 2003-08-20 12:55:14 by simonmar]simonmar2003-08-201-3/+3
| | | | | Fix bug in hashSubStringBA, which it appears has been broken for ever. However, I suspect so far we've never tickled the bug in GHC.
* [project @ 2002-12-17 12:29:48 by simonmar]simonmar2002-12-171-3/+3
| | | | On second thoughts, use memcmp instead.
* [project @ 2002-12-17 12:27:30 by simonmar]simonmar2002-12-171-9/+10
| | | | | Oops, cmpFS uses strcmp() to compare strings, so it has a '\0' terminator requirement. Fix it to use strncmp() instead.
* [project @ 2002-12-17 11:39:41 by simonmar]simonmar2002-12-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | Fix recent breakage on the HEAD. This was caused by the fix to Lex.lhs to treat primitive strings as "narrow" FastStrings in all cases, rather than Unicode ("wide") FastStrings if the string contained a '\0'. The problem is that narrow FastStrings aren't set up to handle strings containing '\0'. They used to be, but it got broken somewhere along the line. This commit: - remove the '\0' test from unpackCStringBA (it takes a length argument anyway), and rename it to unpackNBytesBA. This fixes the bug. - remove the '\0' terminator from all strings generated by the functions in PrimPacked. The terminators aren't required, as far as I can tell. This should have a tiny but positive effect on compile times. MERGE TO STABLE
* [project @ 2002-09-06 14:35:42 by simonmar]simonmar2002-09-061-1/+1
| | | | | | | Finally separate the compiler from hslibs. Mainly import wibbles, and use the new POSIX library when bootstrapping.
* [project @ 2002-08-30 09:14:02 by simonmar]simonmar2002-08-301-1/+0
| | | | Remove unused import of PrelPack (should fix the build again)
* [project @ 2002-08-29 15:44:11 by simonmar]simonmar2002-08-291-50/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Housekeeping: - The main goal is to remove dependencies on hslibs for a bootstrapped compiler, leaving only a requirement that the packages base, haskell98 and readline are built in stage 1 in order to bootstrap. We're almost there: Posix is still required for signal handling, but all other dependencies on hslibs are now gone. Uses of Addr and ByteArray/MutableByteArray array are all gone from the compiler. PrimPacked defines the Ptr type for GHC 4.08 (which didn't have it), and it defines simple BA and MBA types to replace uses of ByteArray and MutableByteArray respectively. - Clean up import lists. HsVersions.h now defines macros for some modules which have moved between GHC versions. eg. one now imports 'GLAEXTS' to get at unboxed types and primops in the compiler. Many import lists have been sorted as per the recommendations in the new style guidelines in the commentary. I've built the compiler with GHC 4.08.2, 5.00.2, 5.02.3, 5.04 and itself, and everything still works here. Doubtless I've got something wrong, though.
* [project @ 2002-05-10 20:44:29 by panne]panne2002-05-101-1/+0
| | | | Re-enable bootstrapping: More Ptr trouble, now that it's (almost) abstract...
* [project @ 2002-04-29 14:03:38 by simonmar]simonmar2002-04-291-108/+21
| | | | | | | | | | | | | | | | | | | | | | | | | FastString cleanup, stage 1. The FastString type is no longer a mixture of hashed strings and literal strings, it contains hashed strings only with O(1) comparison (except for UnicodeStr, but that will also go away in due course). To create a literal instance of FastString, use FSLIT(".."). By far the most common use of the old literal version of FastString was in the pattern ptext SLIT("...") this combination still works, although it doesn't go via FastString any more. The next stage will be to remove the need to use this special combination at all, using a RULE. To convert a FastString into an SDoc, now use 'ftext' instead of 'ptext'. I've also removed all the FAST_STRING related macros from HsVersions.h except for SLIT and FSLIT, just use the relevant functions from FastString instead.
* [project @ 2002-03-04 17:01:26 by simonmar]simonmar2002-03-041-7/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Binary Interface Files - stage 1 -------------------------------- This commit changes the default interface file format from text to binary, in order to improve compilation performace. To view an interface file, use 'ghc --show-iface Foo.hi'. utils/Binary.hs is the basic Binary I/O library, based on the nhc98 binary I/O library but much stripped-down and working in terms of bytes rather than bits, and with some special features for GHC: it remembers which Module is being emitted to avoid dumping too many qualified names, and it keeps track of a "dictionary" of FastStrings so that we don't dump the same FastString more than once into the binary file. I'll make a generic version of this for the libraries at some point. main/BinIface.hs contains most of the Binary instances. Some instances are in the same module as the data type (RdrName, Name, OccName in particular). Most instances were generated using a modified version of DrIFT, which I'll commit later. However, editing them by hand isn't hard (certainly easier than modifying ParseIface.y). The first thing in a binary interface is the interface version, so nice error messages will be generated if the binary format changes and you still have old interfaces lying around. The version also now includes the "way" as an extra sanity check. Other changes ------------- I don't like the way FastStrings contain both hashed strings (with O(1) comparison) and literal C strings (with O(n) comparison). So as a first step to separating these I made serveral "literal" type strings into hashed strings. SLIT() still generates a literal, and now FSLIT() generates a hashed string. With DEBUG on, you'll get a warning if you try to compare any SLIT()s with anything, and the compiler will fall over if you try to dump any literal C strings into an interface file (usually indicating a use of SLIT() which should be FSLIT()). mkSysLocal no longer re-encodes its FastString argument each time it is called. I also fixed the -pgm options so that the argument can now optionally be separted from the option. Bugfix: PrelNames declared Names for several comparison primops, eg. eqCharName, eqIntName etc. but these had different uniques from the real primop names. I've moved these to PrimOps and defined them using mkPrimOpIdName instead, and deleted some for which we don't have real primops (Manuel: please check that things still work for you after this change).
* [project @ 2002-02-12 15:17:13 by simonmar]simonmar2002-02-121-57/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Switch over to the new hierarchical libraries --------------------------------------------- This commit reorganises our libraries to use the new hierarchical module namespace extension. The basic story is this: - fptools/libraries contains the new hierarchical libraries. Everything in here is "clean", i.e. most deprecated stuff has been removed. - fptools/libraries/base is the new base package (replacing "std") and contains roughly what was previously in std, lang, and concurrent, minus deprecated stuff. Things that are *not allowed* in libraries/base include: Addr, ForeignObj, ByteArray, MutableByteArray, _casm_, _ccall_, ``'', PrimIO For ByteArrays and MutableByteArrays we use UArray and STUArray/IOUArray respectively now. Modules previously called PrelFoo are now under fptools/libraries/GHC. eg. PrelBase is now GHC.Base. - fptools/libraries/haskell98 provides the Haskell 98 std. libraries (Char, IO, Numeric etc.) as a package. This package is enabled by default. - fptools/libraries/network is a rearranged version of the existing net package (the old package net is still available; see below). - Other packages will migrate to fptools/libraries in due course. NB. you need to checkout fptools/libraries as well as fptools/hslibs now. The nightly build scripts will need to be tweaked. - fptools/hslibs still contains (almost) the same stuff as before. Where libraries have moved into the new hierarchy, the hslibs version contains a "stub" that just re-exports the new version. The idea is that code will gradually migrate from fptools/hslibs into fptools/libraries as it gets cleaned up, and in a version or two we can remove the old packages altogether. - I've taken the opportunity to make some changes to the build system, ripping out the old hslibs Makefile stuff from mk/target.mk; the new package building Makefile code is in mk/package.mk (auto-included from mk/target.mk). The main improvement is that packages now register themselves at make boot time using ghc-pkg, and the monolithic package.conf in ghc/driver is gone. I've updated the standard packages but haven't tested win32, graphics, xlib, object-io, or OpenGL yet. The Makefiles in these packages may need some further tweaks, and they'll need pkg.conf.in files added. - Unfortunately all this rearrangement meant I had to bump the interface-file version and create a bunch of .hi-boot-6 files :-(
* [project @ 2001-05-21 14:00:40 by simonmar]simonmar2001-05-211-108/+1
| | | | Remove support for GHC < 4.00
* [project @ 2001-05-19 20:20:56 by qrczak]qrczak2001-05-191-3/+2
| | | | | | | | | | | | | | | | | | | Make ghc compilable with itself after the implementation of handle IO changed, by changing an ugly mess of #ifdefs and low-level ghc-internals-specific kludges into a yet uglier mess with more #ifdefs and kludges. Wouldn't Haskell 98 implementation of a lexer be fast enough? :-) This won't compile with older versions of ghc-5.01. You may temporarily change 501 to 502 in #ifdefs here, or use an older ghc. The compiler still doesn't work at all when compiled with itself: it writes complete nonsense into .hc files. A remaining error: ghc/lib/std doesn't link PrelHandle_hsc.o into libHSstd.a. Function read_wrap is inline but for some reason it's needed for linking some programs (e.g. ghc itself).
* [project @ 2001-04-26 15:42:06 by sewardj]sewardj2001-04-261-0/+1
| | | | | | | Fix bug in which *primitive* string literals were being checked for Unicode-ness, even though they are not allowed to be; literals containing zero bytes were then unicodified, which crashes the bytecode generator.
* [project @ 2001-01-31 15:38:02 by sewardj]sewardj2001-01-311-0/+5
| | | | | Give a clause for hPutFS on UnicodeStr. Apparently only needed so that -ddump-stix doesn't bomb when printing unicode strings.
* [project @ 2001-01-12 07:44:50 by qrczak]qrczak2001-01-121-77/+8
| | | | | Adapt to the Addr/Ptr changes. Throw away mkFastSubStringFO, mkFastSubStringFO#, eqStrPrefixFO.
* [project @ 2000-10-16 10:16:33 by sewardj]sewardj2000-10-161-1/+1
| | | | Don't try to import IOError non-abstractly (avoids a compiler warning).
* [project @ 2000-08-07 23:37:19 by qrczak]qrczak2000-08-071-23/+112
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now Char, Char#, StgChar have 31 bits (physically 32). "foo"# is still an array of bytes. CharRep represents 32 bits (on a 64-bit arch too). There is also Int8Rep, used in those places where bytes were originally meant. readCharArray, indexCharOffAddr etc. still use bytes. Storable and {I,M}Array use wide Chars. In future perhaps all sized integers should be primitive types. Then some usages of indexing primops scattered through the code could be changed to then-available Int8 ones, and then Char variants of primops could be made wide (other usages that handle text should use conversion that will be provided later). I/O and _ccall_ arguments assume ISO-8859-1. UTF-8 is internally used for string literals (only). Z-encoding is ready for Unicode identifiers. Ranges of intlike and charlike closures are more easily configurable. I've probably broken nativeGen/MachCode.lhs:chrCode for Alpha but I don't know the Alpha assembler to fix it (what is zapnot?). Generally I'm not sure if I've done the NCG changes right. This commit breaks the binary compatibility (of course). TODO: * is* and to{Lower,Upper} in Char (in progress). * Libraries for text conversion (in design / experiments), to be plugged to I/O and a higher level foreign library. * PackedString. * StringBuffer and accepting source in encodings other than ISO-8859-1.
* [project @ 2000-04-14 08:55:42 by simonmar]simonmar2000-04-141-1/+1
| | | | fix up imports of ForeignObj(..).
* [project @ 2000-04-14 08:52:35 by simonmar]simonmar2000-04-141-4/+4
| | | | _ForeignObj ==> ForeignObj
* [project @ 2000-04-14 08:29:49 by simonmar]simonmar2000-04-141-5/+7
| | | | we should be using hPutBufFull here.
* [project @ 2000-04-13 19:31:05 by panne]panne2000-04-131-2/+3
| | | | | | | | | | Bootstrapping fun: * Addr is an abstract type in Addr, so import from PrelAddr instead * Ignore the (recently introduced) return value of hPutBuf{,BA} Probably more to come. No problem, as long as I don't run out of malt first... %-)
* [project @ 2000-03-19 13:36:59 by panne]panne2000-03-191-0/+1
| | | | *sigh* hPutBuf{,BA} versionitis again, this time for bootstrapping 4.07
* [project @ 2000-03-15 11:11:08 by simonmar]simonmar2000-03-151-2/+10
| | | | sigh, add some more #ifdefs to this file (MutableArray/STArray changes).
* [project @ 2000-03-13 10:28:51 by simonmar]simonmar2000-03-131-1/+1
| | | | Pick up the pieces after Sven's Saturday Night Fever :)
* [project @ 2000-03-11 23:55:16 by panne]panne2000-03-111-1/+4
| | | | Saturday Night Fever: hPutBufBA again... >:-(
* [project @ 1999-10-13 10:09:03 by simonmar]simonmar1999-10-131-9/+68
| | | | #ifdefs for bootstrapping
* [project @ 1999-06-01 16:40:41 by simonmar]simonmar1999-06-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | This commit replaces the old yacc parser with a Happy-generated one. Notes: - The generated .hs file is *big*. Best to use a recent version of Happy, and even better to add the -c flag to use unsafeCoerce# with ghc (versions 4.02+ please). - The lexer has grown all sorts of unsightly growths and should be put down as soon as possible. - Parse errors may result in strange diagnostics. I'm looking into this. - HsSyn now contains a few extra constructors due to the way patterns are parsed as expressions in the parser. - The layout rule is implemented according to the Haskell report. I found a couple of places in the libraries where we previously weren't adhering to this - in particular the rule about "nested contexts must be more indented than outer contexts". The rule is necessary to disambiguate in the presence of empty declaration lists.
* [project @ 1999-01-14 16:55:16 by sof]sof1999-01-141-0/+13
| | | | | | Added indexFS, indexFS :: FastString -> Int -> Char
* [project @ 1998-12-02 13:17:09 by simonm]simonm1998-12-021-9/+32
| | | | Move 4.01 onto the main trunk.
* [project @ 1998-08-19 07:47:46 by sof]sof1998-08-191-1/+1
| | | | oops, one branch of an #ifdef had been de-activated by accident
* [project @ 1998-08-18 13:45:20 by sof]sof1998-08-181-1/+8
| | | | Some more 3.03 ForeignObj adjustments
* [project @ 1998-08-14 16:34:14 by sof]sof1998-08-141-1/+1
| | | | Remove flushBuf from PrelHandle import list; not used
* [project @ 1998-08-14 11:15:07 by sof]sof1998-08-141-2/+21
| | | | If possible, use new IO support for doing block IO
* [project @ 1998-02-03 17:13:54 by simonm]simonm1998-02-031-22/+31
| | | | | | | | - Fixes for bootstrapping with 3.01. - Use 'official' extension interfaces rather than internal prelude modules (such as ArrBase) where possible. - Remove some cruft. - Delete some unused imports found by '-fwarn-unused-imports'.
* [project @ 1998-01-20 10:20:33 by sof]sof1998-01-201-3/+3
| | | | Removed indexCharOffFO#: not needed anymore
* [project @ 1998-01-08 18:03:08 by simonm]simonm1998-01-081-198/+158
| | | | | | | | | | | | | | | | | | | The Great Multi-Parameter Type Classes Merge. Notes from Simon (abridged): * Multi-parameter type classes are fully implemented. * Error messages from the type checker should be noticeably improved * Warnings for unused bindings (-fwarn-unused-names) * many other minor bug fixes. Internally there are the following changes * Removal of Haskell 1.2 compatibility. * Dramatic clean-up of the PprStyle stuff. * The type Type has been substantially changed. * The dictionary for each class is represented by a new data type for that purpose, rather than by a tuple.