title: Serialization of scala functions
body: <p>I know that there is Jerkson and scalaxb and even Java's XStream that successfully able to serialize scala's data. I know that they handle well Strings, Integers and even case classes pretty well. But if I have function as one of the fields? </p>
  
  <p>e.g. if I have something like: </p>
  
  <pre><code>case class Foo(bar: (Int) =&gt; Boolean, baz: Int) 
  </code></pre>
  
  <p>Can these fields been somehow serialized to JSON or XML (actually, I don't care to which one, they should be human-readable, thats why I don't want to use <a href="https://github.com/DRMacIver/sbinary" rel="noreferrer">SBinary</a>)?</p>
  
  <h2>EDIT</h2>
  
  <p>Why would I want to do that? 
  Right now I'm writing implementation of decision tree. I don't want to reconstruct that trees every time from training data hence I need to serialize them and that part could be done with SBinary. But additionally, it would be nice if as a humans we could look at serialized tree and analyze it. </p>
  
  <p>It is not so wide task as I wrote in title, yes. 
  What I thinking now, is to write a custom serializer (e.g. for Jerkson) with my own format, or write to string field and then parse this back.</p>
  
  <p>But I though that there could be some insanely better way to perform that. </p>