Skip to content

Instantly share code, notes, and snippets.

@wz1000
Created April 18, 2021 14:19
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 wz1000/708c43a3ed4438c4850966479cf0be16 to your computer and use it in GitHub Desktop.
Save wz1000/708c43a3ed4438c4850966479cf0be16 to your computer and use it in GitHub Desktop.
{-# LANGUAGE Safe #-}
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE DuplicateRecordFields #-}
module Main where
import Control.Monad.ST
data R a b = R { x :: a , x :: b}
unsafeCoerce :: a -> b
unsafeCoerce i = case (R False False){x = i} of
R a b -> b
unsafePerformIO :: IO a -> a
unsafePerformIO x = runST (unsafeCoerce x)
main = do
let !() = unsafePerformIO $ putStrLn "Launching missiles..."
pure ()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment