Skip to content

Instantly share code, notes, and snippets.

@mbrandonw
Last active March 27, 2018 14:34
Show Gist options
  • Save mbrandonw/ba89647da7ce63452e113a2b37119bcb to your computer and use it in GitHub Desktop.
Save mbrandonw/ba89647da7ce63452e113a2b37119bcb to your computer and use it in GitHub Desktop.
{-# LANGUAGE EmptyCase #-}
data Never
absurd :: Never -> a
absurd a = case a of {}
main = do
putStrLn "It compiles!"
class Never private constructor()
fun <A> absurd(never: Never): A {
when(never) {}
}
println("It compiles!")
enum Never {}
fn absurd<A>(never: Never) -> A {
match never {
}
}
fn main() {
println!("It compiles!");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment