Skip to content

Instantly share code, notes, and snippets.

@evincarofautumn
Created June 5, 2020 01:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save evincarofautumn/81c9fc1272393b652df5ea1dffbb24d5 to your computer and use it in GitHub Desktop.
Save evincarofautumn/81c9fc1272393b652df5ea1dffbb24d5 to your computer and use it in GitHub Desktop.
// Uninhabited type, value-kinded
type Void {}
// or:
// type synonym Void as type (VOID);
// Uninhabited type, poly-kinded
type VOID<K> as K {}
// or (wibbles):
// type VOID as <K> K {}
// type<K> VOID as K {}
// Unary constructive negation
type synonym Not<T> (T -> Void)
// Variadic/polymorphic constructive negation
type synonym NOT<...R> (...R -> VOID);
// or:
// type synonym NOT<K as kind, X as K> (X -> VOID)
// Ex falso quodlibet
define impossible<...R, ...S> (...R, Void -> ...S):
// Note no ‘+Fail’ because all 0 cases are matched.
match {}
// A functor of void must be empty
define vacuous<F<_>, A> (F<Void> -> F<A> where Functor<F>):
\impossible map
// Various instances (non-exhaustive)
instance show (Void -> Text): impossible
instance compare (Void, Void -> Ordering): impossible
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment