Skip to content

Instantly share code, notes, and snippets.

View yoohaemin's full-sized avatar

Haemin Yoo yoohaemin

View GitHub Profile
implicit val whitespace2: P[_] => P[Unit] = new (P[_] => P[Unit]) {
// statuses
private final val Normal: Int = 0
private final val InsideLineComment: Int = 1
private final val DetermineLineBreakStart: Int = 2
private final val UnicodeBOM = '\uFEFF'
private final val WhiteSpace = '\u0009'
private final val WhiteSpace2 = '\u0020'
private final val LF = '\u000A'
@yoohaemin
yoohaemin / cycles.scala
Created June 20, 2020 06:31
cyclic dependency graph
trait ABase {
def foo: Unit
}
trait A extends ABase { self: BBase =>
def foo: Unit = ()
}
trait BBase {
@yoohaemin
yoohaemin / show.scala
Created May 3, 2020 07:02
Dotty derivation show
import scala.deriving._
import scala.quoted._
import scala.quoted.matching._
import scala.compiletime._
trait Show[T] {
def show(x: T): String
}
object Show {
object fpis {
def cons[A](a: => A, s: => Stream[A]): Stream[A] = a #:: s
def empty[A]: Stream[A] = Stream.empty[A]
def unfold[A, S](z: S)(f: S => Option[(A, S)]): Stream[A] = f(z) match {
case Some((a, s)) => a #:: unfold(s)(f)
case None => Stream.Empty
}
@yoohaemin
yoohaemin / 0.dhall
Created October 27, 2019 12:27
zero
0
@yoohaemin
yoohaemin / 2.12.8 -Ystatistics
Last active August 7, 2019 02:38
scalac 2.12.9 regression
[info] Compiling 80 Scala sources to /home/haemin/projects/work_project/target/scala-2.12/classes ...
[info] Enabling statistics, measuring overhead = 16.7539ns to 34.1212ns per timer
[info] *** Cumulative statistics at phase parser
[info] #created tree nodes : 44370
[info] *** Cumulative statistics at phase typer
[info] time spent typechecking : 1 spans, ()15734.573ms
[info] time spent in lubs : 291 spans, ()28.896ms (0.2%) aggregate, 24.116ms (0.2%) specific
[info] time spent in <:< : 668319 spans, ()3342.185ms (21.2%) aggregate, 3078.037ms (19.6%) specific
[info] time spent in findmember : 406067 spans, ()896.681ms (5.7%) aggregate, 836.234ms (5.3%) specific
[info] time spent in findmembers : 0 spans, ()0.0ms (0.0%) aggregate, 0.0ms (0.0%) specific
@yoohaemin
yoohaemin / startup.sh
Last active July 18, 2019 02:38
Startup scripts to make my life a little easier
#!/bin/sh
xrandr --output eDP --mode 1680x1050 &
gnome-terminal &
thunderbird &
idea-community &
firefox &
@yoohaemin
yoohaemin / CatsEffectHarness.scala
Created April 20, 2019 07:26
CatsEffectHarness.scala
import cats.effect.Bracket
import cats.syntax.flatMap._
import cats.syntax.traverse._
import cats.syntax.functor._
import cats.instances.vector._
import testz._
import testz.runner.TestOutput
@yoohaemin
yoohaemin / apply.sh
Created December 17, 2018 05:43
한자키 없애고 한칸씩 밀기
# Hangul_Hanja to Alt_L
xmodmap -e 'keycode 131 = Alt_L'
# Alt_L to Super_L
xmodmap -e 'remove mod1 = Alt_L'
xmodmap -e 'keycode 64 = Super_L'
@yoohaemin
yoohaemin / 15Z980-GX7BK.md
Last active November 13, 2018 06:37
Benchmark of system performance with scalac -- same settings as: https://xuwei-k.hatenablog.com/entry/2018/07/21/115020

Specs

  • CPU: Core i7-8550u
  • RAM: 24GB
  • OS: Ubuntu 18.04 (Linux 4.15.0-38-generic)
  • JVM: GraalVM EE 1.0-RC9

Result

JVM: GraalVM EE 1.0-RC9