Skip to content

Instantly share code, notes, and snippets.

View jaceklaskowski's full-sized avatar
:octocat:
Enjoying developer life...

Jacek Laskowski jaceklaskowski

:octocat:
Enjoying developer life...
View GitHub Profile
@gkossakowski
gkossakowski / asSeenFrom.md
Last active June 19, 2018 18:27
Understand Scala's core typechecking rules

Scala's "type T in class C as seen from a prefix type S" with examples

Introduction

Recently, I found myself in need to precisely understand Scala's core typechecking rules. I was particulary interested in understanding rules responsible for typechecking signatures of members defined in classes (and all types derived from them). Scala Language Specification (SLS) contains definition of the rules but lacks any examples. The definition of the rules uses mutual recursion and nested switch-like constructs that make it hard to follow. I've written down examples together with explanation how specific set of rules (grouped thematically) is applied. These notes helped me gain confidence that I fully understand Scala's core typechecking algorithm.

As Seen From

Let's quote the Scala spec for As Seen From (ASF) rules numbered for an easier reference:

@piascikj
piascikj / atom-copy-filename.md
Last active August 15, 2022 07:30
Atom copy filename

In ~/.atom/keymap.cson

'atom-text-editor':
  'ctrl-shift-a': 'jaceklaskowski:copy-file-name'

In ~/.atom/init.coffee

path = require 'path'
atom.commands.add 'atom-text-editor', 'jaceklaskowski:copy-file-name', ->
@almendar
almendar / gist:3d41fcec6ea8bb1dc44c
Last active August 29, 2015 14:16
Stacking actors
import akka.actor.{Props, ActorSystem, Actor, ActorLogging}
object AllActorsActions {
case object PrintHello
}
trait AllActorsActions extends Actor { self : ActorLogging =>
import AllActorsActions._
@mbostock
mbostock / .block
Last active January 14, 2023 04:21
Screen Recording to GIF
license: gpl-3.0
@jramb
jramb / wsclj-core.clj
Last active December 11, 2015 04:49
Web Services in Clojure, simple example. Both server and client.
(ns wsclj.core
(:gen-class)
(:import [javax.jws WebService])
(:import [javax.xml.ws Endpoint]))
;; Based on a blog-comment by Jonathan Seltzer
(defprotocol Calculator
(hello [this yourname])
(add [this a b])