error in your article? about meaning of safe/unsafe in "foreign import"

2005-05-19 Thread Bulat Ziganshin
Hello Peter, Sunday, May 15, 2005, 4:07:28 PM, you wrote: PS> http://research.microsoft.com/Users/simonpj/papers/marktoberdorf/ this article says that -- some foreign procedures may cover have purely­functional semantics. For example, the C sin

Re: error in your article? about meaning of safe/unsafe in "foreign import"

2005-05-20 Thread Peter Simons
Bulat, just for the record, it's not my article. Although I have the privilege of sharing a somewhat similar name with the geniuses around here, I didn't have any part in that text. ;-) You were wondering about this declaration: > foreign import ccall unsafe sin :: Float -> Float I guess you

Re: error in your article? about meaning of safe/unsafe in "foreign import"

2005-05-20 Thread Duncan Coutts
On Fri, 2005-05-20 at 11:30 +0200, Peter Simons wrote: > Since pure FFI calls don't have any side-effects, they are > always safe to be called unsafely. (Yes, the choice of the > words "safe" and "unsafe" is a bit unfortunate in the standard > here.) To try and undo this confusion we need to reca

Re: error in your article? about meaning of safe/unsafe in "foreign import"

2005-05-20 Thread Peter Simons
Duncan Coutts writes: > So to sumarise the pairings: > * you _must_ make a safe call to an unsafe foreign function > * you _may_ make an unsafe call to a safe foreign function > > It's a contravariance :-) I'd use a slightly different term. Declaring a function that needs special

Re[2]: error in your article? about meaning of safe/unsafe in "foreign import"

2005-05-20 Thread Bulat Ziganshin
Hello Peter, Friday, May 20, 2005, 1:30:08 PM, you wrote: PS> just for the record, it's not my article. Although I have the PS> privilege of sharing a somewhat similar name with the geniuses PS> around here, I didn't have any part in that text. ;-) i answered your letter but wrote to Simon PJ P

Re: Re[2]: error in your article? about meaning of safe/unsafe in "foreign import"

2005-05-20 Thread Peter Simons
Bulat Ziganshin writes: PS> Since pure FFI calls don't have any side-effects, they are PS> always safe to be called unsafely. > sorry, but even pure C function can call back to Haskell world and > lead to GC. Um, right. I said I didn't understand these things completely either. Guess I was r