- All times will be communicated in a way that is unambiguous. This communication may be a local time, with a UTC offset specified.
For example:
module Main where | |
-- | JSON is an incredibly simple format. Even its lists are untyped. | |
-- | As with all languages, functional programming encourages us to | |
-- | make a domain-specific language (or DSL) to capture the "ideas" | |
-- | of the language, which we can then use to talk about its content. | |
-- | In this little snippet, we'll build a JSON DSL, transform it into | |
-- | a recursive structure, and then use that result to generate some |
data EqBy a = EqBy (a -> Bool) a | |
instance Eq (EqBy a) where | |
EqBy f _ == EqBy _ y = f y | |
eqBy :: (a -> a -> Bool) -> a -> EqBy a | |
eqBy f x = EqBy (f x) x | |
equalBy :: (a -> a -> Bool) -> [a] -> [a] -> Bool | |
equalBy f xs ys = fmap (eqBy f) xs == fmap (eqBy f) ys |
/** 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" |
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 |
# 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 |
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 { |
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 |
package example; | |
import java.util.Optional; | |
class Foo {} | |
interface Bar { | |
String barMethod(); | |
} | |
public class TypeUnifailcation extends Foo implements Bar { |
import Data.Vect | |
%default total | |
Num Type where | |
(+) = Either | |
(*) = Pair | |
fromInteger 0 = Void | |
fromInteger 1 = Unit | |
fromInteger 2 = Bool |