This file contains hidden or 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
[error] scala.tools.reflect.ToolBoxError: reflective compilation has failed: | |
[error] | |
[error] object Ary is not a member of package ArrayOps | |
[error] at scala.tools.reflect.ToolBoxFactory$ToolBoxImpl$ToolBoxGlobal.throwIfErrors(ToolBoxFactory.scala:314) | |
[error] at scala.tools.reflect.ToolBoxFactory$ToolBoxImpl$ToolBoxGlobal.compile(ToolBoxFactory.scala:248) | |
[error] at scala.tools.reflect.ToolBoxFactory$ToolBoxImpl.compile(ToolBoxFactory.scala:411) | |
[error] at scala.tools.reflect.ToolBoxFactory$ToolBoxImpl.eval(ToolBoxFactory.scala:414) | |
[error] at scala.reflect.macros.runtime.Evals$class.eval(Evals.scala:16) | |
[error] at scala.reflect.macros.runtime.Context.eval(Context.scala:6) | |
[error] at ch.unige.fastvec.Macros$.evalArrayTree(Macros.scala:18) |
This file contains hidden or 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.streum.interpol | |
/* Here is the interpolator itself, we just add a method `md` | |
to the `StringContext` using implicit conversions */ | |
object Markdown { | |
implicit class MDContext( val context: StringContext ) extends AnyVal { | |
// I used knockoff markdown processor. I don't have any real experience with |
This file contains hidden or 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.util.parsing.combinator._ | |
object FASTA { | |
case class Entry( description: String, sequence: String ) | |
def fromFile( fn: String ): List[Entry] = { | |
val lines = io.Source.fromFile(fn).getLines.mkString("\n") | |
fromString( lines ) | |
} |
This file contains hidden or 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
//Syntax higlighting for: | |
// http://scala-enterprise.blogspot.com/2012/02/scala-source-code-and-density.html | |
val site = config.sites.find(_.name == siteName).getOrElse( | |
throw new IllegalArgumentException("Cannot find site " + siteName)) | |
val group = config.groups.find(_.name == groupName).getOrElse( | |
throw new IllegalArgumentException("Cannot find group " + groupName)) | |
group.repositories.foreach { repo => | |
val repoDir = new File(group.path, repo.name) | |
println("Backing up to repository %s at %s starting..." format (repo.name, repoDir)) |
This file contains hidden or 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 scalaz._ | |
import Scalaz._ | |
object MapReader extends App { | |
type ValidReader[S,X] = (S) => Validation[NonEmptyList[String],X] | |
type MapReader[X] = ValidReader[Map[String,String],X] | |
def read[A: Manifest]( key: String )( f: String => A ): MapReader[A] = | |
map => { |
This file contains hidden or 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.example | |
import annotation.tailrec | |
import com.google.caliper.Param | |
class CaseOrder extends SimpleScalaBenchmark { | |
abstract class Expr | |
case class Var(name: String) extends Expr | |
case class Number(num: Double) extends Expr |
This file contains hidden or 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.collection.Traversable | |
import scala.collection.TraversableLike | |
import scala.collection.mutable.Builder | |
import scala.collection.mutable.ListBuffer | |
import collection.generic.CanBuildFrom | |
class Bag[T] private ( private val bag: Map[T,Int], private val total: Int ) | |
extends Traversable[(T,Int)] |
This file contains hidden or 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
blah |