Skip to content

Instantly share code, notes, and snippets.

@romanowski
Created July 27, 2017 18:39
Show Gist options
  • Save romanowski/ba99485f435f8056c5e270ee0e41c5d4 to your computer and use it in GitHub Desktop.
Save romanowski/ba99485f435f8056c5e270ee0e41c5d4 to your computer and use it in GitHub Desktop.
package object lib {
// When we make RicherString implicit class Foo won't compile
class RicherString(base: String) {
val head: Char = if(base.isEmpty) ' ' else base.charAt(0)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment