[Haskell-cafe] Detecting numeric overflows

Andres Löh andres at well-typed.com
Tue Jul 31 21:04:03 CEST 2012


Hi.

On Mon, Jul 30, 2012 at 8:47 AM, Евгений Пермяков <permeakra at gmail.com> wrote:
> Can someone tell me if there are any primitives, that used to detect machine
> type overflows, in ghc haskell ? I perfectly understand, that I can build
> something based on preconditioning of variables, but this will kill any
> performance, if needed.

There's

  http://hackage.haskell.org/package/safeint/

It's not implemented quite as efficiently as it theoretically could
be, but it might do more or less what you want.

Cheers,
  Andres

-- 
Andres Löh, Haskell Consultant
Well-Typed LLP, http://www.well-typed.com



More information about the Haskell-Cafe mailing list