Commit d1b912fa authored by Björn Peemöller 's avatar Björn Peemöller
Browse files

Improved AbstractCurry representation of newtypes

parent 00769137
......@@ -77,14 +77,13 @@ trTypeDecl _ = return []
trConsDecl :: ConstrDecl -> GAC CConsDecl
trConsDecl (ConstrDecl _ _ c tys) = CCons
<$> trLocalIdent c <*> return (length tys)
<*> getVisibility c <*> mapM trTypeExpr tys
<$> trLocalIdent c <*> getVisibility c <*> mapM trTypeExpr tys
trConsDecl (ConOpDecl p vs ty1 op ty2) = trConsDecl $
ConstrDecl p vs op [ty1, ty2]
trNewConsDecl :: NewConstrDecl -> GAC CNewConsDecl
trNewConsDecl (NewConstrDecl _ _ nc ty) = CNewCons
<$> trLocalIdent nc <*> getVisibility nc <*> trTypeExpr ty
trNewConsDecl :: NewConstrDecl -> GAC CConsDecl
trNewConsDecl (NewConstrDecl _ _ nc ty) = CCons
<$> trLocalIdent nc <*> getVisibility nc <*> ((:[]) <$> trTypeExpr ty)
trTypeExpr :: TypeExpr -> GAC CTypeExpr
trTypeExpr (ConstructorType q ts) = CTCons <$> trQual q
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment