Skip to content

Instantly share code, notes, and snippets.

@markhibberd
Created March 27, 2013 01:58
Show Gist options
  • Save markhibberd/5250951 to your computer and use it in GitHub Desktop.
Save markhibberd/5250951 to your computer and use it in GitHub Desktop.
case class Utf8String(value: String)
object Utf8String {
implicit val ArbitraryUtf8String: Arbitrary[Utf8String] =
Arbitrary(arbitrary[String] map (k =>
Utf8String(k filter (c => c < '\ud800' || c > '\udfff'))))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment