|
Unsafe Functions: msg#00156lang.haskell.libraries
I would like to start a discussion on the role of unsafe functions in Haskell: unsafePerformIO :: IO a -> a unsafeInterleaveIO :: IO a -> IO a unsafeInterleaveST :: ST s a -> ST s a unsafeIOToST :: IO a -> ST s a unsafeIOToSTM :: IO a -> STM a unsafeFreeze, unsafeThaw, unsafePreservingMatrix, unsafeRenderPrimitive perhaps also unsafeForeignPtrToPtr :: ForeignPtr a -> Ptr a (which is already under Foreign.*) hGetContents :: Handle -> IO String (which is lazy rather than unsafe per se) * Do you use these, and what for? * Is there safe functionality that can currently only be obtained with them? * Do you think they should be standardised, and how? I'm thinking the unsafe functions should be moved from System.IO.Unsafe and elsewhere to Unsafe, similar to Foreign.*, to better separate them from "real Haskell" conceptually. Also, I would add: unsafeCoerce :: a -> b -- Ashley Yakeley, Seattle WA WWEWDD? http://www.cs.utexas.edu/users/EWD/ |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: Data.ByteString candidate 3: 00156, John Meacham |
|---|---|
| Next by Date: | Re: Data.ByteString candidate 3: 00156, Einar Karttunen |
| Previous by Thread: | Cabal feature request - dates in versionsi: 00156, Einar Karttunen |
| Next by Thread: | Re: Unsafe Functions: 00156, Donald Bruce Stewart |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |