<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div>I have some code generation from xml producing files this big. Not going well :-(</div><div><br></div><div>I’m make TH functions and will generate much smaller files.</div><div><br></div><div>Hopefully the compiler expansion the templates is better than a big file full of source code.</div><div><br></div><br><div><div>On Mar 7, 2015, at 10:17 AM, <a href="mailto:amindfv@gmail.com">amindfv@gmail.com</a> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="auto" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div>You definitely don't want 30,000 lines in a single module. You should split this into separate modules, but be aware that the way you split them can affect how your program is e.g. inlined -- there can be performance implications.</div><div><br></div><div>Tom</div><div><br></div><div><br>El Mar 7, 2015, a las 10:56, "Kees Bleijenberg" <<a href="mailto:K.Bleijenberg@lijbrandt.nl" style="color: purple; text-decoration: underline;">K.Bleijenberg@lijbrandt.nl</a>> escribió:<br><br></div><blockquote type="cite"><div class="WordSection1" style="page: WordSection1;"><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">I’ve written a program that reads a Excel file, parses the contents and generates a haskell module. Every cell in the xls has it’s own function in the module. This worked fine.<o:p></o:p></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">Now I have a bigger xls. The resulting module Xls.hs contains 30000 lines haskell code (without comment). I created a testprogram test.hs that calculates and prints one cell.<o:p></o:p></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">I did ghc --make test.hs and everything works fine. The generated execuatable is very slow.<o:p></o:p></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">I did ghc --make –O2 test.hs. The compilations takes 15 minutes and aborts with ‘ghc: out of memory’. I’am working on Win 7 64 bits , ghc version = 7.8.3.<o:p></o:p></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;"><o:p> </o:p></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">What can I do to fix this? I do need –O2. I found with smaller xls’s that optimization speeds up the executable dramatically.<o:p></o:p></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">Before I start experimenting, does it help to split up the xls .hs in seperate files? I.e. the cells that refer to other cells and cells that don’t refer to other cells. Or will I still get ‘out of memory’ because the optimization is global?<o:p></o:p></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;"><o:p> </o:p></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">Kees<o:p></o:p></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;"><o:p> </o:p></div></div></blockquote><blockquote type="cite"><span>_______________________________________________</span><br><span>Haskell-Cafe mailing list</span><br><span><a href="mailto:Haskell-Cafe@haskell.org" style="color: purple; text-decoration: underline;">Haskell-Cafe@haskell.org</a></span><br><span><a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" style="color: purple; text-decoration: underline;">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a></span><br></blockquote>_______________________________________________<br>Haskell-Cafe mailing list<br><a href="mailto:Haskell-Cafe@haskell.org" style="color: purple; text-decoration: underline;">Haskell-Cafe@haskell.org</a><br><a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" style="color: purple; text-decoration: underline;">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a></div></blockquote></div><br></body></html>