Tomek,<br><br>&gt; If you want to see the code I will try to release it<br>I&#39;m very interested.<br><br>Thanks,<br>Greg<br><br><br><div><span class="gmail_quote">On 6/15/07, <b class="gmail_sendername">Tomasz Zielonka</b>
 &lt;<a href="mailto:tomasz.zielonka@gmail.com">tomasz.zielonka@gmail.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
On Thu, Jun 14, 2007 at 05:55:46PM -0700, Greg Fitzgerald wrote:<br>&gt; Has anyone embedded a build language in Haskell?&nbsp;&nbsp;Something like<br>&gt; Rake&lt;<a href="http://rake.rubyforge.org/">http://rake.rubyforge.org/</a>
&gt;is to Ruby, but in Haskell or any<br>&gt; statically-typed functional language.<br><br>I have. It consists of such components:<br><br>- A type for build rules<br><br>&nbsp;&nbsp;&nbsp;&nbsp;type Rule = FilePath -&gt; Maybe (BuildMonad (IO ()))
<br><br>&nbsp;&nbsp;&nbsp;&nbsp;newtype BuildMonad a =<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;BuildMonad { runBuildMonad :: WriterT [FilePath] IO a }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;deriving (Monad, MonadWriter [FilePath])<br><br>&nbsp;&nbsp;Every rule has three levels:<br>&nbsp;&nbsp;&nbsp;&nbsp;- matching target file names&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:: FilePath -&gt; Maybe a
<br>&nbsp;&nbsp;&nbsp;&nbsp;- generating dependencies&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; :: WriterT [FilePath] m a<br>&nbsp;&nbsp;&nbsp;&nbsp;- target building&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; :: IO ()<br>&nbsp;&nbsp;The levels are nested in a way that allows to use variables bound on<br>&nbsp;&nbsp;one level in the levels below.
<br><br>- An simple rule execution engine - takes a list of rules and<br>&nbsp;&nbsp;tries to build given targets taking care of dependencies<br><br>- A small library of useful functions, eg. for using temporary files<br>&nbsp;&nbsp;with automatic renaming on successful completion (so you don&#39;t
<br>&nbsp;&nbsp;end up with partially built targets).<br><br>- A small Template Haskell library for Perl-like string interpolation<br>&nbsp;&nbsp;to help constructing shell commands<br><br>If you want to see the code I will try to release it (it&#39;s in a
<br>company&#39;s project), but it&#39;s quite small and IMHO the nicest thing in it<br>is the overall idea. It&#39;s quite heavy for simple uses, but in<br>more complicated cases it allows things which are nearly (or literally)
<br>impossible in GNU make.<br><br>Best regards<br>Tomek<br></blockquote></div><br>