[Haskell-cafe] Shooting your self in the foot with Haskell

John Melesky list at phaedrusdeinus.org
Wed Oct 1 18:56:13 EDT 2008

On Oct 1, 2008, at 1:46 PM, John Van Enk wrote:
> "You shoot the gun, but the bullet gets trapped in the IO monad."

You have a shootFoot function which you've proven correct. QuickCheck  
validates it for arbitrary you-like values. It will be evaluated only  
when you end up at the hospital. You hope this doesn't come to pass,  
as it actually returns a bullet-ridden copy of yourself and you don't  
want to be garbage-collected.


foreign import ccall "shootparts.h shootfoot" shoot_foot :: Gun ->  
Programmer -> IO ()


More information about the Haskell-Cafe mailing list