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
__________________________________________________ | |
Project definition: | |
__________________________________________________ | |
version := "0.7" | |
resolvers += "Scala Tools Releases" at "http://scala-tools.org/repo-releases/" | |
libraryDependencies += "org.scalatest" % "scalatest" % "1.3" % "test" |
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
@heiflo: Deep Mix Moscow Radio www.deepmix.eu | |
@behaghel: JJ Cale | |
@franztaptanium: Steps from Hell | |
@peyloW: Deine Lakaien, Raubtier, Timoteij, VNV Nation, Dragon Force | |
@TwistedChaz: Portico Quartet - Knee-Deep in the North Sea (Album) | |
@ArmyOfBruce: Orbital | |
@tylerweir: di.fm |
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.lifty.engine | |
import java.io.File | |
import org.lifty.engine._ | |
import scalaz._ | |
import Scalaz._ | |
/* This class is just used for debugging purposes */ | |
object Main { |
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
(root source.scala | |
(include @storage-modifiers) | |
(include @keywords) | |
(include @declarations) | |
(include @inheritance) | |
(include @imports) | |
(include @comments) | |
(include @block-comments) | |
(include @strings) | |
(include @initialization) |
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/sh | |
exec scala "$0" "$@" | |
!# | |
/* | |
Subset of our Simple Java AST | |
*/ | |
sealed abstract class SJStatement | |
case class SJAssert (assertion : SJExpression) extends SJStatement |
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
/* | |
I want to use a higher-rank polymorphic function when transforming an AST to generalize the | |
'traversal' so it can be separated from the actual transformation of each node. | |
This snippet of code doesn't quite capture my use case but it provokes the same compile error | |
as I get here: https://gist.github.com/1139579 | |
*/ | |
trait ~>[F[_],G[_], -UpperBound] { | |
def apply[A <: UpperBound](a: F[A]): G[A] |
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
Sooo, what is happening here? | |
[error] error while loading Diff, class file needed by Diff is missing. | |
[error] reference type Serializable of package scala refers to nonexisting symbol. | |
[error] class file needed by Diff is missing. | |
[error] reference type Serializable of package scala refers to nonexisting symbol. | |
[error] two errors found | |
[debug] Compilation failed (CompilerInterface) | |
Compilation failed | |
at xsbt.CompilerInterface.run(CompilerInterface.scala:93) |
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
{- | |
Dear reader, | |
This is an attempt to de-mystify how Control.Monad.State.get seems to | |
magically create a State out of nothing. | |
Here's an example taken from the documentation: | |
tick :: State Int Int | |
tick = do |
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
val op1 = Some("test") | |
val op2 = Some("test") | |
val l1 = List(1,2,3) | |
val l2 = List(1,2,3) | |
val product: Option[List[(Int,Int)]] = for { | |
t1 <- op1 | |
t2 <- op2 | |
} yield l1.flatMap { l => l2.map { l2 => (l,l2) }} |
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
/* | |
This is implemented following the instructions in "The Design and Analysis of | |
Computer Algorithms, AHO Hopcroft Ullman, 1974". | |
The implementation uses a DFS to find the strongly connected components (SCCs) | |
of a graph. During the DFS the vertices are placed on a stack in the order | |
they are visited. Whenever a root is found, all vertices of the corresponding | |
SSC are on the top of the stack and are popped. |