[Haskell-cafe] "Bounds checking" pragma?

Joachim Breitner mail at joachim-breitner.de
Wed Nov 9 23:54:04 CET 2011


Am Donnerstag, den 10.11.2011, 01:35 +0200 schrieb Artyom Kazak:
> Anyway, I have to say it once again: unsafeAt is ugly and Haskell is  
> beautiful. Why high-performance code should be ugly?

It does not have to be ugly. Just write
        (!!) = unsafeAt
in some common module of yours, and you have a nice fast array access.

I don’t think a flag would be very helpful, because you might have some
places where you want the safe access, and others where you know that it
is safe to skip the check.


Joachim "nomeata" Breitner
  mail at joachim-breitner.de  |  nomeata at debian.org  |  GPG: 0x4743206C
  xmpp: nomeata at joachim-breitner.de | http://www.joachim-breitner.de/

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20111109/9126e1ab/attachment.pgp>

More information about the Haskell-Cafe mailing list