T2756.hs 236 Bytes
Newer Older
Simon Peyton Jones's avatar
Simon Peyton Jones committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
module Main where

data X = X ()

{-# NOINLINE newX #-}
newX :: () -> IO X
newX n = do
    let {-# NOINLINE value #-}
        value = n
    return (X value)

main = do
    x <- newX (error "Why?")
    case x of
        X _ -> return ()