Skip to content

Instantly share code, notes, and snippets.


Melchizedek Mzk-Levi

View GitHub Profile
View afm1.scala
type ArtifactId = Int
trait ArtifactRepoF[+A]
object ArtifactRepoF {
case class Drop[+A](id: ArtifactId, n: A) extends ArtifactRepoF[A]
case class Query[+A](id: ArtifactId, onResult: Artifact => A) extends ArtifactRepoF[A]
case class Put[+A](a: Artifact, n: A) extends ArtifactRepo[A]
val functor: Functor[ArtifactRepoF] =
Mzk-Levi / SetJDK
Last active Aug 29, 2015
Switch JDK bash function
View SetJDK
# Set JDK
# source -
function setjdk() {
if [ $# -ne 0 ]; then
removeFromPath '/System/Library/Frameworks/JavaVM.framework/Home/bin'
if [ -n "${JAVA_HOME+x}" ]; then
removeFromPath $JAVA_HOME
View Coroutine notes
Coroutines are computer program components that generalize subroutines to allow multiple entry points for suspending and resuming execution at certain locations.
"Subroutines are special cases of ... coroutines." –Donald Knuth.
When subroutines are invoked, execution begins at the start, and once a subroutine exits, it is finished;
an instance of a subroutine only returns once, and does not hold state between invocations.
By contrast, coroutines can exit by calling other coroutines,
which may later return to the point where they were invoked in the original coroutine;
from the coroutine's point of view, it is not exiting but calling another coroutine.
Thus, a coroutine instance holds state, and varies between invocations;
View gist:51e690ebc36ed75650ac

Denotational [Semantics &] Design Notes

“Perfection is achieved not when there is nothing left to add, but when there is nothing left to take away” (Antoine de Saint-Exupéry)


The semantic function in DDWTCM & DDFMTP papers, ⟦_⟧, μ, decribes a mapping from a Syntactic Doman → Semantic Domain

Mzk-Levi / gist:9841da3858ccca19f60d
Created Apr 23, 2015
KASPAAR bibliography (incomplete)
View gist:9841da3858ccca19f60d
P. Wadler -
Propositions As Types
Monads for Functional programming
Course in General Linguistics - Ferdinand de Saussure
Homotopy Type Theory - Univalent Foundations of Mathematics
On the Meanings of the Logical Constants and the Justifications of the Logical Laws - Per Martin-Löf
Proofs & Types - Yves Girad
Lectures on the Curry Howard Isomorpism - Morten Heine Sørensen M.Sc Ph.D (Author), Pawel Urzyczyn prof. dr hab. (Author)
Mzk-Levi / ncompositions.scala
Last active Mar 24, 2018
Horizontal & Vertical Compositions of Natural Transformations
View ncompositions.scala
trait Functor[F[_]] {
def map[A, B](as: F[A])(f: A => B): F[B]
object Functor {
def apply[F[_]](implicit e: Functor[F]): Functor[F] = e
trait ~>[F[_], G[_]] {
def apply[A](x: F[A]): G[A]
You can’t perform that action at this time.