portmaster irc/irssi
portmaster irc/irssi-xmpp
brew install irssi
Welcome to Scala version 2.10.0 (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_37). | |
Type in expressions to have them evaluated. | |
Type :help for more information. | |
scala> import scalaz.std.string._ | |
import scalaz.std.string._ | |
scala> import scalaz.syntax.validation._ | |
import scalaz.syntax.validation._ |
object IsEmpty | |
class Holder[A, B](private var value: A) { | |
def set(a: A)(implicit ev: B =:= IsEmpty.type) { | |
value = a | |
} | |
} | |
object Holder { | |
def empty[A]: Holder[A, IsEmpty.type] = |
scala> implicit def x: String = "asgasgf" | |
x: String | |
scala> def foo(a: Int)(implicit x: Int, y: String = implicitly[String]): String = "a" | |
foo: (a: Int)(implicit x: Int, implicit y: String)String | |
scala> foo(1)(2) | |
res2: String = a | |
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')))) | |
} |
A course aimed at learning Scala. Rather than a traditional set of canned exercises, we will spend approx 12 weeks (more or less as required) building a complete system, and a system that may even be useful. The exercise is still contrived, in that we will attempt to implement far more of the code by hand than would normally occur, but we will build a series of components that are likely to be similar to code produced in a production setting.
The proposed exercise is to build a source code search engine on top of the venerable Ctags index format. This will involve
case class Blat[A](v: String \/ A) { | |
def isValue = | |
value.isDefined | |
def isMessage = | |
message.isDefined | |
def value: Option[A] = | |
v.toOption |
There are lots of representations for strings. In most languages they pick one set of tradeoffs and run with it. In haskell the "default" implementation (at least the one in the prelude) is a pretty bad choice, but unlike most other languages (really) good implementations exist for pretty much every way you can twist these things. This can be a good thing, but it also leads to confusion, and frustration to find the right types and how to convert them.
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDAKiDGY1h3sMbExSG8NM4LgMPzqj+AJJo8IfgTFZQ8I0p1XOQDoZc2UpxyOgBdTLCPdMUVn9mbZlibVfZNdKmB1axnff2+N6VGuaXe3q33mRK/acuOFMq/Z8jJzqliIv1jR6siOkag6Hvg+ZVB/dr/zSUbRSQCJQLOBFDephxfRA7kompB19ecIxL5EO9JGslFWEF9ttvhMF97j0Z7/YT7c27wVir1ETh4e68bCEBWfmbK+pNATNjaQAnatd5tGHxXGEN4kLJvoLKtyNKbZvRmxbl97o9VuFzLKwJArToMzM8esumn/xN82oqpfETGQfuH7RF9OjL+x3SrCKTkzctT mth@vex |