Re: Curious demand in a function parameter

2018-03-25 Thread Sebastian Graf
Hey, the problem is with eta-expansion in this case, I believe, or rather the lack there-of. Your recursive `f` is always bottoming out, which makes GHC not want to eta-expand the RealWorld# parameter (Note [State hack and bottoming functions] in CoreArity.hs is probably related). If you change

Curious demand in a function parameter

2018-03-25 Thread Ömer Sinan Ağacan
Hi, In this program {-# LANGUAGE MagicHash #-} module Lib where import Control.Exception import GHC.Exts import GHC.IO data Err = Err deriving (Show) instance Exception Err f :: Int -> Int -> IO Int f x y | x > 0 = IO (raiseIO# (toException Err))