summaryrefslogtreecommitdiff
path: root/ghc/compiler/parser
diff options
context:
space:
mode:
authorsimonpj <unknown>1999-07-27 07:31:24 +0000
committersimonpj <unknown>1999-07-27 07:31:24 +0000
commit3df40b7b78044206bbcffe3e2c0a57d901baf5e8 (patch)
tree075f36d30767f8e191991fc68cf514c9c45d05e8 /ghc/compiler/parser
parent6ef0bc6c1c112a73615c5bddeb8c0fbadd557ff7 (diff)
downloadhaskell-3df40b7b78044206bbcffe3e2c0a57d901baf5e8.tar.gz
[project @ 1999-07-27 07:31:16 by simonpj]
Do a more correct job of explicit for-alls in types
Diffstat (limited to 'ghc/compiler/parser')
-rw-r--r--ghc/compiler/parser/Parser.y13
1 files changed, 6 insertions, 7 deletions
diff --git a/ghc/compiler/parser/Parser.y b/ghc/compiler/parser/Parser.y
index 606181bcf6..066bc1c150 100644
--- a/ghc/compiler/parser/Parser.y
+++ b/ghc/compiler/parser/Parser.y
@@ -1,6 +1,6 @@
{-
-----------------------------------------------------------------------------
-$Id: Parser.y,v 1.11 1999/07/26 16:06:28 simonpj Exp $
+$Id: Parser.y,v 1.12 1999/07/27 07:31:18 simonpj Exp $
Haskell grammar.
@@ -403,9 +403,7 @@ signdecl :: { RdrBinding }
[ RdrSig (Sig n $4 $2) | n <- $1 ] }
sigtype :: { RdrNameHsType }
- : ctype { case $1 of
- HsForAllTy _ _ _ -> $1
- other -> HsForAllTy Nothing [] $1 }
+ : ctype { mkHsForAllTy Nothing [] $1 }
{-
ATTENTION: Dirty Hackery Ahead! If the second alternative of vars is var
@@ -502,9 +500,10 @@ inst_type :: { RdrNameHsType }
ctype :: { RdrNameHsType }
: 'forall' tyvars '.' context type
- { HsForAllTy (Just $2) $4 $5 }
- | 'forall' tyvars '.' type { HsForAllTy (Just $2) [] $4 }
- | context type { HsForAllTy Nothing $1 $2 }
+ { mkHsForAllTy (Just $2) $4 $5 }
+ | 'forall' tyvars '.' type { mkHsForAllTy (Just $2) [] $4 }
+ | context type { mkHsForAllTy Nothing $1 $2 }
+ -- A type of form (context => type) is an *implicit* HsForAllTy
| type { $1 }
types0 :: { [RdrNameHsType] }