<p>You can use forward slashes in Windows as well.</p>
<div class="gmail_quote">On Jan 6, 2014 9:13 PM, "Kees Bleijenberg" <<a href="mailto:k.bleijenberg@lijbrandt.nl">k.bleijenberg@lijbrandt.nl</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
In a program I use a lot of hamlet files. All these hamlet files are in a<br>
submap of the source map. In code:<br>
allHtml = Mconcat   [  $(hamletFile "hamlet\\belastingen.hamlet") renderUrl<br>
                       ,$(hamletFile "hamlet\\winddruk.hamlet") renderUrl<br>
                      ..<br>
                       ,$(hamletFile "hamlet\\berekeningDruk.hamlet")<br>
renderUrl<br>
                       ,$(hamletFile "hamlet\\drukNaarBuigTrek.hamlet")<br>
renderUrl]<br>
This is a Windows program.<br>
<br>
For another project I want to use this piece of code on Linux. The code<br>
should now be:<br>
.. $(hamletFile "hamlet/winddruk.hamlet") renderUrl<br>
<br>
I can't use pathSeparator here, because this is all happening at compile<br>
time. So I think I need a preprocessor.<br>
I would like to have a kind of hamletDir macro and change the code to<br>
something like:<br>
<br>
#ifdef Win32<br>
  hamletDir = "hamlet\\"<br>
#else<br>
  hamletDir = "hamlet/"<br>
#endif<br>
...<br>
$(hamletFile "{hamletDir}winddruk.hamlet") renderUrl<br>
Is it possible in Haskell and how do I it?<br>
<br>
All examples of preprocessing in Haskell I found are something like this:<br>
#ifdef xxx<br>
        aaaa<br>
#else<br>
        Bbbbb<br>
#endif<br>
I could use that. But a user defined macro is less code.<br>
<br>
Kees<br>
<br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
</blockquote></div>