From: Ross Paterson Date: Sun, 22 Aug 2010 09:00:22 +0000 (+0000) Subject: fix extraction of command stack of arguments of arrow "forms" (fixes #4236) X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=6ee15d3170297b3f7e4f5aaeba90d7fd0e19367c;p=ghc-hetmet.git fix extraction of command stack of arguments of arrow "forms" (fixes #4236) The command stack was being extracted (by unscramble) with the outermost type first, contrary to the comment on the function. --- diff --git a/compiler/typecheck/TcArrows.lhs b/compiler/typecheck/TcArrows.lhs index 9fede38..231901c 100644 --- a/compiler/typecheck/TcArrows.lhs +++ b/compiler/typecheck/TcArrows.lhs @@ -294,14 +294,13 @@ tc_cmd env cmd@(HsArrForm expr fixity cmd_args) (cmd_stk, res_ty) unscramble :: TcType -> (TcType, [TcType]) -- unscramble ((w,s1) .. sn) = (w, [s1..sn]) - unscramble ty + unscramble ty = unscramble' ty [] + + unscramble' ty ss = case tcSplitTyConApp_maybe ty of Just (tc, [t,s]) | tc == pairTyCon - -> let - (w,ss) = unscramble t - in (w, s:ss) - - _ -> (ty, []) + -> unscramble' t (s:ss) + _ -> (ty, ss) ----------------------------------------------------------------- -- Base case for illegal commands