[Haskell-cafe] Trying to write 'safeFromInteger'

Bulat Ziganshin bulat.ziganshin at gmail.com
Tue Apr 7 17:35:24 EDT 2009

Hello Kannan,

Wednesday, April 8, 2009, 1:27:21 AM, you wrote:

>     if i > (toInteger maxBound)

problem here is that GHC doesn't know what maxBound you mean. is it
maxBound::Int8? or maxBound::Word128? it has nothing common with the
value you return later

so you need to use either scoped type variables or usual asTypeOf
trick. look recent cafe threads for more info

Best regards,
 Bulat                            mailto:Bulat.Ziganshin at gmail.com

More information about the Haskell-Cafe mailing list