stan
stan copied to clipboard
Inspection on too restrictive SPECIALIZE
If you have a function of type:
foo :: MonadIO m => m a
then the following specializations are either useless or too restrictive:
{-# SPECIALIZE foo :: MonadIO m => m () #-}
{-# SPECIALIZE foo :: IO () #-}
The only correct one is:
{-# SPECIALIZE foo :: IO a #-}
But since GHC doesn't warn on such cases, it's useful for Stan to provide such type of analysis.