@@ -191,15 +191,15 @@ diff localizer context leftType rightType =
191 (Type.App (Type.Type leftName) leftArgs, Type.App (Type.Type rightName) rightArgs) ->
191 (Type.App (Type.Type leftName) leftArgs, Type.App (Type.Type rightName) rightArgs) ->
192 if leftName /= rightName || length leftArgs /= length rightArgs then
192 if leftName /= rightName || length leftArgs /= length rightArgs then
193 difference
193 difference
194− (docApp localizer context leftName (map (docType localizer App) leftArgs))
194+ (docApp localizer context leftName leftArgs)
195− (docApp localizer context rightName (map (docType localizer App) rightArgs))
195+ (docApp localizer context rightName rightArgs)
199 subContext =
199 subContext =
200 if Var.isTuple leftName then None else App
200 if Var.isTuple leftName then None else App
202− docApp localizer context leftName
202+ docAppHelp localizer context leftName
203 <$> sequenceA (zipWith (go subContext) leftArgs rightArgs)
203 <$> sequenceA (zipWith (go subContext) leftArgs rightArgs)
205 (Type.App _ _, Type.App _ _) ->
205 (Type.App _ _, Type.App _ _) ->
@@ -216,7 +216,7 @@ diff localizer context leftType rightType =
216 diffRecord localizer leftFields leftExt rightFields rightExt
216 diffRecord localizer leftFields leftExt rightFields rightExt
218 (Type.Aliased leftName leftArgs _, Type.Aliased rightName rightArgs _) | leftName == rightName ->
218 (Type.Aliased leftName leftArgs _, Type.Aliased rightName rightArgs _) | leftName == rightName ->
219− docApp localizer context leftName
219+ docAppHelp localizer context leftName
220 <$> sequenceA (zipWith (go App) (map snd leftArgs) (map snd rightArgs))
220 <$> sequenceA (zipWith (go App) (map snd leftArgs) (map snd rightArgs))
222 (Type.Aliased _ args real, _) ->
222 (Type.Aliased _ args real, _) ->
@@ -387,7 +387,7 @@ docType localizer context tipe =
387 varToDoc localizer name
387 varToDoc localizer name
389 Type.App (Type.Type name) args ->
389 Type.App (Type.Type name) args ->
390− docApp localizer context name (map (docType localizer App) args)
390+ docApp localizer context name args
392 Type.App _ _ ->
392 Type.App _ _ ->
393 error "type applications should start with a type atom"
393 error "type applications should start with a type atom"
@@ -402,7 +402,7 @@ docType localizer context tipe =
402 (fmap text ext)
402 (fmap text ext)
404 Type.Aliased name args _ ->
404 Type.Aliased name args _ ->
405− docApp localizer context name (map (docType localizer App . snd) args)
405+ docApp localizer context name (map snd args)
@@ -426,8 +426,17 @@ docLambda context docs =
429−docApp :: Localizer -> Context -> Var.Canonical -> [Doc] -> Doc
429+docApp :: Localizer -> Context -> Var.Canonical -> [Type.Canonical] -> Doc
430docApp localizer context name args =
430docApp localizer context name args =
433+ if Var.isTuple name then None else App
435+ docAppHelp localizer context name (map (docType localizer argContext) args)
438+docAppHelp :: Localizer -> Context -> Var.Canonical -> [Doc] -> Doc
439+docAppHelp localizer context name args =
431 if Var.isTuple name then
440 if Var.isTuple name then
433 [ cat (zipWith (<+>) (lparen : repeat comma) args)
442 [ cat (zipWith (<+>) (lparen : repeat comma) args)