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.
module Main where | |
import Debug.Trace | |
import Data.Tuple | |
import Data.Either | |
import Data.Lazy | |
class Memo a where | |
memo :: forall r. (a -> r) -> a -> Lazy r |
// http://stackoverflow.com/questions/52353/in-java-what-is-the-best-way-to-determine-the-size-of-an-object | |
import java.lang.instrument.Instrumentation; | |
public class ObjectSizeFetcher { | |
private static Instrumentation instrumentation; | |
public static void premain(String args, Instrumentation inst) { | |
instrumentation = inst; | |
} |
Picking the right architecture = Picking the right battles + Managing trade-offs
Principles of Adult Behavior
FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.
data Regex | |
= Empty | |
| Single Char | |
| Alt Regex | |
Regex | |
| Con Regex | |
Regex | |
| Star Regex | |
deriving (Show) |
If you are curious about the types inferred by ClojureScript, it is easy to get some insight using a macro:
(defmacro inferred-type [form]
`'~(cljs.analyzer/infer-tag &env
(cljs.analyzer/no-warn (cljs.analyzer/analyze &env form))))
This is the kind of dev-time macro you could refer using the new user.cljs
feature.
import it.unimi.dsi.fastutil.objects.ObjectAVLTreeSet | |
data class Quad(val s: String = "", val p: String = "", val o: Comparable<Any>? = null, val c: String = "") : | |
Comparable<Quad> { | |
override fun compareTo(other: Quad): Int = compareValuesBy(this, other, Quad::s, Quad::p, Quad::o, Quad::c) | |
override fun toString(): String = "Q<S=$s P=$p O=$o C=$c>" | |
} |
Why?