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
Welcome to Scala version 2.8.1.final (OpenJDK 64-Bit Server VM, Java 1.6.0_20). | |
Type in expressions to have them evaluated. | |
Type :help for more information. | |
scala> import scalaz.io.ByteBuffers._ | |
import scalaz.io.ByteBuffers._ | |
scala> import scalaz.Scalaz._ | |
import scalaz.Scalaz._ |
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 scalaz.example.nio | |
import scalaz._ | |
import concurrent.Promise | |
import effects.IO | |
import nio.sockets._ | |
import nio.Channels._ | |
import Scalaz._ | |
import iteratees._ | |
import java.nio.channels.SocketChannel |
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 ApplicativeMagic[F[_]] { | |
def apply[C](f: ApplicativeMagicFunctionHolder[FunctionArg => C]): F[C] | |
type FunctionArg | |
} | |
class ApplicativeMagicFunctionHolder[F](val f: F) | |
object ApplicativeMagicFunctionHolder { | |
implicit def fix2[A,B,C](f: (A,B) => C): ApplicativeMagicFunctionHolder[Tuple2[A,B] => C] = | |
new ApplicativeMagicFunctionHolder({ case (a,b) => f(a,b) }) | |
implicit def fix3[A,B,C,D](f: (A,B,C) => D): ApplicativeMagicFunctionHolder[Tuple2[Tuple2[A,B],C] => D] = | |
new ApplicativeMagicFunctionHolder({ case ((a,b),c) => f(a,b,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
scala> def foo[A](x: A*): Seq[A] = x | |
foo: [A](x: A*)Seq[A] | |
scala> foo(1,2,3,4,5,6) | |
res0: Seq[Int] = WrappedArray(1, 2, 3, 4, 5, 6) | |
scala> def foo[A](x: A*) = x | |
foo: [A](x: A*)A* | |
scala> foo(1,2,3,4,5) |
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 scalax.io | |
/** | |
* A generic set of iteratees for general purpose usage. These iteratees | |
* make no assumption on error types and do not do any specialized communication | |
* between producers and consumers. | |
*/ | |
trait GenericIteratees extends Iteratees { | |
/** |
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
// $Id$ | |
package scala.util.continuations | |
import annotation.{ Annotation, StaticAnnotation, TypeConstraint } | |
/** This annotation is used to mark a parameter as part of a continuation context. | |
* | |
* The type `A @cps[B,C]` is desugared to `ControlContext[A,B,C]` at compile time. | |
* | |
* @tparam B The type of computation state after computation has executed, and before control is returned to the shift. |
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
#!/bin/bash | |
MONITORS=$(pactl list | egrep -A2 '^(\*\*\* )?Source #' | grep 'Name: .*$' | awk '{print $NF}') | |
if [[ "$1" == "" ]]; then | |
echo "Must specify a recording directory!" | |
echo "" | |
echo "Usage: ./record-all.sh <directory>" | |
exit 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
#!/bin/bash | |
# TODO - Create a branch by build number? | |
declare -r integration_branch="integration" | |
declare -r remote_devel_branch="develop" | |
declare -r remote_master_branch="master" | |
declare -r origin_url="git@github.com:scala/scala.git" | |
declare -r build_opts="all.clean test" | |
declare -r logfile="$(pwd)/integration.log" |
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] ----- PGP Signature Results ----- | |
[info] com.jsuereth : scala-arm_2.9.1 : 1.2 : jar [OK] | |
[info] com.novocode : junit-interface : 0.7 : jar [MISSING] | |
[info] javax.transaction : jta : 1.0.1B : jar [MISSING] | |
[info] org.scala-lang.plugins : continuations : 2.9.1 : jar [MISSING] | |
[info] org.apache.derby : derby : 10.5.3.0_1 : jar [UNTRUSTED(0x98e21827)] | |
[error] {file:/home/josh/projects/typesafe/test-signing/}test-gpg/*:check-pgp-signatures: Some artifacts have bad signatures or are signed by untrusted sources! | |
[error] Total time: 1 s, completed Jan 23, 2012 10:05:52 AM |
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
// Note: "Context" is the Monad through which these classes are threaded. There also exists a type alias for the error channel between | |
// consumers and producers so that Consumers can be random-access. That code lives in the "randomaccess" universe for Iteratees, which is | |
// an extension of the sequential "nio" universe. | |
// Note: I don't have a ConsumerT, ProducerT, or StreamConverterT yet. | |
trait Consumer[I,O] { | |
/** Fold takes a function that matches the current state of this Consumer and produces a result. */ | |
def fold[R](f: ConsumerState[I,O] => Context[R]): Context[R] | |
} |