[Haskell-cafe] In-place modification

Sebastian Sylvan sebastian.sylvan at gmail.com
Sun Jul 15 07:30:56 EDT 2007


On 15/07/07, Hugh Perkins <hughperkins at gmail.com> wrote:
> On 7/15/07, Hugh Perkins <hughperkins at gmail.com> wrote:
> > On 7/15/07, Sebastian Sylvan <sebastian.sylvan at gmail.com > wrote:
> >
> > > > "unsafe"' here just means direct array indexing. Same as the other
> > > > languages. Haskell's 'unsafe' is a little more paranoid that other
> > > > languages.
> >
> >
> > Yes, I was kindof hoping it was something like that.  Cool :-)
> >
>
> Errr ... wait... when you say "direct array indexing", you mean that this
> does or doesnt continue to do bounds checking on the array access?
>
> I could imagine that it is "unsafe" simply because direct array indexing
> prevents mathematically proving that the program wont crash (?), or it could
> be unsafe in the C++ way, where going off the end of the array corrupts your
> stack/heap?


Well, *I* didn't say it but yes. Unsafe disables bounds checking
(which in this case is safe). I think you can just stick an unsafe{}
in the C# version to disable them.

-- 
Sebastian Sylvan
+44(0)7857-300802
UIN: 44640862


More information about the Haskell-Cafe mailing list