Skip to content

Instantly share code, notes, and snippets.

@rcherrueau
rcherrueau / inclusion.idr
Created September 6, 2015 11:58
List inclusion predicate in Idris
module inclusion
import Data.List
%default total
-- List intersection
namespace intersect
-- Intersection operation
%hide List.intersect
@rcherrueau
rcherrueau / OMO10.scala
Created March 5, 2015 09:58
Type Classes as Object and Implicits
/** Type Classes as Object and Implicits
*
* @InProceedings{OMO10a,
* author = {Bruno C. d. S. Oliveira and Adriaan Moors and Martin
* Odersky},
* title = {Type classes as objects and implicits},
* booktitle = {Proceedings of the 25th Annual {ACM} {SIGPLAN}
* Conference on Object-Oriented Programming, Systems,
* Languages, and Applications, {OOPSLA} 2010, October
* 17-21, 2010, Reno/Tahoe, Nevada, {USA}},
@rcherrueau
rcherrueau / que03.rkt
Created November 22, 2014 18:57
Inverting back the inversion of control, or Continuation versus page-centric programming
;; Inverting back the inversion of control, or Continuation versus
;; page-centric programming.
;; Christian Queinnec
;;
;; @Article{Que03a,
;; author = {Christian Queinnec},
;; title = {Inverting back the inversion of control or,
;; continuations versus page-centric programming},
;; journal = {{SIGPLAN} Notices},
;; year = 2003,
@rcherrueau
rcherrueau / Zipper.scala
Created July 28, 2014 16:08
Scala implementation of Gérard Huet's The Zipper
/** Scala implementation of Gérard Huet's The Zipper.
*
* The Zipper is a kind of Iterator for Tree. The Zipper offers
* navigation and edition primitives in constant time.
* [[http://www.dblp.org/rec/bibtex/journals/jfp/Huet97 The Zipper]]
*/
/** Tree data structure. */
sealed abstract class Tree[T]
case class Item[T] (val item: T) extends Tree[T]