Last active
December 27, 2015 21:59
-
-
Save jonsterling/7395544 to your computer and use it in GitHub Desktop.
I think this suffices for the empty type in OCaml, but I'm not certain.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module type TYPE = sig | |
type t | |
end | |
module type EMPTY = functor (T : TYPE) -> sig | |
val apply : T.t | |
end | |
type empty = (module EMPTY) | |
(* Absurdity *) | |
let rec (!) (e : empty) : 'a = ! e |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I was going to use type abstraction along with
assert false
to achieve the same, but though I'd do a quick search first, and found your Gist.I think it holds as far as OCaml goes, but a logical purist might point out that "let rec" is itself unsound. I propose the alternative: