- 28 Dec, 2001 4 commits
-
-
simonpj authored
--------------------- Dealing with deriving --------------------- I spent a ridiculously long time peering at a bug report whereby a 'deriving' clause sent GHC 5.02.1 into a loop. It was all to do with allowing instances like instance Foo a b => Baz (T a) (Notice the 'b' on the left which does not appear on the right.) I realised that it's hard for the deriving machinery to find a fixpoint when these sort of instance decls are around. So I now constrain *derived* instance decls not to have this form; all the tyvars on the left must appear on the right. On the way I commoned up the previously-separate tcSimplify machinery for 'deriving' and 'default' decls with that for everything else. As a result, quite a few files are touched. I hope I havn't broken anything.
-
simonpj authored
----------------------------- Buglet in rank-N polymorphism ----------------------------- Fix a bug in the way result type signatures are handled; they hadn't been brought into the rank-N polymorphism world.
-
sof authored
heal
-
sof authored
debugging-by-nightly-build-reports; give poke_c_flag a correct FI decl
-
- 27 Dec, 2001 3 commits
-
-
sof authored
Get rid of uses of #const, #peek, #poke and #ptr from PrelPosix.hsc (this leaves just uses of #type in PrelPosix) - provide constant and accessor wrappers via PrelIOUtils.c instead. Who knows, we might just be able to bootstrap via .hc files again..? Only compiled & tested under Win32.
-
sof authored
Added & exported low-level memcpy() wrappers - possible to offset both src and dest.
-
sof authored
- removed PrelPosix.c_read, PrelPosix.c_write - added Ptr and RawBuffer versions of PrelHandle.write_off, and PrelHandle.read_off and exported them, i.e., PrelHandle now exports: read_off_ba :: FD -> Bool -> RawBuffer -> Int -> CInt -> IO CInt read_off :: FD -> Bool -> Ptr CChar -> Int -> CInt -> IO CInt write_off_ba :: CInt -> Bool -> RawBuffer -> Int -> CInt -> IO CInt write_off :: CInt -> Bool -> Ptr CChar -> Int -> CInt -> IO CInt - make hPutChar (win)socket friendly.
-
- 26 Dec, 2001 1 commit
-
-
sof authored
add exeext to HS_PROG to avoid redundant re-linking
-
- 21 Dec, 2001 6 commits
- 20 Dec, 2001 8 commits
-
-
sewardj authored
Move some small inline-in-C functions out of PrelPosix.hsc and into the supporting cbits sources, where they belong. Following this change, can you now compile the entire Prelude on x86-linux with the native code generator, and get something which actually works properly.
-
simonpj authored
Wibbles
-
simonpj authored
Comments
-
simonmar authored
Now that we can derive arbitrary classes for newtypes, use this to derive all the classes we need for the types in PrelCTypes and PrelCTypesISO, instead of the previous hack of explicitly coercing the methods. This should improve the quality of code using these types too; the coercions were surely getting in the way of optimisations before.
-
sewardj authored
Outline freeStablePtr, so NCG-generated code actually has something to call :) Also remove the presumably-defunct splitStablePtr.
-
sewardj authored
Generate floating-point comparisons on x86 which deal with NaNs in what I assume is an IEEE854 compliant fashion. For == >= > <= < if either arg is a NaN, produce False, and for /= if either arg is a NaN, produce True. This is the behaviour that gcc has, by default. Requires some ultramagical x86 code frags to be emitted. A big comment in PprMach explains how it works.
-
sewardj authored
nano-comment-wibble
-
simonpj authored
--------------------------------------------- More type system extensions (for John Hughes) --------------------------------------------- 1. Added a brand-new extension that lets you derive ARBITRARY CLASSES for newtypes. Thus newtype Age = Age Int deriving( Eq, Ord, Shape, Ix ) The idea is that the dictionary for the user-defined class Shape Age is *identical* to that for Shape Int, so there is really no deriving work to do. This saves you writing the very tiresome instance decl: instance Shape Age where shape_op1 (Age x) = shape_op1 x shape_op2 (Age x1) (Age x2) = shape_op2 x1 x2 ...etc... It's more efficient, too, becuase the Shape Age dictionary really will be identical to the Shape Int dictionary. There's an exception for Read and Show, because the derived instance *isn't* the same. There is a complication where higher order stuff is involved. Here is the example John gave: class StateMonad s m | m -> s where ... newtype Parser tok m a = Parser (State [tok] (Failure m) a) deriving( Monad, StateMonad ) Then we want the derived instance decls to be instance Monad (State [tok] (Failure m)) => Monad (Parser tok m) instance StateMonad [tok] (State [tok] (Failure m)) => StateMonad [tok] (Parser tok m) John is writing up manual entry for all of this, but this commit implements it. I think. 2. Added -fallow-incoherent-instances, and documented it. The idea is that sometimes GHC is over-protective about not committing to a particular instance, and the programmer may want to say "commit anyway". Here's the example: class Sat a where dict :: a data EqD a = EqD {eq :: a->a->Bool} instance Sat (EqD a) => Eq a where (==) = eq dict instance Sat (EqD Integer) where dict = EqD{eq=(==)} instance Eq a => Sat (EqD a) where dict = EqD{eq=(==)} class Collection c cxt | c -> cxt where empty :: Sat (cxt a) => c a single :: Sat (cxt a) => a -> c a union :: Sat (cxt a) => c a -> c a -> c a member :: Sat (cxt a) => a -> c a -> Bool instance Collection [] EqD where empty = [] single x = [x] union = (++) member = elem It's an updated attempt to model "Restricted Data Types", if you remember my Haskell workshop paper. In the end, though, GHC rejects the program (even with fallow-overlapping-instances and fallow-undecideable-instances), because there's more than one way to construct the Eq instance needed by elem. Yet all the ways are equivalent! So GHC is being a bit over-protective of me, really: I know what I'm doing and I would LIKE it to pick an arbitrary one. Maybe a flag fallow-incoherent-instances would be a useful thing to add?
-
- 19 Dec, 2001 3 commits
- 18 Dec, 2001 8 commits
-
-
sebc authored
THIS CHANGE AFFECTS ALL OBJECT FILES. Please say "make clean" Move the entry code pointer to the start of info tables, according to Plan C in ghc/rts/Storage.h
-
sewardj authored
Fix various bugs in the implementation of subIntC and mulMayOflo.
-
simonmar authored
Nuke -O2-for-C, since it can cause gcc to generate incorrect code, and doesn't seem to help much. Add a comment about this in the 5.02 release notes, saying you can still use -optc-O2 if you really want to. (merged from rev. 1.47.2.3)
-
simonmar authored
merge rev. 1.11.4.1 from branch ghc-5-02-branch (remove -O2-for-C)
-
simonmar authored
merge rev. 1.11.2.2 from ghc-5-02-branch (remove -O2-for-C).
-
simonmar authored
remove unnecessary #include
-
simonmar authored
Add the missing options list to the section "Replacing the program for one or more phases".
-
simonmar authored
Allow opening char & block devices with openFile. Opening a char device gets you a stream, and a block device a file (these are heuristics since we can't really tell without trying to lseek() on the device whether it supports seeking or not, but the defaults are at least safe).
-
- 17 Dec, 2001 6 commits
-
-
sewardj authored
Redo translation of array indexing primops in order to insert 8 <-> 32 bit casts when dealing with Char arrays. Also facilitate future removal of CMem and MO_{Read,Write}OSBI. In the process, notice and fix a large bogon in x86/sparc implementation of signed and unsigned integer widening.
-
simonmar authored
comment wibbles
-
simonmar authored
Generate better code for case-of-literal (i.e. just do the assignment). These crop up now that the simplifier is a bit more careful about duplicating literal strings.
-
simonmar authored
mkLocalNonRec bug fix: we always want to generate a case when the rhs of a binding is an unlifted type. Previously the two cases for an unlifted rhs and a strict binding were handled together which caused some confusion, so now the cases are separate.
-
simonmar authored
slightly clearer fix for previous bogon, and re-indent the function
-
simonpj authored
Fix ifdefery bracketing bug on Win32
-
- 15 Dec, 2001 1 commit
-
-
panne authored
Re-added #ifdef which was lost in last commit
-