Skip to content

Instantly share code, notes, and snippets.

@henrytill
henrytill / exists.ml
Created March 26, 2017 16:23 — forked from jonsterling/exists.ml
existential quantifier in OCaml
(* an abstract signature for instantiations of the existential quantifier *)
module type EXISTS =
sig
(* the predicate *)
type 'a phi
(* the existential type *)
type t
(* the introduction rule *)
@henrytill
henrytill / recur.ml
Created March 25, 2017 19:47 — forked from tel/recur.ml
Not as bad as I feared
module type Functor = sig
type 'a t
val map : ('a -> 'b) -> ('a t -> 'b t)
end
module Mu (F : Functor) : sig
type t = { mu : t F.t }
val cata : ('a F.t -> 'a) -> (t -> 'a)
end = struct
@henrytill
henrytill / FAlg.ml
Created March 25, 2017 19:47 — forked from tel/FAlg.ml
More F-algebra things in OCaml
module type Functor = sig
type 'a t
val map : ('a -> 'b) -> ('a t -> 'b t)
end
module Iso = struct
type ('a, 'b) t = { fwd : 'a -> 'b; bck : 'b -> 'a }
let fwd i = i.fwd
let bck i = i.bck
; Copyright (c) Rich Hickey. All rights reserved.
; The use and distribution terms for this software are covered by the
; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php)
; which can be found in the file epl-v10.html at the root of this distribution.
; By using this software in any fashion, you are agreeing to be bound by
; the terms of this license.
; You must not remove this notice, or any other, from this software.
(set! *warn-on-reflection* true)
#! /usr/bin/env bash
channels=${1:-nixos-15.09-small nixos-15.09 nixos-unstable-small nixos-unstable nixpkgs-unstable}
site=${2:-https://nixos.org/channels}
getChannelVersion () {
basename $(curl -ILs -w %{url_effective} -o /dev/null $1) | cut -d - -f 2
}
for name in ${channels[@]}