Skip to content

Instantly share code, notes, and snippets.

View Mzk-Levi's full-sized avatar

Melchizedek Mzk-Levi

View GitHub Profile
@Mzk-Levi
Mzk-Levi / SetJDK
Last active August 29, 2015 14:04
Switch JDK bash function
# Set JDK
# source - http://www.jayway.com/2014/01/15/how-to-switch-jdk-version-on-mac-os-x-maverick/
#
function setjdk() {
if [ $# -ne 0 ]; then
removeFromPath '/System/Library/Frameworks/JavaVM.framework/Home/bin'
if [ -n "${JAVA_HOME+x}" ]; then
removeFromPath $JAVA_HOME
fi
@Mzk-Levi
Mzk-Levi / Coroutine notes
Created August 19, 2014 20:31
Coroutines
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;
@Mzk-Levi
Mzk-Levi / ncompositions.scala
Last active March 24, 2018 03:06
Horizontal & Vertical Compositions of Natural Transformations
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]

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
Mzk-Levi / gist:9841da3858ccca19f60d
Created April 23, 2015 04:12
KASPAAR bibliography (incomplete)
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)