summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManuel M T Chakravarty <chak@cse.unsw.edu.au>2006-09-18 22:53:32 +0000
committerManuel M T Chakravarty <chak@cse.unsw.edu.au>2006-09-18 22:53:32 +0000
commit3734da50be1d8e1ddad5b5fe5c46fcfb3192d1da (patch)
treebf4ce4818f61487f8e240dc5147b8532d5d842b4
parent3e0b6b2542d8464bfba365b97a6e4b95c3885f10 (diff)
downloadhaskell-3734da50be1d8e1ddad5b5fe5c46fcfb3192d1da.tar.gz
Remove checkTopTypeD
Tue Aug 15 17:02:53 EDT 2006 Manuel M T Chakravarty <chak@cse.unsw.edu.au> * Remove checkTopTypeD
-rw-r--r--compiler/parser/Parser.y.pp3
-rw-r--r--compiler/parser/RdrHsSyn.lhs17
2 files changed, 1 insertions, 19 deletions
diff --git a/compiler/parser/Parser.y.pp b/compiler/parser/Parser.y.pp
index 4548221955..dc86c0040e 100644
--- a/compiler/parser/Parser.y.pp
+++ b/compiler/parser/Parser.y.pp
@@ -444,8 +444,7 @@ topdecls :: { OrdList (LHsDecl RdrName) }
topdecl :: { OrdList (LHsDecl RdrName) }
: cl_decl { unitOL (L1 (TyClD (unLoc $1))) }
- | ty_decl {% checkTopTypeD $1 >>=
- return.unitOL.L1 }
+ | ty_decl { unitOL (L1 (TyClD (unLoc $1))) }
| 'instance' inst_type where
{ let (binds, sigs, ats) = cvBindsAndSigs (unLoc $3)
in unitOL (L (comb3 $1 $2 $3)
diff --git a/compiler/parser/RdrHsSyn.lhs b/compiler/parser/RdrHsSyn.lhs
index a8449ae22d..b66c759147 100644
--- a/compiler/parser/RdrHsSyn.lhs
+++ b/compiler/parser/RdrHsSyn.lhs
@@ -39,7 +39,6 @@ module RdrHsSyn (
checkTyVars, -- [LHsType RdrName] -> Bool -> P ()
checkSynHdr, -- LHsType RdrName -> P (Located RdrName, [LHsTyVarBndr RdrName], Maybe [LHsType RdrName])
checkKindSigs, -- [LTyClDecl RdrName] -> P ()
- checkTopTypeD, -- LTyClDecl RdrName -> P (HsDecl RdrName)
checkInstType, -- HsType -> P HsType
checkPattern, -- HsExp -> P HsPat
checkPatterns, -- SrcLoc -> [HsExp] -> P [HsPat]
@@ -518,22 +517,6 @@ checkKindSigs = mapM_ check
| otherwise =
parseError l "Type declaration in a class must be a kind signature or synonym default"
--- Wrap a toplevel type or data declaration into 'TyClD' and ensure for
--- data declarations that all type parameters are variables only (which is in
--- contrast to type functions and associated type declarations).
---
-checkTopTypeD :: LTyClDecl RdrName -> P (HsDecl RdrName)
-checkTopTypeD (L _ d@TyData {tcdTyPats = Just typats}) =
- do
- -- `tcdTyPats' will only be of the form `Just typats' if `typats' contains
- -- a non-variable pattern. We call `checkTyPats' instead of raising an
- -- error straight away, as `checkTyPats' raises the error at the location
- -- of that non-variable pattern.
- --
- checkTyVars typats False
- panic "checkTopTypeD: check on previous line should fail w/ a parse error"
-checkTopTypeD (L _ d) = return $ TyClD d
-
checkContext :: LHsType RdrName -> P (LHsContext RdrName)
checkContext (L l t)
= check t