2 ms·
Author here. I didn't know that about Haskell. Admittedly, the "rating" is pretty rough, maybe even a bad idea. I've seen std::ptr::null more than I ever have
by paulddraper 11y ago
Author here. I didn't know that about Haskell.
Admittedly, the "rating" is pretty rough, maybe even a bad idea.
I've seen std::ptr::null more than I ever have Foreign.Ptr.nullPtr.
But really, both are usually used for compatibility with external libraries/programs/runtimes, not for idiomatic language programming.
Both great languages in my book :)
- bjz_ 11y ago> I've seen std::ptr::null more than I ever have Foreign.Ptr.nullPtr. Probably because we need to work with the C API a great deal right now, but that should change as more and more things are written in Rust. Still, the unsafe boundary helps by removing the ability to dereference a raw pointer in safe code - something that Haskell doesn't have.
- paulddraper 11y agoFYI, I fixed it. std::ptr::null isn't really comparable, so I removed it. You can't really use it in Rust like you could in other languages.