[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!
Bad Code Here
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!