<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><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">K.Bleijenberg@lijbrandt.nl</a>> escribió:<br><br></div><blockquote type="cite"><div><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"><meta name="Generator" content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.E-mailStijl17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--><div class="WordSection1"><p class="MsoNormal">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></p><p class="MsoNormal">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></p><p class="MsoNormal">I did ghc --make test.hs and everything works fine.  The generated execuatable is very slow.<o:p></o:p></p><p class="MsoNormal">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></p><p class="MsoNormal"><o:p> </o:p></p><p class="MsoNormal">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></p><p class="MsoNormal">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></p><p class="MsoNormal"><o:p> </o:p></p><p class="MsoNormal">Kees<o:p></o:p></p><p class="MsoNormal"><o:p> </o:p></p></div></div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>Haskell-Cafe mailing list</span><br><span><a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a></span><br><span><a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a></span><br></div></blockquote></body></html>