@@ -191,11 +191,14 @@ instance ToJS (Expr t v) where
191191 Record fs -> makeRecord fs
192192 Binop op e1 e2 -> binop op e1 e2
193193
194− Lambda p e@(L s _) -> liftM (fastFunc . ret) (toJS' body)
194+ Lambda p e@(L s _) -> liftM fastFunc (toJS' body)
195195 where
196196 fastFunc body
197− | length args < 2 || length args > 9 = foldr jsFunc body args
198− | otherwise = "F" ++ show (length args) ++ parens (jsFunc (commaSep args) body)
197+ | length args < 2 || length args > 9 =
198+ foldr (\arg bod -> jsFunc arg (ret bod)) body args
199+ | otherwise =
200+ "F" ++ show (length args) ++ parens (jsFunc (commaSep args) (ret body))
201+
199202 (args, body) = first reverse $ foldr depattern ([], innerBody) (zip patterns [1..])
200203
201204 depattern (pattern,n) (args, body) =