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
package reactive | |
package web | |
package widgets | |
import scala.xml.NodeSeq | |
import net.liftweb.util.{ CssSel, Helpers, PassThru } | |
import Helpers._ | |
abstract class TableFormlet[A](val signal: SeqSignal[A]) extends Formlet[Seq[A], NodeSeq => NodeSeq, Nothing] { |
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
package reactive | |
package web | |
import javascript.{ JsExp, JsTypes, =|> } | |
import scala.xml.{ NodeSeq, Text } | |
import net.liftweb.util.{ CssSel, PassThru } | |
import net.liftweb.util.Helpers.strToCssBindPromoter | |
trait FormletRenderer[-R, +Out] { |
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
package reactive | |
package web | |
package widgets | |
import net.liftweb.util.{ CssSel, PassThru } | |
import net.liftweb.util.Helpers._ | |
import scala.xml.NodeSeq | |
/** |
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
/* | |
THE OBJECTIVE: | |
Given some Q[A] (Q might be ScalaQuery's query, A might be the first column of the table), | |
there should be a function that can return an object that has a Q[B] (B might be the first two columns | |
of the table), and a way to go from a B to an A (e.g. from (Int, String) to Int). We need to have a | |
collection of such objects (not sure if List or HList). | |
The purpose is this: | |
Suppose for instance I want to develop a very pluggable issue tracker. Its core implementation might |
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 Test extends App { | |
case class Item[A, B](get: A => B, apply: B => Unit) | |
def hlist[A] = | |
Item((_: A) => 73, println) :: | |
Item((_: A) => "hello", println) :: | |
Item((_: A) => false, println) :: | |
HNil | |
class Combine[A] extends Poly2 { |
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
trait ~>[F[_], G[_]] { | |
def apply[T](f: F[T]): G[T] | |
} | |
// object ~> { | |
// class From[F[_]] { type To[G[_]] = ~>[From, To] } | |
// } | |
trait Const[C] { | |
type T[X] = C |
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
// The problem: get the line starting with val q (at the end) to be compile as implicit and inferred as possible | |
/* | |
THE IDEA: | |
Suppose for instance I want to develop a very pluggable issue tracker. Its core implementation might | |
only support a ticket id and a description. Other extensions might add support for various other fields, | |
yet those fields might exist in the database on the same table. | |
Even if not, the number of queries to the database should not need to increase along with the number of | |
extensions. They should be able to contribute to the definition of the query. | |
These objects would also be able to render the data. So the second might know how to render a B, |
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
abstract class Foo(config: Config) { | |
} | |
class Bar(config: Config) extends Foo(config) { | |
def doStuff = { | |
Obj.doStuff(1) | |
} | |
} | |
object Obj { |
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
class Config | |
abstract class Foo(implicit val config: Config) | |
class Bar(config: Config) extends Foo()(config) { | |
def doxxx = Obj.doStuff(1) | |
} | |
object Obj { | |
def doStuff(i: Int)(implicit config: Config) {} |
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
java.lang.Exception: Stack trace | |
at java.lang.Thread.dumpStack(Thread.java:1342) | |
at net.liftweb.http.ResourceServerSpec$$anonfun$1$$anonfun$apply$1.apply(ResourceServerSpec.scala:31) | |
at net.liftweb.http.ResourceServerSpec$$anonfun$1$$anonfun$apply$1.apply(ResourceServerSpec.scala:30) | |
at org.specs2.specification.Example$$anonfun$apply$1.apply(Fragment.scala:119) | |
at org.specs2.specification.Example$$anonfun$apply$1.apply(Fragment.scala:119) | |
at org.specs2.specification.Example.execute(Fragment.scala:102) | |
at org.specs2.specification.FragmentExecution$$anonfun$1.apply(FragmentExecution.scala:51) | |
at org.specs2.specification.FragmentExecution$$anonfun$1.apply(FragmentExecution.scala:51) | |
at org.specs2.execute.ResultExecution$class.execute(ResultExecution.scala:20) |
OlderNewer