on master help sign in
Add $!! when reloading in processNet
b540068Edwin Brady
src/Idris/REPL.hs+11−5
@@ -189,11 +189,13 @@ processNetCmd orig i h fn cmd
189 where
189 where
190 processNet fn Reload = processNet fn (Load fn Nothing)
190 processNet fn Reload = processNet fn (Load fn Nothing)
191 processNet fn (Load f toline) =
191 processNet fn (Load f toline) =
192+ -- The $!! here prevents a space leak on reloading.
193+ -- This isn't a solution - but it's a temporary stopgap.
194+ -- See issue #2386
192− do let ist = orig { idris_options = idris_options i
195+ do putIState $!! orig { idris_options = idris_options i
193− , idris_colourTheme = idris_colourTheme i
196+ , idris_colourTheme = idris_colourTheme i
194− , idris_colourRepl = False
197+ , idris_colourRepl = False
195− }
198+ }
196− putIState ist
197 setErrContext True
199 setErrContext True
198 setOutH h
200 setOutH h
199 setQuiet True
201 setQuiet True
@@ -755,6 +757,9 @@ edit f orig
755 let args = line ++ [fixName f]
757 let args = line ++ [fixName f]
756 runIO $ rawSystem editor args
758 runIO $ rawSystem editor args
757 clearErr
759 clearErr
760+ -- The $!! here prevents a space leak on reloading.
761+ -- This isn't a solution - but it's a temporary stopgap.
762+ -- See issue #2386
758 putIState $!! orig { idris_options = idris_options i
763 putIState $!! orig { idris_options = idris_options i
759 , idris_colourTheme = idris_colourTheme i
764 , idris_colourTheme = idris_colourTheme i
760 }
765 }
@@ -1704,6 +1709,7 @@ idrisMain opts =
1704 iputStrLn banner
1709 iputStrLn banner
1705
1710
1706 orig <- getIState
1711 orig <- getIState
1712+
1707 mods <- if idesl then return [] else loadInputs inputs Nothing
1713 mods <- if idesl then return [] else loadInputs inputs Nothing
1708 let efile = case inputs of
1714 let efile = case inputs of
1709 [] -> ""
1715 [] -> ""