Serpent7776 avatar

This Standard ML code compiles and I find it amusing

serpent7776

Published: 25 May 2023 › Updated: 25 May 2023This Standard ML code compiles and I find it amusing

This Standard ML code compiles and I find it amusing

datatype '_ ~ = && of '_ * '_
              | || of '_ * '_
              | ! of '_
              | ` of '_

infix || &&

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

fun main () = ()

Leave This Standard ML code compiles and I find it amusing to:

Written by

I like programming languages.

Read more #sml posts


Best Posts From Serpent7776

We have not curated any of serpent7776's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.

More Posts From Serpent7776