This blog post series has moved here.
You might also be interested in the 2016 version.
This blog post series has moved here.
You might also be interested in the 2016 version.
{-# LANGUAGE GADTs #-} | |
{-# LANGUAGE TypeFamilies #-} | |
{-# LANGUAGE RankNTypes #-} | |
{-# LANGUAGE KindSignatures #-} | |
{-# LANGUAGE PolyKinds #-} | |
{-# LANGUAGE DataKinds #-} | |
{-# LANGUAGE ScopedTypeVariables #-} | |
data VarKind t = Bound | Free t |
import Data.Vect | |
%default total | |
Num Type where | |
(+) = Either | |
(*) = Pair | |
fromInteger 0 = Void | |
fromInteger 1 = Unit | |
fromInteger 2 = Bool |
package example; | |
import java.util.Optional; | |
class Foo {} | |
interface Bar { | |
String barMethod(); | |
} | |
public class TypeUnifailcation extends Foo implements Bar { |
object Tmp { | |
"zzz" ++ "kkk" // Fails with -Yno-predef | |
// after typer the above is scala.this.Predef.augmentString("zzz").++[Char, String](scala.this.Predef.augmentString("kkk"))(scala.this.Predef.StringCanBuildFrom); | |
"aaa"+new Object() // Doesn't fail ever! | |
// after typer the above is "aaa".+(new java.this.lang.Object()); | |
// Why didn't `+` desugar to something else? | |
new Object() + "aaa" // Fails with -Yno-predef |
case class IO[A](unsafePerformIO: () => A) { | |
def map[B](ab: A => B): IO[B] = IO(() => ab(unsafePerformIO())) | |
def flatMap[B](afb: A => IO[B]): IO[B] =IO(() => afb(unsafePerformIO()).unsafePerformIO()) | |
def tryIO(ta: Throwable => A): IO[A] = | |
IO(() => IO.tryIO(unsafePerformIO()).unsafePerformIO() match { | |
case Left(t) => ta(t) | |
case Right(a) => a | |
}) | |
} | |
object IO { |
# Credit http://stackoverflow.com/a/2514279 | |
for branch in `git branch -r | grep -v HEAD`;do echo -e `git show --format="%ci %cr" $branch | head -n 1` \\t$branch; done | sort -r |
http://courses.cms.caltech.edu/cs179/ | |
http://www.amd.com/Documents/GCN_Architecture_whitepaper.pdf | |
https://community.arm.com/graphics/b/blog | |
http://cdn.imgtec.com/sdk-documentation/PowerVR+Hardware.Architecture+Overview+for+Developers.pdf | |
http://cdn.imgtec.com/sdk-documentation/PowerVR+Series5.Architecture+Guide+for+Developers.pdf | |
https://www.imgtec.com/blog/a-look-at-the-powervr-graphics-architecture-tile-based-rendering/ | |
https://www.imgtec.com/blog/the-dr-in-tbdr-deferred-rendering-in-rogue/ | |
http://developer.amd.com/tools-and-sdks/opencl-zone/amd-accelerated-parallel-processing-app-sdk/opencl-optimization-guide/#50401334_pgfId-412605 | |
https://fgiesen.wordpress.com/2011/07/09/a-trip-through-the-graphics-pipeline-2011-index/ | |
https://community.arm.com/graphics/b/documents/posts/moving-mobile-graphics#siggraph2015 |
/** Your task is to reason your way to which compiler | |
* options which will be passed for each of | |
* 1) sbt root/compile | |
* 2) sbt p1/compile | |
*/ | |
scalacOptions := Seq("-DSBT") | |
scalacOptions in ThisBuild += "-D0" | |
scalacOptions in Global += "-D1" |