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
[info] Test run started | |
[info] Test run finished: 0 failed, 0 ignored, 0 total, 0.001s | |
[info] Passed: : Total 57, Failed 0, Errors 0, Passed 57, Skipped 0 |
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
sealed trait Nat { | |
type Self <: Nat | |
type + [_ <: Nat] <: Nat | |
type * [_ <: Nat] <: Nat | |
type Flip_^ [_ <: Nat] <: Nat | |
type ^ [T <: Nat] = T # Flip_^[Self] | |
type ++ = Succ[Self] | |
} | |
object Nat { |
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 hltest | |
// Church Numerals | |
sealed trait Nat { | |
type Self <: Nat | |
type Apply[F[_], _] | |
type + [_ <: Nat] <: Nat | |
type * [_ <: Nat] <: Nat | |
type Flip_^ [_ <: Nat] <: Nat |
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 ToTest extends App { | |
val i1 = new Invoker(List(1,2,3,1)) | |
val t1 = i1.to[Set]() | |
val t1t: Set[Int] = t1 | |
println(t1) | |
val i2 = new Invoker(Seq("a","b")) | |
val t2 = i2.to[Array]() | |
val t2t: Array[String] = t2 |
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 org.scalaquery.demo | |
import scala.reflect._ | |
import org.scalaquery.ql._ | |
import org.scalaquery.ql.extended.{ExtendedTable => Table} | |
import org.scalaquery.ql.extended.H2Driver.Implicit._ | |
import org.scalaquery.simple.StaticQuery.updateNA | |
import org.scalaquery.session.Database | |
import org.scalaquery.session.Database.threadLocalSession |
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
// A simple table with keys and values | |
val T = new Table[(Int, String)]("T") { | |
def k = column[Int]("KEY", O.PrimaryKey) | |
def v = column[String]("VALUE") | |
def * = k ~ v | |
} | |
// Create the table and insert some data | |
T.ddl.create | |
T.insertAll(1 -> "a", 2 -> "b", 3 -> "c", 4 -> "d", 5 -> "e") |
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
_SCRIPT_PATH="$(cd "${0%/*}" 2>/dev/null; echo "$PWD"/"${0##*/}")" | |
_SCRIPT_DIR=`dirname "${_SCRIPT_PATH}"}` | |
_EXTRADOC_HOME=${_SCRIPT_DIR}/.. | |
export TOOL_CLASSPATH="${_EXTRADOC_HOME}/target/scala_2.8.0/classes:${_EXTRADOC_HOME}/src/main/resources" | |
export JAVA_OPTS="-Xms512M -Xmx2048M -Xss1M -XX:MaxPermSize=128M" | |
scala -classpath ${TOOL_CLASSPATH} com.novocode.extradoc.ExtraDoc "$@" |
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 scala.xml.{Node, Elem, Group} | |
/** | |
* A path to a Node in a Node tree. | |
*/ | |
sealed trait NodePath { | |
def depth: Int | |
} | |
object NodePath { |
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 DSL2 { | |
def main(args: Array[String]): Unit = { | |
val m1 = Machine(Agent("agent1"), null) | |
val m2 = Machine(Agent("agent2"), m1) | |
val m3 = Machine(Agent("agent3"), m2) | |
val selector = agent.compose(parent.compose(parent)) | |
println("Name of agent: " + selector(m3).name) | |
println("Name of agent of m3: " + agent(m3).name) |
NewerOlder