PageRenderTime 29ms CodeModel.GetById 24ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/core/src/main/scala/scalaz/CharSet.scala

http://github.com/scalaz/scalaz
Scala | 25 lines | 14 code | 10 blank | 1 comment | 0 complexity | d0d638eb518bbedbe2564594a2caaf1e MD5 | raw file
 1package scalaz
 2
 3/** Newtype for strings representing character sets. */
 4final case class CharSet private(value: String)
 5
 6object CharSet extends CharSetFunctions {
 7
 8  def charset(v: String): CharSet = CharSet(v)
 9
10  val USASCII = charset("US-ASCII")
11
12  val ISO8859 = charset("ISO-8859-1")
13
14  val UTF8 = charset("UTF-8")
15
16  val UTF16BE = charset("UTF-16BE")
17
18  val UTF16LE = charset("UTF-16LE")
19
20  val UTF16 = charset("UTF-16")
21}
22
23trait CharSetFunctions {
24  implicit def ToStringFromCharSet(charSet:CharSet): String = charSet.value
25}