Minimal hdr histogram implementation in rust
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
extern crate timely; | |
use std::rc::Rc; | |
use std::cell::RefCell; | |
use timely::dataflow::InputHandle; | |
use timely::dataflow::operators::{Input, Exchange, Inspect, Probe, Map}; | |
fn main() { | |
// initializes and runs a timely dataflow. | |
timely::execute_from_args(std::env::args(), |worker| { |
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
sealed abstract trait ADT | |
case object One extends ADT | |
case object Two extends ADT | |
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
case class Circle(radius: Double) | |
trait HasArea[A] { | |
def area(a: A): Double | |
} | |
implicit val `HasArea for Circle` = new HasArea[Circle] { | |
def area(circle: Circle): Double = Math.PI * Math.pow(circle.radius, 2) | |
} |
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
trait Logic<D> { | |
// ... | |
} | |
impl<D, F> Logic<D> for F where F: FnMut(D) { | |
// ... | |
} | |
// ... | |
impl<D> Container<D> { |
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
[trace] Stack trace suppressed: run last macrosJS/compile:compileIncremental for the full output. | |
[trace] Stack trace suppressed: run last macrosJVM/compile:compileIncremental for the full output. | |
[error] (macrosJS/compile:compileIncremental) scala.meta.internal.hosts.scalac.converters.ConvertException: unexpected tree during scala.reflect -> scala.meta conversion: | |
[error] Import(Select(Ident(scala), scala.reflect), List(ImportSelector(TermName("NameTransformer"), 50, TermName("NameTransformer"), 50))) | |
[error] (PackageDef) package macros { import scala.reflect.NameTransformer; o... | |
[error] (PackageDef) package cats { package macros { import scala.reflect.N... | |
[error] (macrosJVM/compile:compileIncremental) scala.meta.internal.hosts.scalac.converters.ConvertException: unexpected tree during scala.reflect -> scala.meta conversion: | |
[error] Import(Select(Ident(scala), scala.reflect), List(ImportSelector(TermName("NameTransformer"), 50, TermName("NameTransformer"), 50))) | |
[error] (PackageDef) package macro |
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
project/target/ | |
target/ |
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
// run with: node --harmony experiment.js | |
var R = require('ramda'); | |
var PromiseScheduler = (function() { | |
function PromiseScheduler() { | |
this.nodes = {}; | |
} | |
PromiseScheduler.prototype.add = function(id, fetcher, dependencies) { | |
this.nodes[id] = { |
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
macro iff { | |
rule { | |
($x:expr) { | |
$truebody | |
... | |
$truelast:expr | |
} els { | |
$falsebody | |
... | |
$falselast:expr |