This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object GenTypeConstraints { | |
abstract class =:=|[F,A,B] extends (F => Either[A,B]) | |
object =:=| { | |
implicit def eqA[F,X]: =:=|[F,F,X] = new =:=|[F,F,X] {def apply(v:F) = Left(v)} | |
implicit def eqB[F,X]: =:=|[F,X,F] = new =:=|[F,X,F] {def apply(v:F) = Right(v)} | |
} | |
def main(args: Array[String]) { | |
println(f(1)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Date | |
import java.text.SimpleDateFormat | |
import java.net.URL | |
import scala.xml._ | |
import scala.xml.parsing.XhtmlParser | |
import scala.io.Source | |
case class User( userId:Int, nickname:String, twitterId:Option[String], join:Boolean = true ) | |
class Event( eventId:String, eventXml:Node ) { | |
lazy val usersXml = XML.load( new URL( "http://api.atnd.org/events/users/?event_id=%s" format eventId )) |