This Standard ML code compiles and I find it amusing

in #sml2 years ago
datatype '_ ~ = && of '_ * '_
              | || of '_ * '_
              | ! of '_
              | ` of '_

infix || &&

fun \ ((\ && $) || (% && ?)) = (! \ || ! $) && (! % || ! ?)
  | \ ((\ || $) && (% || ?)) = (! \ && ! $) || (! % && ! ?)
  | \ ($ && %) = ! $ || ! %
  | \ ($ || %) = ! $ && ! %
  | \ (` $) = ! (` $)
  | \ (! $) = (` o `) $

fun main () = ()