[project @ 1996-02-06 14:32:22 by dnt]
[ghc-hetmet.git] / ghc / compiler / main / Errors.lhs
1 %
2 % (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
3 %
4 \section[Errors]{Error reporting}
5
6 This module now merely re-exports the work of @ErrsRn@ and @ErrsTc@;
7 this is the public interface. (WDP 94/06)
8
9 \begin{code}
10 #include "HsVersions.h"
11
12 module Errors (
13         Error(..),
14         pprBagOfErrors,
15
16         -- renamer errors:
17         badClassOpErr,
18         badExportNameErr,
19         badImportNameErr,
20         derivingInIfaceErr,
21         derivingNonStdClassErr,
22         dupNamesErr,
23         dupPreludeNameErr,
24         dupSigDeclErr,
25         duplicateImportsInInterfaceErr,
26         inlineInRecursiveBindsErr,
27         missingSigErr,
28 --      mismatchedPragmasErr, UNUSED
29         shadowedNameErr,
30         unknownNameErr,
31         unknownSigDeclErr,
32         weirdImportExportConstraintErr,
33
34         -- typechecker errors:
35         ambigErr,
36         badMatchErr,
37         badSpecialisationErr,
38         confusedNameErr,
39         classCycleErr,
40         typeCycleErr,
41         dataConArityErr,
42         defaultErr,
43         derivingEnumErr,
44         derivingIxErr,
45         derivingWhenInstanceExistsErr,
46 --      derivingNoSuperClassInstanceErr, UNUSED
47         dupInstErr,
48 --      extraMethodsErr, UNUSED
49         genCantGenErr,
50 --      genPrimTyVarErr, UNUSED
51         noInstanceErr,
52 --      instOpErr, UNUSED
53         instTypeErr,
54 --      methodInstErr, UNUSED
55         methodBindErr,
56         lurkingRank2Err,
57         methodTypeLacksTyVarErr,
58 --      missingClassOpErr, UNUSED
59         naughtyCCallContextErr,
60         nonBoxedPrimCCallErr,
61         notAsPolyAsSigErr,
62 --      patMatchWithPrimErr, UNUSED
63         preludeInstanceErr,
64 --      purelyLocalErr, UNUSED
65         reduceErr,
66         sigContextsErr,
67         specGroundnessErr,
68         specCtxtGroundnessErr,
69         specDataNoSpecErr,
70         specDataUnboxedErr,
71         specInstUnspecInstNotFoundErr,
72         topLevelUnboxedDeclErr,
73         tyConArityErr,
74         underAppliedTyErr,
75         unifyErr,
76         varyingArgsErr,
77 #ifdef DPH
78         podCompLhsError,
79         pprPodizedWarning,
80         PodWarning,
81 #endif {- Data Parallel Haskell -}
82
83         UnifyErrContext(..),
84         UnifyErrInfo(..),
85
86         -- and to make the interface self-sufficient
87         Bag, Class, ClassOp, MonoBinds, ProtoNameMonoBinds(..), Sig,
88         RenamedSig(..), Expr, RenamedExpr(..), GRHS, RenamedGRHS(..),
89         GRHSsAndBinds, RenamedGRHSsAndBinds(..), Match, IE,
90         RenamedMatch(..), InPat, ProtoNamePat(..), RenamedPat(..),
91         GenPragmas, Id, Inst, Name, PprStyle, Pretty(..), PrettyRep,
92         ProtoName, SrcLoc, TyCon, TyVar, TyVarTemplate, UniType,
93         TauType(..), Maybe, SignatureInfo, TypecheckedPat,
94         TypecheckedExpr(..)
95     ) where
96
97 -- I don't know how much of this is needed... (WDP 94/06)
98
99 import ErrsRn
100 import ErrsTc
101 import ErrUtils
102
103 import AbsSyn           -- we print a bunch of stuff in here
104 import UniType          ( UniType(..) )         -- Concrete, to make some errors
105                                                 -- more informative.
106 import AbsUniType       ( TyVar, TyVarTemplate, TyCon,
107                           TauType(..), Class, ClassOp
108                           IF_ATTACK_PRAGMAS(COMMA pprUniType)
109                         )
110 import Bag              ( Bag, bagToList )
111 import GenSpecEtc       ( SignatureInfo(..) )
112 import HsMatches        ( pprMatches, pprMatch, pprGRHS )
113 import Id               ( getIdUniType, Id, isSysLocalId )
114 import Inst             ( getInstOrigin, getDictClassAndType, Inst )
115 import Maybes           ( Maybe(..) )
116 import Name             ( cmpName )
117 import Outputable
118 import Pretty           -- to pretty-print error messages
119 #ifdef DPH
120 import PodizeMonad      ( PodWarning(..) )
121 #endif {- Data Parallel Haskell -}
122 import SrcLoc           ( mkUnknownSrcLoc, SrcLoc )
123 import Util
124 \end{code}