title: Scala implicit string conversions utility
body: <p>I'm trying to write some string utils to be able to do implicit conversions of the form <code>"myString".doSpecialConversion</code> and have a <code>specialValue</code> based on which <code>doSpecialConversion</code> works.</p>
  
  <p><b>Attempt-1:</b> Use a trait:</p>
  
  <pre><code>trait ConversionUtils {
  
    // Need an overridable value                                                                                                                                                                                                                                                 
    lazy val specialValue = ","
  
    implicit class StringConversions(val s: String) {
      def doSpecialConversion: Option[String] = if (s == specialValue) None else Some(s)
    }
  }
  </code></pre>
  
  <p>Trait works just fine but the problem is that its not static so multiple <code>StringConversions</code> will be created which is undesired. So I try to extend <code>AnyVal</code> which can't be done for a trait because <a href="http://docs.scala-lang.org/overviews/core/value-classes.html" rel="nofollow"><code>Another limitation that is a result of supporting only one parameter to a class is that a value class must be top-level or a member of a statically accessible object.</code></a></p>
  
  <p><b>Attempt-2:</b> Use a singleton:</p>
  
  <pre><code>object ConversionUtils {
  
    // Need an overridable value                                                                                                                                                                                                                                                 
    lazy val specialValue = ","
  
    implicit class StringConversions(val s: String) extends AnyVal {
      def doSpecialConversion: Option[String] = if (s == specialValue) None else Some(s)
    }
  }
  </code></pre>
  
  <p><b>Question</b>: How do I provide a Util to be able to override the specialValue for StringConversions and be true-ly static?</p>