Skip to content

Instantly share code, notes, and snippets.

Pomu pomu0325

Block or report user

Report or block pomu0325

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@pomu0325
pomu0325 / GenTypeConstraints.scala
Created Aug 14, 2011 — forked from kmizu/GenTypeConstraints.scala
Hacking generalized type constraints.
View GenTypeConstraints.scala
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))
View ATNDApi.scala
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 ))
You can’t perform that action at this time.