[project @ 1996-01-08 20:28:12 by partain]
[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         methodTypeLacksTyVarErr,
57 --      missingClassOpErr, UNUSED
58         naughtyCCallContextErr,
59         nonBoxedPrimCCallErr,
60         notAsPolyAsSigErr,
61 --      patMatchWithPrimErr, UNUSED
62         preludeInstanceErr,
63 --      purelyLocalErr, UNUSED
64         reduceErr,
65         sigContextsErr,
66         specGroundnessErr,
67         specCtxtGroundnessErr,
68         specDataNoSpecErr,
69         specDataUnboxedErr,
70         specInstUnspecInstNotFoundErr,
71         topLevelUnboxedDeclErr,
72         tyConArityErr,
73         unifyErr,
74         varyingArgsErr,
75 #ifdef DPH
76         podCompLhsError,
77         pprPodizedWarning,
78         PodWarning,
79 #endif {- Data Parallel Haskell -}
80
81         UnifyErrContext(..),
82         UnifyErrInfo(..),
83
84         -- and to make the interface self-sufficient
85         Bag, Class, ClassOp, MonoBinds, ProtoNameMonoBinds(..), Sig,
86         RenamedSig(..), Expr, RenamedExpr(..), GRHS, RenamedGRHS(..),
87         GRHSsAndBinds, RenamedGRHSsAndBinds(..), Match, IE,
88         RenamedMatch(..), InPat, ProtoNamePat(..), RenamedPat(..),
89         GenPragmas, Id, Inst, Name, PprStyle, Pretty(..), PrettyRep,
90         ProtoName, SrcLoc, TyCon, TyVar, TyVarTemplate, UniType,
91         TauType(..), Maybe, SignatureInfo, TypecheckedPat,
92         TypecheckedExpr(..)
93     ) where
94
95 -- I don't know how much of this is needed... (WDP 94/06)
96
97 import ErrsRn
98 import ErrsTc
99 import ErrUtils
100
101 import AbsSyn           -- we print a bunch of stuff in here
102 import UniType          ( UniType(..) )         -- Concrete, to make some errors
103                                                 -- more informative.
104 import AbsUniType       ( TyVar, TyVarTemplate, TyCon,
105                           TauType(..), Class, ClassOp
106                           IF_ATTACK_PRAGMAS(COMMA pprUniType)
107                         )
108 import Bag              ( Bag, bagToList )
109 import GenSpecEtc       ( SignatureInfo(..) )
110 import HsMatches        ( pprMatches, pprMatch, pprGRHS )
111 import Id               ( getIdUniType, Id, isSysLocalId )
112 import Inst             ( getInstOrigin, getDictClassAndType, Inst )
113 import Maybes           ( Maybe(..) )
114 import Name             ( cmpName )
115 import Outputable
116 import Pretty           -- to pretty-print error messages
117 #ifdef DPH
118 import PodizeMonad      ( PodWarning(..) )
119 #endif {- Data Parallel Haskell -}
120 import SrcLoc           ( mkUnknownSrcLoc, SrcLoc )
121 import Util
122 \end{code}