Skip to content

Instantly share code, notes, and snippets.

View paulp's full-sized avatar
🤫

Paul Phillips paulp

🤫
  • CAZ, Inc.
  • Cascadia Autonomous Zone
View GitHub Profile
#!/usr/bin/env bash
#
# Dependencies:
# coursier ( on OSX: brew install --HEAD paulp/extras/coursier )
# zinc ( on OSX: brew install zinc )
#
set -euo pipefail
# You can compile code in different projects by overriding these, e.g.
@paulp
paulp / readable.txt
Created May 12, 2017 00:29
Presenting evictions.
Evictions differing in patch version:
com.chuusai:shapeless_2.11:{ 2.3.2, 2.3.1, 2.3.0 }
eu.timepit:refined_2.11:0.8.0 depends on 2.3.2
org.quasar-analytics:quasar-foundation-internal_2.11:17.0.2 depends on 2.3.1
org.tpolecat:doobie-core_2.11:0.3.0 depends on 2.3.0
org.parboiled:parboiled_2.11:2.1.3 depends on 2.3.0
Evictions differing in minor version:
@paulp
paulp / .gitignore
Created May 11, 2017 17:11
The price of having my home directory under revision control.
#
*.history
*[-_]history
.CFUserTextEncoding
.DS_Store
.dropbox*
.eclipse
.localized
.lockfile
.viminfo
@paulp
paulp / build.sbt
Last active October 28, 2017 13:02
/** 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"
In regards to our evaluating ourselves based on what we'd do after a long
period of reflection with our 1000 IQ and so on. You said something like "I'm
not sure that person would meaningfully be me anymore." Quite so.
And whatever conditions we decide upon for characterizing this "moral genius"
to whom we defer, we can only do it with our current minds. If part of
developing moral genius is a more sophisticated characterization of what moral
genius IS, then surely that too must evolve.
And now we enter into infinite regress: the answer changes the question, the
package policy
import scala.reflect.ClassTag
trait Iterator[@specialized +A] extends scala.Iterator[A] {
def next(): A
def hasNext: Boolean
}
object Iterator {
def wrap[A](it: scala.Iterator[A]): Iterator[A] = new Iterator[A] {
package p {
trait Show[-A] {
def show(x: A): String
}
trait Direct[+A]
trait Consecutive[+A] extends Direct[A]
final class Closed[+A]() extends Consecutive[A]
trait LowPriorityShow {
@paulp
paulp / tlc.diff
Last active March 31, 2017 00:08
+[warn] !!! HK subtype check on [X]std.this.Consecutive[X] and scala.this.Singleton, but both don't normalize to polytypes:
+[warn] tp1=[X]std.this.Consecutive[X] PolyType
+[warn] tp2=scala.this.Singleton ClassNoArgsTypeRef
[info] [log typer] ?_$2 setInst lang.this.String
-[info] [log typer] ?A setInst scala.this.Any
-[info] [log typer] TVar<CC=null> addHiBound [X]std.this.Consecutive[X].instantiateTypeParams(List(type A, type CC), List(=?scala.this.Any, TVar<CC=n*ull>))
+[info] [log typer] ?A setInst scala.this.Singleton
+[info] [log typer] TVar<CC=null> addHiBound [X]std.this.Consecutive[X].instantiateTypeParams(List(type A, type CC), List(=?scala.this.Singleton, TVa*r<CC=null>))
+[warn] !!! HK subtype check on [X]std.this.Consecutive[X] and scala.this.Singleton, but both don't normalize to polytypes:
+[warn] tp1=[X]std.this.Consecutive[X] PolyType
@paulp
paulp / typelevel-difference.scala
Last active March 31, 2017 00:59
different behavior between typelevel and standard compiler
/** The following difference in behavior is seen between the
* typelevel scala 2.12.1 compiler and the standard one. The
* only difference between the failing case and the succeeding one
* is the scalaOrganization. No compiler options are needed.
* To reproduce, add
*
* scalaOrganization := "org.typelevel"
*
* to the build.sbt at https://github.com/paulp/psp-std and sbt test.
*/
psp@seed:/s/github/monixio/monix (master) ag-bare -w ap | ag -vw def
F.ap(ff)(fa)
F.ap(ff)(fa)
F.applicative.ap(ff)(fa)
* It can be optionally imported in scope to make `map2` and `ap` to
szF.ap(fa)(ff)
F.ap(f)(fa)
F.applicative.ap(f)(fa)
val fa2 = F.ap(fa)(ff)
val fa2 = F.ap(fa)(ff)