Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Xuan Bi bixuanzju

🎯
Focusing
View GitHub Profile
View church-encoding.hs
{-# LANGUAGE RankNTypes #-}
newtype BST k v = Roll
{ unroll :: forall r. r -> (k -> v -> r -> r -> r) -> r
}
-- Two constructors
leave :: BST k v
leave = Roll const
@bixuanzju
bixuanzju / sml.el
Last active Dec 25, 2015
For Coursera
View sml.el
(defun isml ()
"If sml repl exists, then restart it else create a new repl."
(interactive)
(when (get-buffer "*sml*")
(with-current-buffer "*sml*"
(when (process-live-p "sml")
(comint-send-eof)))
(sleep-for 0.2))
(sml-run "sml" ""))