From aa7c513c188332b2ccec74b127e58c61874cde55 Mon Sep 17 00:00:00 2001 From: Paul Chiusano Date: Mon, 9 Mar 2015 14:51:05 -0400 Subject: [PATCH] formatting --- node/src/Unison/Type/Context.hs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/node/src/Unison/Type/Context.hs b/node/src/Unison/Type/Context.hs index 09a54be88..3bba2442e 100644 --- a/node/src/Unison/Type/Context.hs +++ b/node/src/Unison/Type/Context.hs @@ -343,16 +343,16 @@ synthesize ctx e = scope ("infer: " ++ show e) $ go e where let e = fresh ctx ctxTl = context [E.Marker e, E.Existential e] step term ctx = check ctx term (T.Existential e) - in Foldable.foldrM step (ctx `append` ctxTl) v >>= \ctx' -> - pure $ - let - (ctx1, ctx2) = breakAt (E.Marker e) ctx' - -- unsolved existentials get generalized to universals - vt = apply ctx2 (T.Unit T.Vector `T.App` T.Existential e) - existentials' = unsolved ctx2 - vt2 = foldr gen vt existentials' - gen e vt = T.forall1 $ \v -> subst vt e v - in (vt2, ctx1) + in Foldable.foldrM step (ctx `append` ctxTl) v >>= + \ctx' -> pure $ + let + (ctx1, ctx2) = breakAt (E.Marker e) ctx' + -- unsolved existentials get generalized to universals + vt = apply ctx2 (T.Unit T.Vector `T.App` T.Existential e) + existentials' = unsolved ctx2 + vt2 = foldr gen vt existentials' + gen e vt = T.forall1 $ \v -> subst vt e v + in (vt2, ctx1) go fn@(Term.Lam _) = -- ->I=> (Full Damas Milner rule) let (arg, i, o) = fresh3 ctx ctxTl = context [E.Marker i, E.Existential i, E.Existential o,