[Haskell-cafe] How do you make constant expressions?

Eitan Goldshtrom thesourceofx at gmail.com
Mon Jul 19 04:09:46 EDT 2010


One point of clarification that'd be nice. I'm getting some type errors 
that I wasn't getting before, so I'd just like to know something about 
the inline pragma. I have

width = 800
{-# INLINE width #-}

main = (truncate width, fromIntegral width)

Now when I ran this program it seemed to work at first. Note that 
truncate and fromIntegral take different types as inputs. I then changed 
a different part of the program having nothing to do with this code and 
all of a sudden GHC started giving me a type error about the above code. 
Does anyone know why?

-Eitan


More information about the Haskell-Cafe mailing list