@@ -22,6 +22,7 @@ import Idris.Core.Evaluate
23import Data.Maybe
23import Data.Maybe
24import Data.Char
24import Data.Char
25+import Data.List (isPrefixOf, isSuffixOf)
25import Control.Monad
26import Control.Monad
26import Control.Monad.State.Strict
27import Control.Monad.State.Strict
@@ -299,7 +300,9 @@ replaceSplits l ups = updateRHSs 1 (map (rep (expandBraces l)) ups)
299 else c : updatePat (not (isAlphaNum c)) n tm rest
300 else c : updatePat (not (isAlphaNum c)) n tm rest
300 updatePat start n tm (c:rest) = c : updatePat (not (isAlpha c)) n tm rest
301 updatePat start n tm (c:rest) = c : updatePat (not (isAlpha c)) n tm rest
302− addBrackets tm | ' ' `elem` tm = "(" ++ tm ++ ")"
303+ addBrackets tm | ' ' `elem` tm
304+ , not (isPrefixOf "(" tm)
305+ , not (isSuffixOf ")" tm) = "(" ++ tm ++ ")"
303 | otherwise = tm
306 | otherwise = tm
305getUniq nm i
308getUniq nm i