Someone wrote in [personal profile] pozorvlak 2007-01-26 10:16 pm (UTC)

Bad Code Here

[Here's something that frequently bugs me: why can't you detect Bad Code when compiling, and then mark the code and anything that calls it as Bad unless the programmer has put in a "Badness ends here" marker? I'm thinking of code that presents a referentially transparent interface, but does state-y stuff internally. Is this fundamentally incompatible with first-class functions? Would it slow down compilation too much?]

You can! Check out Control.Monad.ST, Data.Array.ST, Data.STRef these all allow for mutable arrays and references in isolated code :)

unsafePerformIO, unsafeIterleaveIO, and more.. allow you to run IO actions that you can guarantee are safe yourself. Using an "unsafe" function is simply declares that the compiler need not worry about what you are doing, that you did the check yourself and it is safe!

Post a comment in response:

This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting