Last active
March 27, 2018 14:34
-
-
Save mbrandonw/ba89647da7ce63452e113a2b37119bcb to your computer and use it in GitHub Desktop.
This file contains hidden or 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
{-# LANGUAGE EmptyCase #-} | |
data Never | |
absurd :: Never -> a | |
absurd a = case a of {} | |
main = do | |
putStrLn "It compiles!" |
This file contains hidden or 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
class Never private constructor() | |
fun <A> absurd(never: Never): A { | |
when(never) {} | |
} | |
println("It compiles!") |
This file contains hidden or 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
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