| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
| |
Use nameIsLocalOrFrom instead of open code
|
|
|
|
|
|
|
| |
Suppress "No explicit method or default decl given for m"
if the method name starts with an underscore
This in response to a suggestion by George Russel
|
|
|
|
| |
Import trimming
|
|
|
|
| |
Export main from Main (only matters for ghci)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
--------------------------
Fix export-calculation bug
--------------------------
Ross points out that in
module M where
import List as M
sort = "foo"
there is no conflict in the export list. GHC used to treat this
like
module M( module M ) where ...
which is wrong, wrong, wrong.
Now fixed. Test in modules/mod200.hs
Some other small tidying up (notably in GRE.gre_parent).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Improve missing-module error messages. eg.
hello2.hs:1:
Failed to load interface for `Foo':
Could not find interface file for `Foo'
(use -v to see a list of the files searched for)
and if we add the -v flag:
hello2.hs:1:
Failed to load interface for `Foo':
Could not find interface file for `Foo'
locations searched:
Foo.hi
Foo.hi-boot-6
Foo.hi-boot
/home/simonmar/builds/i386-unknown-linux/libraries/haskell-src/Foo.hi
/home/simonmar/builds/i386-unknown-linux/libraries/haskell98/Foo.hi
/home/simonmar/builds/i386-unknown-linux/libraries/readline/Foo.hi
/home/simonmar/builds/i386-unknown-linux/libraries/unix/Foo.hi
/home/simonmar/builds/i386-unknown-linux/libraries/network/Foo.hi
/home/simonmar/builds/i386-unknown-linux/libraries/base/Foo.hi
|
|
|
|
| |
Spelling
|
|
|
|
| |
Original names can occur in binding positions in External Core
|
|
|
|
|
|
| |
Check for qualified names in binding positions in the parser instead
of the rename. In External Core it's OK to have qualified names in
these places.
|
|
|
|
| |
Wibble
|
|
|
|
| |
Report TH errors better in stage 1
|
|
|
|
| |
Report over-size tuples gracefully
|
|
|
|
| |
Less rn-tracing
|
|
|
|
| |
Wibbles
|
|
|
|
| |
More wibbles to do with export lists
|
|
|
|
| |
Dont bail out quite so fast
|
|
|
|
|
|
|
|
|
|
|
| |
------------------
Fix module exports
------------------
GHC was doing the wrong thing when it came to detecting conflicts
on exports from 'module M' items. This commit fixes it.
There's a test in rename/should_fail/rnfail040
|
|
|
|
| |
Better reporting of unused bindings
|
|
|
|
| |
Wibble when renaming splices
|
|
|
|
| |
Oops... add missing free-vars
|
|
|
|
| |
Track locations for binders better (fixes several rn and mod failures)
|
|
|
|
| |
Import wibbles
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
------------------------
More dependency fiddling
------------------------
WARNING: Interface file format has changed (again)
You need to 'make clean' in all library code
* Orphan modules are now kept separately
Home-package dependencies now contain only home-package dependencies!
See HscTypes.Dependencies
* Linker now uses the dependencies to do dynamic linking
Result: Template Haskell should work even without --make (not yet tested)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
------------------------------------------
1. New try and module and package dependencies
2. OrigNameCache always contains final info
------------------------------------------
These things nearly complete sorting out the incremental
linking problem that started us off!
1. This commit separates two kinds of information:
(a) HscTypes.Dependencies:
What (i) home-package modules, and
(ii) other packages
this module depends on, transitively.
That is, to link the module, it should be enough
to link the dependent modules and packages (plus
any C stubs etc).
Along with this info we record whether the dependent module
is (a) a boot interface or (b) an orphan module. So in
fact (i) can contain non-home-package modules, namely the
orphan ones in other packages (sigh).
(b) HscTypes.Usage:
What version of imported things were used to
actually compile the module. This info is used for
recompilation control only.
2. The Finder now returns a correct Module (incl package indicator)
first time, so we can install the absolutely final Name in the
OrigNameCache when we first come across an occurrence of that name,
even if it's only an occurrence in an unfolding in some other interface
file. This is much tidier.
As a result Module.lhs is much cleaner
No DunnoYet
No mkVanillaModule
ALl very joyful stuff.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
------------------------------------------------
Allow implicit-parameter bindings anywhere that
a normal binding group is allowed.
------------------------------------------------
That is, you can have implicit parameters
* in a let binding
* in a where clause (but then you can't have non-implicit
ones as well)
* in a let group in a list comprehension or monad do-notation
The implementation is simple: just add IPBinds to the allowable forms of HsBinds,
and remove the HsWith expression form altogether. (It now comes in via the
HsLet form.)
It'a a nice generalisation really. Needs a bit of documentation, which I'll do next.
|
|
|
|
| |
Add a trace
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Finder overhaul.
The finder had got pretty complicated; this commit is mainly a
cleanup, with one new feature:
- the finder has a cache (again). The cache may be flushed by
calling flushFinderCache, which actually only flushes home modules
from the cache, because package modules are assumed not to move.
This change is apropos of some other changes which will result in
the finder being called more often, so we think a cache is going
to be worthwhile.
Also a couple of bugs were fixed:
- the field ml_hi_file in a ModLocation is now *always* the name
of the .hi file. If you need a .hi-boot file, you have to make
it up by changing the suffix of ml_hi_file. (DriverMkDepend and
RnHiFiles do this). This was the cause of a bug, but I can't
remember the details.
- The -odir flag now works in a more reasonable way: hierarchical
modules get put in subdirectories of the -odir directory. eg.
if your module is A.B.C, and -odir D is specified, then the object
will be D/A/B/C.o; previously it would have been D/C.o.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
------------------------------------------
Implement reification for Template Haskell
------------------------------------------
This is entirely un-tested, but I don't think it'll break non-TH stuff.
Implements
reifyDecl T :: Dec -- Data type T
reifyDecl C :: Dec -- Class C
reifyType f :: Typ -- Function f
I hope.
|
|
|
|
| |
Fix to mdo, plus SrcLocs on splices and brackets
|
|
|
|
| |
Fix and simplify renamer warnings about export lists
|
|
|
|
| |
Dont complain about unused things bound by deriving clause
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
-----------------------------------
Lots more Template Haskell stuff
-----------------------------------
At last! Top-level declaration splices work!
Syntax is
$(f x)
not "splice (f x)" as in the paper.
Lots jiggling around, particularly with the top-level plumbining.
Note the new data type HsDecls.HsGroup.
|
|
|
|
| |
Wibble in loading of boot interfaces
|
|
|
|
| |
Minor wibble
|
|
|
|
| |
make sure we get the name right when we call doStmtListErr
|
|
|
|
| |
Wibbles to improve error reporting
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
--------------------------------
Implement recursive do-notation
--------------------------------
This commit adds recursive do-notation, which Hugs has had for some time.
mdo { x <- foo y ;
y <- baz x ;
return (y,x) }
turns into
do { (x,y) <- mfix (\~(x,y) -> do { x <- foo y;
y <- baz x }) ;
return (y,x) }
This is all based on work by Levent Erkok and John Lanuchbury.
The really tricky bit is in the renamer (RnExpr.rnMDoStmts) where
we break things up into minimal segments. The rest is easy, including
the type checker.
Levent laid the groundwork, and Simon finished it off. Needless to say,
I couldn't resist tidying up other stuff, so there's no guaranteed I
have not broken something.
|
|
|
|
| |
Bale out a little earlier on renamer errors
|
|
|
|
| |
Comments
|
|
|
|
| |
fix logic in prev. commit
|
|
|
|
| |
Better reporting of unused imports
|
|
|
|
| |
Remember to import the things used by foreign export
|
|
|
|
| |
Dont warn of missing signatures in interface mode
|
|
|
|
| |
Fix assertion handling
|
|
|
|
| |
Remove vestiges of GHC.Prim.assert
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fix up exception handling when reading an interface file, and make it
compile with 4.08.x again.
GhcExceptions weren't being caught by readIface, so an error when
reading an interface could be unintentionally fatal (errors should be
soft when reading the old interface file for the current module).
Also, the Interrupted exception should not be caught by readIface,
because we want ^C to behave as normal when reading interface files
(currently it causes an interface-file read error rather than
interrupting the whole compiler).
Some exception-related compatibility functions have been moved from
Util to Panic.
|
|
|
|
| |
Unbork head...ruleLhsTvs does not crash now
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
--------------------------------
Quantify over unbound type vars in RULE lhs's
--------------------------------
-- We need to gather the type variables mentioned on the LHS so we can
-- quantify over them. Example:
-- data T a = C
--
-- foo :: T a -> Int
-- foo C = 1
--
-- {-# RULES "myrule" foo C = 1 #-}
--
-- After type checking the LHS becomes (foo a (C a))
-- and we do not want to zap the unbound tyvar 'a' to (), because
-- that limits the applicability of the rule. Instead, we
-- want to quantify over it!
This commit fixes the problem, discovered by Manuel. It uses a
free-variable finder for RULE lhs's (TcRule.ruleLhsTvs) which relies
on the fact that the LHS of a rule can only take ver forms
(c.f RnSource.validRuleLhs).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
--------------------------------------
Make Template Haskell into the HEAD
--------------------------------------
This massive commit transfers to the HEAD all the stuff that
Simon and Tim have been doing on Template Haskell. The
meta-haskell-branch is no more!
WARNING: make sure that you
* Update your links if you are using link trees.
Some modules have been added, some have gone away.
* Do 'make clean' in all library trees.
The interface file format has changed, and you can
get strange panics (sadly) if GHC tries to read old interface files:
e.g. ghc-5.05: panic! (the `impossible' happened, GHC version 5.05):
Binary.get(TyClDecl): ForeignType
* You need to recompile the rts too; Linker.c has changed
However the libraries are almost unaltered; just a tiny change in
Base, and to the exports in Prelude.
NOTE: so far as TH itself is concerned, expression splices work
fine, but declaration splices are not complete.
---------------
The main change
---------------
The main structural change: renaming and typechecking have to be
interleaved, because we can't rename stuff after a declaration splice
until after we've typechecked the stuff before (and the splice
itself).
* Combine the renamer and typecheker monads into one
(TcRnMonad, TcRnTypes)
These two replace TcMonad and RnMonad
* Give them a single 'driver' (TcRnDriver). This driver
replaces TcModule.lhs and Rename.lhs
* The haskell-src library package has a module
Language/Haskell/THSyntax
which defines the Haskell data type seen by the TH programmer.
* New modules:
hsSyn/Convert.hs converts THSyntax -> HsSyn
deSugar/DsMeta.hs converts HsSyn -> THSyntax
* New module typecheck/TcSplice type-checks Template Haskell splices.
-------------
Linking stuff
-------------
* ByteCodeLink has been split into
ByteCodeLink (which links)
ByteCodeAsm (which assembles)
* New module ghci/ObjLink is the object-code linker.
* compMan/CmLink is removed entirely (was out of place)
Ditto CmTypes (which was tiny)
* Linker.c initialises the linker when it is first used (no need to call
initLinker any more). Template Haskell makes it harder to know when
and whether to initialise the linker.
-------------------------------------
Gathering the LIE in the type checker
-------------------------------------
* Instead of explicitly gathering constraints in the LIE
tcExpr :: RenamedExpr -> TcM (TypecheckedExpr, LIE)
we now dump the constraints into a mutable varabiable carried
by the monad, so we get
tcExpr :: RenamedExpr -> TcM TypecheckedExpr
Much less clutter in the code, and more efficient too.
(Originally suggested by Mark Shields.)
-----------------
Remove "SysNames"
-----------------
Because the renamer and the type checker were entirely separate,
we had to carry some rather tiresome implicit binders (or "SysNames")
along inside some of the HsDecl data structures. They were both
tiresome and fragile.
Now that the typechecker and renamer are more intimately coupled,
we can eliminate SysNames (well, mostly... default methods still
carry something similar).
-------------
Clean up HsPat
-------------
One big clean up is this: instead of having two HsPat types (InPat and
OutPat), they are now combined into one. This is more consistent with
the way that HsExpr etc is handled; there are some 'Out' constructors
for the type checker output.
So:
HsPat.InPat --> HsPat.Pat
HsPat.OutPat --> HsPat.Pat
No 'pat' type parameter in HsExpr, HsBinds, etc
Constructor patterns are nicer now: they use
HsPat.HsConDetails
for the three cases of constructor patterns:
prefix, infix, and record-bindings
The *same* data type HsConDetails is used in the type
declaration of the data type (HsDecls.TyData)
Lots of associated clean-up operations here and there. Less code.
Everything is wonderful.
|
|
|
|
| |
Correct comments
|