[project @ 2002-12-10 21:25:07 by igloo]
[ghc-hetmet.git] / ghc / compiler / hsSyn / Convert.lhs
index a2b41a9..9785a5f 100644 (file)
@@ -14,9 +14,9 @@ import Language.Haskell.THSyntax as Meta
 
 import HsSyn as Hs
        (       HsExpr(..), HsLit(..), ArithSeqInfo(..), 
-               HsStmtContext(..), 
+               HsStmtContext(..), TyClDecl(..),
                Match(..), GRHSs(..), GRHS(..), HsPred(..),
-               HsDecl(..), InstDecl(..), ConDecl(..),
+               HsDecl(..), TyClDecl(..), InstDecl(..), ConDecl(..),
                Stmt(..), HsBinds(..), MonoBinds(..), Sig(..),
                Pat(..), HsConDetails(..), HsOverLit, BangType(..),
                placeHolderType, HsType(..), HsTupCon(..),
@@ -123,7 +123,8 @@ cvt (Do ss)   = HsDo DoExpr (cvtstmts ss) [] void loc0
 cvt (Comp ss)     = HsDo ListComp (cvtstmts ss) [] void loc0
 cvt (ArithSeq dd) = ArithSeqIn (cvtdd dd)
 cvt (ListExp xs)  = ExplicitList void (map cvt xs)
-cvt (Infix (Just x) s (Just y)) = OpApp (cvt x) (HsVar(vName s)) undefined (cvt y)
+cvt (Infix (Just x) s (Just y))
+    = HsPar (OpApp (cvt x) (HsVar(vName s)) undefined (cvt y))
 cvt (Infix Nothing  s (Just y)) = SectionR (HsVar(vName s)) (cvt y)
 cvt (Infix (Just x) s Nothing ) = SectionL (cvt x) (HsVar(vName s))
 cvt (Infix Nothing  s Nothing ) = HsVar(vName s) -- Can I indicate this is an infix thing?
@@ -159,8 +160,8 @@ cvtd x = panic "Illegal kind of declaration in where clause"
 
 
 cvtclause :: Meta.Clause (Meta.Pat) (Meta.Exp) (Meta.Dec) -> Hs.Match RdrName
-cvtclause (ps,body,wheres) = Match (map cvtp ps) Nothing 
-                             (GRHSs (cvtguard body) (cvtdecs wheres) void)
+cvtclause (Clause ps body wheres)
+    = Match (map cvtp ps) Nothing (GRHSs (cvtguard body) (cvtdecs wheres) void)
 
 
 
@@ -181,8 +182,8 @@ cvtstmts (ParSt dss : ss)  = ParStmt(map cvtstmts dss)      : cvtstmts ss
 
 
 cvtm :: Meta.Mat -> Hs.Match RdrName
-cvtm (p,body,wheres) = Match [cvtp p] Nothing 
-                             (GRHSs (cvtguard body) (cvtdecs wheres) void)
+cvtm (Mat p body wheres)
+    = Match [cvtp p] Nothing (GRHSs (cvtguard body) (cvtdecs wheres) void)
                              
 cvtguard :: Meta.Rhs -> [GRHS RdrName]
 cvtguard (Guarded pairs) = map cvtpair pairs