This file contains 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
## | |
# A script to help you install and config basictex | |
# https://www.tug.org/mactex/morepackages.html | |
# | |
# References: | |
# - https://gist.github.com/kadrach/6228314 | |
# - https://tex.stackexchange.com/a/304202 | |
# | |
# Requirements: | |
# - homebrew |
This file contains 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
brew install pandoc | |
brew tap homebrew/cask | |
brew install --cask basictex | |
eval "$(/usr/libexec/path_helper)" | |
# Update $PATH to include `/usr/local/texlive/2022basic/bin/universal-darwin` | |
sudo tlmgr update --self | |
sudo tlmgr install texliveonfly | |
sudo tlmgr install xelatex | |
sudo tlmgr install adjustbox | |
sudo tlmgr install tcolorbox |
This file contains 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
java.lang.AssertionError: assertion failed: | |
numeric$PosByte | |
while compiling: /Users/fmariotti/open-src/laserdisc/core/src/main/scala/laserdisc/types.scala | |
during phase: globalPhase=terminal, enteringPhase=xsbt-analyzer | |
library version: version 2.13.0 | |
compiler version: version 2.13.0 | |
reconstructed args: -Xcheckinit -Xplugin:/Users/fmariotti/.coursier/cache/v1/https/repo1.maven.org/maven2/org/typelevel/kind-projector_2.13/0.10.3/kind-projector_2.13-0.10.3.jar -Xplugin:/Users/fmariotti/.coursier/cache/v1/https/repo1.maven.org/maven2/org/scoverage/scalac-scoverage-plugin_2.13/1.4.0/scalac-scoverage-plugin_2.13-1.4.0.jar -deprecation -P:scoverage:dataDir:/Users/fmariotti/open-src/laserdisc/core/.jvm/target/scala-2.13/scoverage-data -Wnumeric-widen -feature -bootclasspath /Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home/jre/lib/resources.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home/jre/lib/rt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Con |
This file contains 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
[info] Compiling 1 Scala source to /Users/fmariotti/open-src/laserdisc/circe/.js/target/scala-2.12/test-classes ... | |
java.lang.AssertionError: assertion failed: | |
char$LowerCaseChar | |
while compiling: /Users/fmariotti/open-src/laserdisc/core/src/main/scala/laserdisc/types.scala | |
during phase: globalPhase=terminal, enteringPhase=xsbt-analyzer | |
library version: version 2.12.8 | |
compiler version: version 2.12.8 | |
reconstructed args: -Ywarn-value-discard -Ywarn-nullary-unit -feature -Ywarn-inaccessible -Ypartial-unification -Xcheckinit -Xlint:adapted-args -Xlint:nullary-unit -Xlint:inaccessible -Xlint:nullary-override -Xlint:infer-any -Xlint:missing-interpolator -Xlint:doc-detached -Xlint:private-shadow -Xlint:type-parameter-shadow -Xlint:poly-implicit-overload -Xlint:option-implicit -Xlint:delayedinit-select -Xlint:by-name-right-associative -Xlint:package-object-classes -Xlint:unsound-match -Xlint:stars-align -Xlint:constant -Ywarn-unused:imports -Ywarn-unused:patvars -Ywarn-unused:privates -Ywarn |
This file contains 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
// addCompilerPlugin("com.milessabin" % "si2712fix-plugin" % "1.2.0" cross CrossVersion.full) | |
import scalaz._, Scalaz._ | |
implicit def f2k[F[_], A, B](f: A => F[B]) = Kleisli(f) | |
val a: Int => ListT[List, Int] = { | |
case 0 => ListT(List(List(0, 1))) | |
case 1 => ListT(List(List(0), List(1))) | |
} |
This file contains 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
/** GADTs in Scala and their limitations */ | |
/** Background: what is an algebraic data type (ADT) ? | |
* ADT: (possibly) recursive datatype with sums and products | |
* In scala - a trait with case classes (case class is product, subtyping is sum) | |
*/ | |
/** Motivation: untyped embedded DSL doesn't prevent nonsensical expressions */ | |
sealed trait Expr { | |
def apply(other: Expr) = Ap(this, other) |
This file contains 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 Stream[+F[_], +A] | |
object Stream { | |
// Make scalac get over its oudenophobia. | |
type Nothing2[X] <: Nothing | |
def emits[F[x] >: Nothing2[x], A](as: List[A]): Stream[F, A] = new Stream[F, A] {} | |
implicit class InvariantOps[F[x] >: Nothing2[x], A](private val self: Stream[F, A]) extends AnyVal { | |
def ethrough[B](p: Stream[F, A] => Stream[F, B]): Stream[F, B] = p(self) |
This file contains 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
// local/localtests/test/localtests/LocalTests.scala | |
package localtests | |
import java.nio.file._ | |
import java.util.stream.{ Stream => JStream } | |
import org.junit.{ AfterClass, Test } | |
import scala.collection.JavaConverters._ | |
import scala.concurrent.duration._ |
This file contains 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.language.higherKinds | |
// Whitebox ... | |
trait Schema[T, R] { | |
def conv(t: T): R | |
} | |
object Schema { | |
// Whitebox macro: R is computed from T | |
implicit def mkSchema[T, R]: Schema[T, R] = ??? // macro ... |
This file contains 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 fpmax | |
import scala.util.Try | |
import scala.io.StdIn.readLine | |
object App0 { | |
def main: Unit = { | |
println("What is your name?") | |
val name = readLine() |
NewerOlder