@@ -147,7 +147,7 @@ instance ToJS a => ToJS [a] where
147 toJS xs = concat `liftM` mapM toJS xs
147 toJS xs = concat `liftM` mapM toJS xs
149toJS' :: LExpr t v -> Unique String
149toJS' :: LExpr t v -> Unique String
150−toJS' (L txt span expr) =
150+toJS' (L span expr) =
151 case expr of
151 case expr of
152 MultiIf ps -> multiIfToJS span ps
152 MultiIf ps -> multiIfToJS span ps
153 Case e cases -> caseToJS span e cases
153 Case e cases -> caseToJS span e cases
@@ -211,7 +211,7 @@ instance ToJS (Expr t v) where
212 (patterns, innerBody) = collect [p] e
212 (patterns, innerBody) = collect [p] e
214− collect patterns lexpr@(L a b expr) =
214+ collect patterns lexpr@(L _ expr) =
215 case expr of
215 case expr of
216 Lambda p e -> collect (p:patterns) e
216 Lambda p e -> collect (p:patterns) e
217 _ -> (patterns, lexpr)
217 _ -> (patterns, lexpr)
@@ -245,7 +245,7 @@ jsApp e1 e2 =
245 (func, args) = go [e2] e1
245 (func, args) = go [e2] e1
246 go args e =
246 go args e =
247 case e of
247 case e of
248− (L _ _ (App e1 e2)) -> go (e2 : args) e1
248+ (L _ (App e1 e2)) -> go (e2 : args) e1
249 _ -> (e, args)
249 _ -> (e, args)
251formatMarkdown = concatMap f
251formatMarkdown = concatMap f
@@ -256,7 +256,7 @@ formatMarkdown = concatMap f
257multiIfToJS span ps =
257multiIfToJS span ps =
258 case last ps of
258 case last ps of
259− (L _ _ (Var "otherwise"), e) -> toJS' e >>= \b -> format b (init ps)
259+ (L _ (Var "otherwise"), e) -> toJS' e >>= \b -> format b (init ps)
260 _ -> format ("_E.If" ++ parens (quoted (show span))) ps
260 _ -> format ("_E.If" ++ parens (quoted (show span))) ps
262 format base ps =
262 format base ps =
@@ -273,9 +273,9 @@ caseToJS span e ps = do
273 match <- caseToMatch ps
273 match <- caseToMatch ps
274 e' <- toJS' e
274 e' <- toJS' e
275 let (match',stmt) = case (match,e) of
275 let (match',stmt) = case (match,e) of
276− (Match name _ _, L _ _ (Var x)) -> (matchSubst [(name,deprime x)] match, "")
276+ (Match name _ _, L _ (Var x)) -> (matchSubst [(name,deprime x)] match, "")
277− (Match name _ _, _) -> (match, assign name e')
277+ (Match name _ _, _) -> (match, assign name e')
278− _ -> (match, "")
278+ _ -> (match, "")
279 matches <- matchToJS span match'
279 matches <- matchToJS span match'
280 return $ "function(){ " ++ stmt ++ matches ++ " }()"
280 return $ "function(){ " ++ stmt ++ matches ++ " }()"