<div dir="ltr">The Read and Show instances are exactly for that purpose.....</div><div class="gmail_extra"><br><div class="gmail_quote">2015-08-08 1:04 GMT+02:00 Corentin Dupont <span dir="ltr"><<a href="mailto:corentin.dupont@gmail.com" target="_blank">corentin.dupont@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Hi Matthew,<br></div>yes that's exactly that.<br>I want to do exactly what you would do with a JSON file (read, write), but with a data format that would be valid Haskell (instead of valid javascript).<br><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Aug 7, 2015 at 8:06 PM, Matthew Pickering <span dir="ltr"><<a href="mailto:matthewtpickering@gmail.com" target="_blank">matthewtpickering@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Corentin,<br>
<br>
I don't quite understand your question please can you explain a bit<br>
more.  Do you want to read a valid haskell source file, perform some<br>
changes to the file and then print out a valid source file?<br>
<br>
I am a bit confused about the bit about turing-completeness.<br>
<br>
Matt<div><div class="h5"><br>
<div><div><br>
On Fri, Aug 7, 2015 at 7:55 PM, Corentin Dupont<br>
<<a href="mailto:corentin.dupont@gmail.com" target="_blank">corentin.dupont@gmail.com</a>> wrote:<br>
> Hello!<br>
> I'm wondering if it's possible to serialize some data to a format that is<br>
> valid Haskell.<br>
> In practice I would read a file like this:<br>
><br>
> module Foo where<br>
><br>
>   myData :: MyData<br>
>   myData = MyData {name = "foo",<br>
>                    descr = "test"<br>
>                    ...<br>
>                    }<br>
><br>
> Reading this into a program is easily feasible with Hint, for example. Then<br>
> the program would modify some data and serialize it back to:<br>
><br>
> module Foo where<br>
><br>
>   myData :: MyData<br>
>   myData = MyData {name = "bar",<br>
>                    descr = "test2"<br>
>                    ...<br>
>                    }<br>
><br>
> In practice I think that the format should be a subset of Haskell that is<br>
> not Turing-complete.<br>
> A bit like JSON, which is a subset of Javascript but not Turing complete.<br>
> Is it possible?<br>
><br>
> Thanks,<br>
> Corentin<br>
><br>
</div></div></div></div>> _______________________________________________<br>
> Haskell-Cafe mailing list<br>
> <a href="mailto:Haskell-Cafe@haskell.org" target="_blank">Haskell-Cafe@haskell.org</a><br>
> <a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" target="_blank" rel="noreferrer">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a><br>
><br>
</blockquote></div><br></div>
<br>_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" target="_blank" rel="noreferrer">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature">Alberto.</div>
</div>