File tree Expand file tree Collapse file tree
src/Agda2Hs/Language/Haskell Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -223,7 +223,8 @@ uses ty = not . null . usedTypesOf ty
223223
224224-- Ideally, our pretty-printing library should insert parenthesis where needed.
225225-- However, hs-src-exts does not insert adequate parenthesis for infix
226- -- operators so we need to insert some by hand (see issues #54 and #273 and #317).
226+ -- operators so we need to insert some by hand
227+ -- (see issues #54 and #273 and #317 and #460).
227228
228229-- | Properly parenthesize an expression with regards to the default fixities.
229230insertParens :: Data a => a -> a
@@ -254,6 +255,7 @@ insertPars fixs = \case
254255
255256 needParenExpr (InfixApp _ _ _ e2) = needParenExpr e2
256257 needParenExpr Lambda {} = True
258+ needParenExpr If {} = True
257259 needParenExpr _ = False
258260
259261 parL topOp e =
Original file line number Diff line number Diff line change 1+ open import Haskell.Prelude
2+
3+ prepend : Bool → List Int → List Int
4+ prepend b xs = (if b then 1 ∷ [] else []) ++ xs
5+
6+ {-# COMPILE AGDA2HS prepend #-}
Original file line number Diff line number Diff line change 1+ module Issue460 where
2+
3+ prepend :: Bool -> [Int ] -> [Int ]
4+ prepend b xs = (if b then [1 ] else [] ) ++ xs
5+
You can’t perform that action at this time.
0 commit comments